diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/InfoBase.h b/softwareDirectory/AutoVerScheme/InfoBase.h index 6dd59f3..bce9609 100644 --- a/softwareDirectory/AutoVerScheme/InfoBase.h +++ b/softwareDirectory/AutoVerScheme/InfoBase.h @@ -4,6 +4,7 @@ #include #include "QStandardItemModel" #include "databaseconnection.h" +#include "basecommonapi.h" ///信号管理页面的基类 所有信息管理页面都继承于InfoBase /// 便于统一管理 所有子类必须实现Load方法 /// 每次按钮点击切换都会调用Load方法 用于每次页面的数据刷新 @@ -16,7 +17,7 @@ //QStandardItemModel 的实例。这个模型将用于存储和管理数据。 QStandardItemModel *model; //信息管理页面 基类定义Conn对象 - DatabaseConnection *Conn=DatabaseConnection::getInstance(); + BaseCommonApi dbManager; }; #endif // INFOBASE_H diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/InfoBase.h b/softwareDirectory/AutoVerScheme/InfoBase.h index 6dd59f3..bce9609 100644 --- a/softwareDirectory/AutoVerScheme/InfoBase.h +++ b/softwareDirectory/AutoVerScheme/InfoBase.h @@ -4,6 +4,7 @@ #include #include "QStandardItemModel" #include "databaseconnection.h" +#include "basecommonapi.h" ///信号管理页面的基类 所有信息管理页面都继承于InfoBase /// 便于统一管理 所有子类必须实现Load方法 /// 每次按钮点击切换都会调用Load方法 用于每次页面的数据刷新 @@ -16,7 +17,7 @@ //QStandardItemModel 的实例。这个模型将用于存储和管理数据。 QStandardItemModel *model; //信息管理页面 基类定义Conn对象 - DatabaseConnection *Conn=DatabaseConnection::getInstance(); + BaseCommonApi dbManager; }; #endif // INFOBASE_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index f62915b..6170ee7 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -15,7 +15,7 @@ " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id " " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID " " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID " - " WHERE sys_user.ID = ' :userId '"); + " WHERE sys_user.ID = :userId"); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -75,6 +75,35 @@ } return result; } + +//获取创建任务首页数据 +QList BaseCommonApi::getCreateTaskList(QString userId) +{ + userId="1640229293790650370"; + QList result; + QSqlQuery query; + query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " + " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " + " WHERE bi.create_user_id = :userId"); + // 将参数绑定到占位符 + query.bindValue(":userId", userId); + if (query.exec()) { + while (query.next()) { + CreateTaskList task; + task.id = query.value("id").toString(); + task.order_no = query.value("order_no").toString(); + task.customer_name = query.value("customer_name").toString(); + task.DEPT_FULL_NAME = query.value("FULL_NAME").toString(); + task.require_over_time = query.value("require_over_time").toDateTime(); + task.deliverer = query.value("deliverer").toString(); + task.is_urgent = query.value("is_urgent").toString(); + result.append(task); + } + } else { + qDebug() << "Query execution failed: " << query.lastError().text(); + } + return result; +} //获取创建任务首页数据 QListgetCreateTaskList(QString userId) { @@ -82,7 +111,7 @@ QSqlQuery query; query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " - " WHERE bi.create_user_id = ':userId' "); + " WHERE bi.create_user_id = :userId "); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -103,6 +132,7 @@ return result; } + //创建任务单-查看/编辑 顶部数据 传参该条数据的id QListBaseCommonApi::getCatTask(QString id) { @@ -111,7 +141,7 @@ query.prepare("SELECT bi.order_no ,bi.customer_name ,dept.FULL_NAME ,bi.require_over_time ," " bi.deliverer ,bi.deliverer_tel ,bi.undertaker_name ,bi.undertake_time , bi.is_urgent AS ," " bi.receive_illustrate FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID" - " WHERE bi.id = ' :id '"); + " WHERE bi.id = :id "); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -140,6 +170,7 @@ //获取创建任务 -任务单列表 + QListBaseCommonApi::getCatTaskList(QString orderId) { QList result; @@ -380,6 +411,7 @@ QListBaseCommonApi::getCheckDCPower(QString equipment_id,QStringList *headList) { + equipment_id="1693435753272557570"; QList result; QSqlQuery query; query.prepare("SELECT besciddp.id ,besciddp.params,besciddp.unit,resolution,besciddp.urel,besciddp.check_type,datum_point,cycle_number " @@ -407,9 +439,11 @@ } else { qDebug() << "Query execution failed: " << query.lastError().text(); } + *headList <<"序号"<<"核查项目"<<"核查点"<<"单位"<<"分辨力"<<"Urel"<<"核查类型"<<"是否为基准点(1/0)"<<"循环次数" <<"电阻值/频率"<<"电阻值单位/频率单位"<<"核查项备注"; + return result; } //根据id获取装置名称 @@ -436,9 +470,9 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " - " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id " - " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); +bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " + " JOIN sys_dept ON sys_dept.ID = eei.dept_id " + " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); if (isSuccess) { while (query.next()) { TestedDevice testedDevice; @@ -504,9 +538,10 @@ //判断 哪个 装置表 传参 设备id QList BaseCommonApi::getJudgeCalibrationTable(QString id) { + id="1716997603953311746"; QList result; QSqlQuery query; - query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = ':id')"); + query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = :id )"); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -526,12 +561,55 @@ return result; } +//标准装置字典类型 +/** + * 多功能校准源标准装置 = 1 + * 直流稳压电源检定装置 = 2 + * 多功能电气安全校准器标准装置 = 3 + * 0.02级活塞式压力计标准装置 = 4 + * 二等铂电阻温度计标准装置 = 5 + * 安全阀校验装置 = 6 + * 精密露点仪标准装置 = 7 + * E2等级砝码标准装置 = 8 + * 频谱分析仪标准装置 = 9 + * 信号发生器标准装置 = 10 + * 微波衰减标准装置 = 11 + * 频率短期稳定度标准装置 =12 + * 示波器标准装置 = 13 + * 铯原子频率标准装置 =14 + * 小功率标准装置 = 15 + * 低频信号发生器标准装置 = 16 + * S参数标准装置 = 17 + * 失真度标准装置 = 18 + */ +//根据被检设备ID获取当前设备的 核查项目及核查点 + +QList BaseCommonApi::Search_CalibrationTable(QString DeiverId,QStringList *HeadList) +{ + + QList DataList; + DataList.clear(); + QList CliTable=BaseCommonApi::getJudgeCalibrationTable(DeiverId); + if(CliTable.count()==0)return DataList; + switch (CliTable[0].belong_standard_equipment.toInt()) + { + case 1: + + //CliTable[0].item_category_id + DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList); + break; + } + + return DataList; +} //被检设备管理-检定项目及检定点-多功能校准源 -QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) +QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) { -QList result; +QList resultData; +QStringList result; +resultData.clear(); QSqlQuery query; query.prepare("SELECT bbdmidc.id ,bbdmidc.params ,bbdmidc.capacity ,bbdmidc.unit ,bbdmidc.frequency , bbdmidc.range_range , bbdmidc.standard_value , bbdmidc.resolution , bbdmidc.maximum_error , bbdmidc.error_param_a , bbdmidc.error_param_b " @@ -542,26 +620,24 @@ if (query.exec()) { while (query.next()) { - VerMultiCal calibration; - calibration.id = query.value("id").toString(); - calibration.params = query.value("params").toString(); - calibration.capacity = query.value("capacity").toString(); - calibration.unit = query.value("unit").toString(); - calibration.frequency = query.value("frequency").toString(); - calibration.range_range = query.value("range_range").toString(); - calibration.standard_value = query.value("standard_value").toString(); - calibration.resolution = query.value("resolution").toString(); - calibration.maximum_error = query.value("maximum_error").toString(); - calibration.error_param_a = query.value("error_param_a").toString(); - calibration.error_param_b = query.value("error_param_b").toString(); - - result.append(calibration); + result.clear(); + result.append(query.value("id").toString()); + result.append(query.value("params").toString()); + result.append(query.value("capacity").toString()); + result.append(query.value("unit").toString()); + result.append(query.value("frequency").toString()); + result.append(query.value("range_range").toString()); + result.append(query.value("standard_value").toString()); + result.append(query.value("resolution").toString()); + result.append(query.value("maximum_error").toString()); + result.append(query.value("error_param_a").toString()); + result.append(query.value("error_param_b").toString()); + resultData.append(result); } } else { qDebug() << "Query execution failed: " << query.lastError().text(); } - *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; - return result; + *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; } //检定数据管理 首页 @@ -757,7 +833,7 @@ " LEFT JOIN biz_equipment_standard_check_info besci ON besci.item_category_id = bescidc.item_category_id " " WHERE bescidc.equipment_id = :equipment_id "); - // 将参数绑定到占位符 '1692796512381222914' + // 将参数绑定到占位符 1692796512381222914 query.bindValue(":equipment_id", equipment_id); if (query.exec()) { while (query.next()) { @@ -788,12 +864,13 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " + bool isSuccess = query.exec("SELECT brtf.id,brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " " FROM biz_resource_technique_file brtf"); if (isSuccess) { while (query.next()) { Technique_File file; + file.id=query.value("id").toString(); file.file_distribute_no = query.value("file_distribute_no").toString(); file.file_name = query.value("file_name").toString(); file.version_no = query.value("version_no").toString(); @@ -876,7 +953,7 @@ QList result; QSqlQuery query; query.prepare("SELECT id,device_id ,communication_type ,serial_port ,visa ,create_time ,update_time " - "FROM zd_communication_setting WHERE device_id = ' :deviceId '"); + "FROM zd_communication_setting WHERE device_id = :deviceId "); query.bindValue(":deviceId", deviceId); if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/InfoBase.h b/softwareDirectory/AutoVerScheme/InfoBase.h index 6dd59f3..bce9609 100644 --- a/softwareDirectory/AutoVerScheme/InfoBase.h +++ b/softwareDirectory/AutoVerScheme/InfoBase.h @@ -4,6 +4,7 @@ #include #include "QStandardItemModel" #include "databaseconnection.h" +#include "basecommonapi.h" ///信号管理页面的基类 所有信息管理页面都继承于InfoBase /// 便于统一管理 所有子类必须实现Load方法 /// 每次按钮点击切换都会调用Load方法 用于每次页面的数据刷新 @@ -16,7 +17,7 @@ //QStandardItemModel 的实例。这个模型将用于存储和管理数据。 QStandardItemModel *model; //信息管理页面 基类定义Conn对象 - DatabaseConnection *Conn=DatabaseConnection::getInstance(); + BaseCommonApi dbManager; }; #endif // INFOBASE_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index f62915b..6170ee7 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -15,7 +15,7 @@ " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id " " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID " " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID " - " WHERE sys_user.ID = ' :userId '"); + " WHERE sys_user.ID = :userId"); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -75,6 +75,35 @@ } return result; } + +//获取创建任务首页数据 +QList BaseCommonApi::getCreateTaskList(QString userId) +{ + userId="1640229293790650370"; + QList result; + QSqlQuery query; + query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " + " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " + " WHERE bi.create_user_id = :userId"); + // 将参数绑定到占位符 + query.bindValue(":userId", userId); + if (query.exec()) { + while (query.next()) { + CreateTaskList task; + task.id = query.value("id").toString(); + task.order_no = query.value("order_no").toString(); + task.customer_name = query.value("customer_name").toString(); + task.DEPT_FULL_NAME = query.value("FULL_NAME").toString(); + task.require_over_time = query.value("require_over_time").toDateTime(); + task.deliverer = query.value("deliverer").toString(); + task.is_urgent = query.value("is_urgent").toString(); + result.append(task); + } + } else { + qDebug() << "Query execution failed: " << query.lastError().text(); + } + return result; +} //获取创建任务首页数据 QListgetCreateTaskList(QString userId) { @@ -82,7 +111,7 @@ QSqlQuery query; query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " - " WHERE bi.create_user_id = ':userId' "); + " WHERE bi.create_user_id = :userId "); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -103,6 +132,7 @@ return result; } + //创建任务单-查看/编辑 顶部数据 传参该条数据的id QListBaseCommonApi::getCatTask(QString id) { @@ -111,7 +141,7 @@ query.prepare("SELECT bi.order_no ,bi.customer_name ,dept.FULL_NAME ,bi.require_over_time ," " bi.deliverer ,bi.deliverer_tel ,bi.undertaker_name ,bi.undertake_time , bi.is_urgent AS ," " bi.receive_illustrate FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID" - " WHERE bi.id = ' :id '"); + " WHERE bi.id = :id "); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -140,6 +170,7 @@ //获取创建任务 -任务单列表 + QListBaseCommonApi::getCatTaskList(QString orderId) { QList result; @@ -380,6 +411,7 @@ QListBaseCommonApi::getCheckDCPower(QString equipment_id,QStringList *headList) { + equipment_id="1693435753272557570"; QList result; QSqlQuery query; query.prepare("SELECT besciddp.id ,besciddp.params,besciddp.unit,resolution,besciddp.urel,besciddp.check_type,datum_point,cycle_number " @@ -407,9 +439,11 @@ } else { qDebug() << "Query execution failed: " << query.lastError().text(); } + *headList <<"序号"<<"核查项目"<<"核查点"<<"单位"<<"分辨力"<<"Urel"<<"核查类型"<<"是否为基准点(1/0)"<<"循环次数" <<"电阻值/频率"<<"电阻值单位/频率单位"<<"核查项备注"; + return result; } //根据id获取装置名称 @@ -436,9 +470,9 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " - " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id " - " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); +bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " + " JOIN sys_dept ON sys_dept.ID = eei.dept_id " + " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); if (isSuccess) { while (query.next()) { TestedDevice testedDevice; @@ -504,9 +538,10 @@ //判断 哪个 装置表 传参 设备id QList BaseCommonApi::getJudgeCalibrationTable(QString id) { + id="1716997603953311746"; QList result; QSqlQuery query; - query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = ':id')"); + query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = :id )"); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -526,12 +561,55 @@ return result; } +//标准装置字典类型 +/** + * 多功能校准源标准装置 = 1 + * 直流稳压电源检定装置 = 2 + * 多功能电气安全校准器标准装置 = 3 + * 0.02级活塞式压力计标准装置 = 4 + * 二等铂电阻温度计标准装置 = 5 + * 安全阀校验装置 = 6 + * 精密露点仪标准装置 = 7 + * E2等级砝码标准装置 = 8 + * 频谱分析仪标准装置 = 9 + * 信号发生器标准装置 = 10 + * 微波衰减标准装置 = 11 + * 频率短期稳定度标准装置 =12 + * 示波器标准装置 = 13 + * 铯原子频率标准装置 =14 + * 小功率标准装置 = 15 + * 低频信号发生器标准装置 = 16 + * S参数标准装置 = 17 + * 失真度标准装置 = 18 + */ +//根据被检设备ID获取当前设备的 核查项目及核查点 + +QList BaseCommonApi::Search_CalibrationTable(QString DeiverId,QStringList *HeadList) +{ + + QList DataList; + DataList.clear(); + QList CliTable=BaseCommonApi::getJudgeCalibrationTable(DeiverId); + if(CliTable.count()==0)return DataList; + switch (CliTable[0].belong_standard_equipment.toInt()) + { + case 1: + + //CliTable[0].item_category_id + DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList); + break; + } + + return DataList; +} //被检设备管理-检定项目及检定点-多功能校准源 -QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) +QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) { -QList result; +QList resultData; +QStringList result; +resultData.clear(); QSqlQuery query; query.prepare("SELECT bbdmidc.id ,bbdmidc.params ,bbdmidc.capacity ,bbdmidc.unit ,bbdmidc.frequency , bbdmidc.range_range , bbdmidc.standard_value , bbdmidc.resolution , bbdmidc.maximum_error , bbdmidc.error_param_a , bbdmidc.error_param_b " @@ -542,26 +620,24 @@ if (query.exec()) { while (query.next()) { - VerMultiCal calibration; - calibration.id = query.value("id").toString(); - calibration.params = query.value("params").toString(); - calibration.capacity = query.value("capacity").toString(); - calibration.unit = query.value("unit").toString(); - calibration.frequency = query.value("frequency").toString(); - calibration.range_range = query.value("range_range").toString(); - calibration.standard_value = query.value("standard_value").toString(); - calibration.resolution = query.value("resolution").toString(); - calibration.maximum_error = query.value("maximum_error").toString(); - calibration.error_param_a = query.value("error_param_a").toString(); - calibration.error_param_b = query.value("error_param_b").toString(); - - result.append(calibration); + result.clear(); + result.append(query.value("id").toString()); + result.append(query.value("params").toString()); + result.append(query.value("capacity").toString()); + result.append(query.value("unit").toString()); + result.append(query.value("frequency").toString()); + result.append(query.value("range_range").toString()); + result.append(query.value("standard_value").toString()); + result.append(query.value("resolution").toString()); + result.append(query.value("maximum_error").toString()); + result.append(query.value("error_param_a").toString()); + result.append(query.value("error_param_b").toString()); + resultData.append(result); } } else { qDebug() << "Query execution failed: " << query.lastError().text(); } - *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; - return result; + *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; } //检定数据管理 首页 @@ -757,7 +833,7 @@ " LEFT JOIN biz_equipment_standard_check_info besci ON besci.item_category_id = bescidc.item_category_id " " WHERE bescidc.equipment_id = :equipment_id "); - // 将参数绑定到占位符 '1692796512381222914' + // 将参数绑定到占位符 1692796512381222914 query.bindValue(":equipment_id", equipment_id); if (query.exec()) { while (query.next()) { @@ -788,12 +864,13 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " + bool isSuccess = query.exec("SELECT brtf.id,brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " " FROM biz_resource_technique_file brtf"); if (isSuccess) { while (query.next()) { Technique_File file; + file.id=query.value("id").toString(); file.file_distribute_no = query.value("file_distribute_no").toString(); file.file_name = query.value("file_name").toString(); file.version_no = query.value("version_no").toString(); @@ -876,7 +953,7 @@ QList result; QSqlQuery query; query.prepare("SELECT id,device_id ,communication_type ,serial_port ,visa ,create_time ,update_time " - "FROM zd_communication_setting WHERE device_id = ' :deviceId '"); + "FROM zd_communication_setting WHERE device_id = :deviceId "); query.bindValue(":deviceId", deviceId); if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h index 1b70cb9..ff8a320 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.h +++ b/softwareDirectory/AutoVerScheme/basecommonapi.h @@ -9,7 +9,7 @@ #include "databaseconnection.h" #include "id\IdWorker.h" - +#include "QStringList" //部门任务 @@ -52,6 +52,7 @@ QDateTime require_over_time; QString deliverer; QString is_urgent; + }; //创建任务单-查看任务单 class CatTask @@ -241,9 +242,15 @@ QString belong_standard_equipment; }; +class BaseEntity: public QObject +{ + Q_OBJECT + public: + +}; //被检设备管理-检定项目及检定点-检定项多功能校准源 -class VerMultiCal +class VerMultiCal:public BaseEntity { public: QString id; @@ -365,6 +372,7 @@ class Technique_File { public: + QString id; QString file_distribute_no; QString file_name; QString version_no; @@ -444,12 +452,22 @@ public: BaseCommonApi(); + // + static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList); + //部门任务 + static QList getAllData(); + //部门任务 参数登录用户的id static QList getAllData(QString userId); + //我的任务 static QList getMyTasks(QString id); //获取创建任务首页数据 - static QListgetCreateTaskList(QString id); + + static QListgetCreateTaskList(QString userId); + + + //创建任务-查看任务单顶部 static QListgetCatTask(QString orderNo); //创建任务-查看任务列表底部 @@ -479,7 +497,10 @@ //判断 哪个 装置表 传参 设备id 返回itemId static QList getJudgeCalibrationTable(QString id); //被检设备管理-检定项目及检定点-多功能校准源 - static QList getVerMultiCal(QString itemId,QStringList *headList); + + + static QList getVerMultiCal(QString itemId,QStringList *headList); + // 获取检定数据管理 首页 static QList getVerificationData(); // 检定数据管理-检定基本信息 @@ -494,6 +515,7 @@ static QList getCheckDataManageResultManageMult(QString equipment_id); //技术文件 static QList getTechnique_File(); + //检定程序管理首页查询 static QList getVerificationProgramInfoMain(); //检定程序管理 编辑 @@ -525,7 +547,6 @@ IdWorker &idWorker = Singleton::instance(); //自动检定 - }; diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/InfoBase.h b/softwareDirectory/AutoVerScheme/InfoBase.h index 6dd59f3..bce9609 100644 --- a/softwareDirectory/AutoVerScheme/InfoBase.h +++ b/softwareDirectory/AutoVerScheme/InfoBase.h @@ -4,6 +4,7 @@ #include #include "QStandardItemModel" #include "databaseconnection.h" +#include "basecommonapi.h" ///信号管理页面的基类 所有信息管理页面都继承于InfoBase /// 便于统一管理 所有子类必须实现Load方法 /// 每次按钮点击切换都会调用Load方法 用于每次页面的数据刷新 @@ -16,7 +17,7 @@ //QStandardItemModel 的实例。这个模型将用于存储和管理数据。 QStandardItemModel *model; //信息管理页面 基类定义Conn对象 - DatabaseConnection *Conn=DatabaseConnection::getInstance(); + BaseCommonApi dbManager; }; #endif // INFOBASE_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index f62915b..6170ee7 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -15,7 +15,7 @@ " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id " " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID " " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID " - " WHERE sys_user.ID = ' :userId '"); + " WHERE sys_user.ID = :userId"); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -75,6 +75,35 @@ } return result; } + +//获取创建任务首页数据 +QList BaseCommonApi::getCreateTaskList(QString userId) +{ + userId="1640229293790650370"; + QList result; + QSqlQuery query; + query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " + " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " + " WHERE bi.create_user_id = :userId"); + // 将参数绑定到占位符 + query.bindValue(":userId", userId); + if (query.exec()) { + while (query.next()) { + CreateTaskList task; + task.id = query.value("id").toString(); + task.order_no = query.value("order_no").toString(); + task.customer_name = query.value("customer_name").toString(); + task.DEPT_FULL_NAME = query.value("FULL_NAME").toString(); + task.require_over_time = query.value("require_over_time").toDateTime(); + task.deliverer = query.value("deliverer").toString(); + task.is_urgent = query.value("is_urgent").toString(); + result.append(task); + } + } else { + qDebug() << "Query execution failed: " << query.lastError().text(); + } + return result; +} //获取创建任务首页数据 QListgetCreateTaskList(QString userId) { @@ -82,7 +111,7 @@ QSqlQuery query; query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " - " WHERE bi.create_user_id = ':userId' "); + " WHERE bi.create_user_id = :userId "); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -103,6 +132,7 @@ return result; } + //创建任务单-查看/编辑 顶部数据 传参该条数据的id QListBaseCommonApi::getCatTask(QString id) { @@ -111,7 +141,7 @@ query.prepare("SELECT bi.order_no ,bi.customer_name ,dept.FULL_NAME ,bi.require_over_time ," " bi.deliverer ,bi.deliverer_tel ,bi.undertaker_name ,bi.undertake_time , bi.is_urgent AS ," " bi.receive_illustrate FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID" - " WHERE bi.id = ' :id '"); + " WHERE bi.id = :id "); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -140,6 +170,7 @@ //获取创建任务 -任务单列表 + QListBaseCommonApi::getCatTaskList(QString orderId) { QList result; @@ -380,6 +411,7 @@ QListBaseCommonApi::getCheckDCPower(QString equipment_id,QStringList *headList) { + equipment_id="1693435753272557570"; QList result; QSqlQuery query; query.prepare("SELECT besciddp.id ,besciddp.params,besciddp.unit,resolution,besciddp.urel,besciddp.check_type,datum_point,cycle_number " @@ -407,9 +439,11 @@ } else { qDebug() << "Query execution failed: " << query.lastError().text(); } + *headList <<"序号"<<"核查项目"<<"核查点"<<"单位"<<"分辨力"<<"Urel"<<"核查类型"<<"是否为基准点(1/0)"<<"循环次数" <<"电阻值/频率"<<"电阻值单位/频率单位"<<"核查项备注"; + return result; } //根据id获取装置名称 @@ -436,9 +470,9 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " - " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id " - " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); +bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " + " JOIN sys_dept ON sys_dept.ID = eei.dept_id " + " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); if (isSuccess) { while (query.next()) { TestedDevice testedDevice; @@ -504,9 +538,10 @@ //判断 哪个 装置表 传参 设备id QList BaseCommonApi::getJudgeCalibrationTable(QString id) { + id="1716997603953311746"; QList result; QSqlQuery query; - query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = ':id')"); + query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = :id )"); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -526,12 +561,55 @@ return result; } +//标准装置字典类型 +/** + * 多功能校准源标准装置 = 1 + * 直流稳压电源检定装置 = 2 + * 多功能电气安全校准器标准装置 = 3 + * 0.02级活塞式压力计标准装置 = 4 + * 二等铂电阻温度计标准装置 = 5 + * 安全阀校验装置 = 6 + * 精密露点仪标准装置 = 7 + * E2等级砝码标准装置 = 8 + * 频谱分析仪标准装置 = 9 + * 信号发生器标准装置 = 10 + * 微波衰减标准装置 = 11 + * 频率短期稳定度标准装置 =12 + * 示波器标准装置 = 13 + * 铯原子频率标准装置 =14 + * 小功率标准装置 = 15 + * 低频信号发生器标准装置 = 16 + * S参数标准装置 = 17 + * 失真度标准装置 = 18 + */ +//根据被检设备ID获取当前设备的 核查项目及核查点 + +QList BaseCommonApi::Search_CalibrationTable(QString DeiverId,QStringList *HeadList) +{ + + QList DataList; + DataList.clear(); + QList CliTable=BaseCommonApi::getJudgeCalibrationTable(DeiverId); + if(CliTable.count()==0)return DataList; + switch (CliTable[0].belong_standard_equipment.toInt()) + { + case 1: + + //CliTable[0].item_category_id + DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList); + break; + } + + return DataList; +} //被检设备管理-检定项目及检定点-多功能校准源 -QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) +QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) { -QList result; +QList resultData; +QStringList result; +resultData.clear(); QSqlQuery query; query.prepare("SELECT bbdmidc.id ,bbdmidc.params ,bbdmidc.capacity ,bbdmidc.unit ,bbdmidc.frequency , bbdmidc.range_range , bbdmidc.standard_value , bbdmidc.resolution , bbdmidc.maximum_error , bbdmidc.error_param_a , bbdmidc.error_param_b " @@ -542,26 +620,24 @@ if (query.exec()) { while (query.next()) { - VerMultiCal calibration; - calibration.id = query.value("id").toString(); - calibration.params = query.value("params").toString(); - calibration.capacity = query.value("capacity").toString(); - calibration.unit = query.value("unit").toString(); - calibration.frequency = query.value("frequency").toString(); - calibration.range_range = query.value("range_range").toString(); - calibration.standard_value = query.value("standard_value").toString(); - calibration.resolution = query.value("resolution").toString(); - calibration.maximum_error = query.value("maximum_error").toString(); - calibration.error_param_a = query.value("error_param_a").toString(); - calibration.error_param_b = query.value("error_param_b").toString(); - - result.append(calibration); + result.clear(); + result.append(query.value("id").toString()); + result.append(query.value("params").toString()); + result.append(query.value("capacity").toString()); + result.append(query.value("unit").toString()); + result.append(query.value("frequency").toString()); + result.append(query.value("range_range").toString()); + result.append(query.value("standard_value").toString()); + result.append(query.value("resolution").toString()); + result.append(query.value("maximum_error").toString()); + result.append(query.value("error_param_a").toString()); + result.append(query.value("error_param_b").toString()); + resultData.append(result); } } else { qDebug() << "Query execution failed: " << query.lastError().text(); } - *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; - return result; + *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; } //检定数据管理 首页 @@ -757,7 +833,7 @@ " LEFT JOIN biz_equipment_standard_check_info besci ON besci.item_category_id = bescidc.item_category_id " " WHERE bescidc.equipment_id = :equipment_id "); - // 将参数绑定到占位符 '1692796512381222914' + // 将参数绑定到占位符 1692796512381222914 query.bindValue(":equipment_id", equipment_id); if (query.exec()) { while (query.next()) { @@ -788,12 +864,13 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " + bool isSuccess = query.exec("SELECT brtf.id,brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " " FROM biz_resource_technique_file brtf"); if (isSuccess) { while (query.next()) { Technique_File file; + file.id=query.value("id").toString(); file.file_distribute_no = query.value("file_distribute_no").toString(); file.file_name = query.value("file_name").toString(); file.version_no = query.value("version_no").toString(); @@ -876,7 +953,7 @@ QList result; QSqlQuery query; query.prepare("SELECT id,device_id ,communication_type ,serial_port ,visa ,create_time ,update_time " - "FROM zd_communication_setting WHERE device_id = ' :deviceId '"); + "FROM zd_communication_setting WHERE device_id = :deviceId "); query.bindValue(":deviceId", deviceId); if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h index 1b70cb9..ff8a320 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.h +++ b/softwareDirectory/AutoVerScheme/basecommonapi.h @@ -9,7 +9,7 @@ #include "databaseconnection.h" #include "id\IdWorker.h" - +#include "QStringList" //部门任务 @@ -52,6 +52,7 @@ QDateTime require_over_time; QString deliverer; QString is_urgent; + }; //创建任务单-查看任务单 class CatTask @@ -241,9 +242,15 @@ QString belong_standard_equipment; }; +class BaseEntity: public QObject +{ + Q_OBJECT + public: + +}; //被检设备管理-检定项目及检定点-检定项多功能校准源 -class VerMultiCal +class VerMultiCal:public BaseEntity { public: QString id; @@ -365,6 +372,7 @@ class Technique_File { public: + QString id; QString file_distribute_no; QString file_name; QString version_no; @@ -444,12 +452,22 @@ public: BaseCommonApi(); + // + static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList); + //部门任务 + static QList getAllData(); + //部门任务 参数登录用户的id static QList getAllData(QString userId); + //我的任务 static QList getMyTasks(QString id); //获取创建任务首页数据 - static QListgetCreateTaskList(QString id); + + static QListgetCreateTaskList(QString userId); + + + //创建任务-查看任务单顶部 static QListgetCatTask(QString orderNo); //创建任务-查看任务列表底部 @@ -479,7 +497,10 @@ //判断 哪个 装置表 传参 设备id 返回itemId static QList getJudgeCalibrationTable(QString id); //被检设备管理-检定项目及检定点-多功能校准源 - static QList getVerMultiCal(QString itemId,QStringList *headList); + + + static QList getVerMultiCal(QString itemId,QStringList *headList); + // 获取检定数据管理 首页 static QList getVerificationData(); // 检定数据管理-检定基本信息 @@ -494,6 +515,7 @@ static QList getCheckDataManageResultManageMult(QString equipment_id); //技术文件 static QList getTechnique_File(); + //检定程序管理首页查询 static QList getVerificationProgramInfoMain(); //检定程序管理 编辑 @@ -525,7 +547,6 @@ IdWorker &idWorker = Singleton::instance(); //自动检定 - }; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp index c3b2786..70148f4 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp @@ -4,6 +4,7 @@ #include "basecommonapi.h" //#include "tested_device_manage_serve.h" +#include "QStringList" //被检设备 BeExamined_DeviceItem::BeExamined_DeviceItem(QWidget *parent) : @@ -32,19 +33,32 @@ "}"); // ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); // item->setTextAlignment(Qt::AlignCenter); //ui->tableWidget->setItem(0, 0, item); //设置数据 - + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" + headers << "ID" << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" << "生产厂家"<<"所在单位" <<"使用部门"<<"计量标识"<<"检定周期"<<"证书有效期"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); + //详情页面tableWidgetItem设置 + ui->tableWidgetItem->setStyleSheet("QHeaderView::section {" + "border: 1px solid rgba(197, 196, 196, 1);" + "border-left:none;" + "border-top:none;" + "background-color:white;" + "}"); + + // ui->tableWidget->setRowCount(10); // 设置10行 + //ui->tableWidgetItem->setColumnCount(14); // 设置11列 + ui->tableWidgetItem->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 + ui->tableWidgetItem->verticalHeader()->setParent(nullptr); //隐藏行头 + } void BeExamined_DeviceItem::ShowMessageBox(QString title,QString value) { // 创建一个QMessageBox对象 @@ -64,24 +78,19 @@ } void BeExamined_DeviceItem::Load() { - //获取主页面内容 - //进入主页面 - /* - ui->stackedWidget->setCurrentIndex(0); + // ======================================================================================== + // 主页面初始化 + // ==================================================================================== + + + ui->stackedWidget->setCurrentIndex(0); //先设置为行为0 ui->tableWidget->setRowCount(0); - - - // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BeExamined_DeviceItem dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; int row=0; - QList data = dbManager.getBizDeviceManage(); - - - for (const BizDevice& bizDevice : data) { + QList data = dbManager.getTestedDevice(); + for (const TestedDevice& bizDevice : data) { rowCount = ui->tableWidget->rowCount(); ui->tableWidget->insertRow(rowCount); @@ -89,34 +98,118 @@ ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); ui->tableWidget->setItem(row, 2, new QTableWidgetItem(bizDevice.equipment_name)); ui->tableWidget->setItem(row, 3, new QTableWidgetItem(bizDevice.model)); - ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacture_no)); - ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.help_instruction)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacture_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(bizDevice.FULL_NAME)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(bizDevice.meter_identify)); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem(bizDevice.check_cycle)); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(bizDevice.certificate_valid)); + //添加操作按钮 QPushButton *button = new QPushButton("查看"); - ui->tableWidget->setCellWidget(row, 6, button); + ui->tableWidget->setCellWidget(row, 12, button); //设置按钮简单样式 button->setStyleSheet("QPushButton {" - " border: none; /* 无边框 "*/ - // " color: green; /* 文本颜色 */" - // " text-decoration: underline; /* 文本下划线 */" - // "}"); + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); // 设置鼠标悬停时的光标样式为小手图标 - // button->setCursor(Qt::PointingHandCursor); + button->setCursor(Qt::PointingHandCursor); // 连接按钮的 clicked 信号到自定义槽函数 - // connect(button, &QPushButton::clicked, this, [this, button, row]() { - // 获取当前行第一列的 ID - // QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); - // if (idItem) { - // QString id = idItem->text(); -// - // OnButtonSelectClicked(id); - // } + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); - // }); + OnButtonSelectClicked(id); + } - // row++; - - // } + }); + row++; + } } +void BeExamined_DeviceItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + + DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +//返回按钮 +void BeExamined_DeviceItem::on_pushButton_2_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); +} +void BeExamined_DeviceItem::DeviceInfoInit(QString id) +{ + // ======================================================================================== + // 初始化详情 + // ==================================================================================== + + QList data = dbManager.getTestedCatDevice(id); + for (const TestedCatDevice& testedCatDevice : data) { + + ui->equipment_name->setText(testedCatDevice.equipment_name); + ui->model->setText(testedCatDevice.model); + ui->help_instruction->setText(testedCatDevice.help_instruction); + ui->manufacture_no->setText(testedCatDevice.manufacture_no); + ui->product_country->setText(testedCatDevice.product_country); + ui->manufacturer->setText(testedCatDevice.manufacturer); + ui->product_date->setText(testedCatDevice.product_date); + ui->purchase_date->setText(testedCatDevice.purchase_date); + ui->unit_price->setText(testedCatDevice.unit_price); + ui->usage_status->setText(testedCatDevice.usage_status); + ui->quality_condition->setText(testedCatDevice.quality_condition); + ui->dept_name->setText(testedCatDevice.FULL_NAME); + ui->category->setText(testedCatDevice.category); + ui->check_cycle->setText(testedCatDevice.check_cycle); + ui->level->setText(testedCatDevice.level); + ui->remark->setText(testedCatDevice.remark); + } + + + // ======================================================================================== + // 初始化检定项目及核查点 + // ==================================================================================== + + //获取核查点tablewight的数据 + QStringList headlist; + + QList Data=dbManager.Search_CalibrationTable(id,&headlist); + + //tableWidgetItem + ui->tableWidgetItem->setRowCount(0); + ui->tableWidgetItem->setColumnCount(headlist.count()); + ui->tableWidgetItem->setHorizontalHeaderLabels(headlist); + //循环数据 + int rowCount=0; + int row=0; + ; + for (const QStringList& item : Data) + { + //获取行号 并进行添加行 + rowCount = ui->tableWidgetItem->rowCount(); + ui->tableWidgetItem->insertRow(rowCount); + //添加 序号 + ui->tableWidgetItem->setItem(row, 0, new QTableWidgetItem(QString::number(row+1))); + //循环读取值 headlist,count是列的数量 + for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型 + } + + row++; + + } +} + + + diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/InfoBase.h b/softwareDirectory/AutoVerScheme/InfoBase.h index 6dd59f3..bce9609 100644 --- a/softwareDirectory/AutoVerScheme/InfoBase.h +++ b/softwareDirectory/AutoVerScheme/InfoBase.h @@ -4,6 +4,7 @@ #include #include "QStandardItemModel" #include "databaseconnection.h" +#include "basecommonapi.h" ///信号管理页面的基类 所有信息管理页面都继承于InfoBase /// 便于统一管理 所有子类必须实现Load方法 /// 每次按钮点击切换都会调用Load方法 用于每次页面的数据刷新 @@ -16,7 +17,7 @@ //QStandardItemModel 的实例。这个模型将用于存储和管理数据。 QStandardItemModel *model; //信息管理页面 基类定义Conn对象 - DatabaseConnection *Conn=DatabaseConnection::getInstance(); + BaseCommonApi dbManager; }; #endif // INFOBASE_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index f62915b..6170ee7 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -15,7 +15,7 @@ " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id " " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID " " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID " - " WHERE sys_user.ID = ' :userId '"); + " WHERE sys_user.ID = :userId"); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -75,6 +75,35 @@ } return result; } + +//获取创建任务首页数据 +QList BaseCommonApi::getCreateTaskList(QString userId) +{ + userId="1640229293790650370"; + QList result; + QSqlQuery query; + query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " + " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " + " WHERE bi.create_user_id = :userId"); + // 将参数绑定到占位符 + query.bindValue(":userId", userId); + if (query.exec()) { + while (query.next()) { + CreateTaskList task; + task.id = query.value("id").toString(); + task.order_no = query.value("order_no").toString(); + task.customer_name = query.value("customer_name").toString(); + task.DEPT_FULL_NAME = query.value("FULL_NAME").toString(); + task.require_over_time = query.value("require_over_time").toDateTime(); + task.deliverer = query.value("deliverer").toString(); + task.is_urgent = query.value("is_urgent").toString(); + result.append(task); + } + } else { + qDebug() << "Query execution failed: " << query.lastError().text(); + } + return result; +} //获取创建任务首页数据 QListgetCreateTaskList(QString userId) { @@ -82,7 +111,7 @@ QSqlQuery query; query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " - " WHERE bi.create_user_id = ':userId' "); + " WHERE bi.create_user_id = :userId "); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -103,6 +132,7 @@ return result; } + //创建任务单-查看/编辑 顶部数据 传参该条数据的id QListBaseCommonApi::getCatTask(QString id) { @@ -111,7 +141,7 @@ query.prepare("SELECT bi.order_no ,bi.customer_name ,dept.FULL_NAME ,bi.require_over_time ," " bi.deliverer ,bi.deliverer_tel ,bi.undertaker_name ,bi.undertake_time , bi.is_urgent AS ," " bi.receive_illustrate FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID" - " WHERE bi.id = ' :id '"); + " WHERE bi.id = :id "); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -140,6 +170,7 @@ //获取创建任务 -任务单列表 + QListBaseCommonApi::getCatTaskList(QString orderId) { QList result; @@ -380,6 +411,7 @@ QListBaseCommonApi::getCheckDCPower(QString equipment_id,QStringList *headList) { + equipment_id="1693435753272557570"; QList result; QSqlQuery query; query.prepare("SELECT besciddp.id ,besciddp.params,besciddp.unit,resolution,besciddp.urel,besciddp.check_type,datum_point,cycle_number " @@ -407,9 +439,11 @@ } else { qDebug() << "Query execution failed: " << query.lastError().text(); } + *headList <<"序号"<<"核查项目"<<"核查点"<<"单位"<<"分辨力"<<"Urel"<<"核查类型"<<"是否为基准点(1/0)"<<"循环次数" <<"电阻值/频率"<<"电阻值单位/频率单位"<<"核查项备注"; + return result; } //根据id获取装置名称 @@ -436,9 +470,9 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " - " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id " - " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); +bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " + " JOIN sys_dept ON sys_dept.ID = eei.dept_id " + " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); if (isSuccess) { while (query.next()) { TestedDevice testedDevice; @@ -504,9 +538,10 @@ //判断 哪个 装置表 传参 设备id QList BaseCommonApi::getJudgeCalibrationTable(QString id) { + id="1716997603953311746"; QList result; QSqlQuery query; - query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = ':id')"); + query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = :id )"); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -526,12 +561,55 @@ return result; } +//标准装置字典类型 +/** + * 多功能校准源标准装置 = 1 + * 直流稳压电源检定装置 = 2 + * 多功能电气安全校准器标准装置 = 3 + * 0.02级活塞式压力计标准装置 = 4 + * 二等铂电阻温度计标准装置 = 5 + * 安全阀校验装置 = 6 + * 精密露点仪标准装置 = 7 + * E2等级砝码标准装置 = 8 + * 频谱分析仪标准装置 = 9 + * 信号发生器标准装置 = 10 + * 微波衰减标准装置 = 11 + * 频率短期稳定度标准装置 =12 + * 示波器标准装置 = 13 + * 铯原子频率标准装置 =14 + * 小功率标准装置 = 15 + * 低频信号发生器标准装置 = 16 + * S参数标准装置 = 17 + * 失真度标准装置 = 18 + */ +//根据被检设备ID获取当前设备的 核查项目及核查点 + +QList BaseCommonApi::Search_CalibrationTable(QString DeiverId,QStringList *HeadList) +{ + + QList DataList; + DataList.clear(); + QList CliTable=BaseCommonApi::getJudgeCalibrationTable(DeiverId); + if(CliTable.count()==0)return DataList; + switch (CliTable[0].belong_standard_equipment.toInt()) + { + case 1: + + //CliTable[0].item_category_id + DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList); + break; + } + + return DataList; +} //被检设备管理-检定项目及检定点-多功能校准源 -QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) +QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) { -QList result; +QList resultData; +QStringList result; +resultData.clear(); QSqlQuery query; query.prepare("SELECT bbdmidc.id ,bbdmidc.params ,bbdmidc.capacity ,bbdmidc.unit ,bbdmidc.frequency , bbdmidc.range_range , bbdmidc.standard_value , bbdmidc.resolution , bbdmidc.maximum_error , bbdmidc.error_param_a , bbdmidc.error_param_b " @@ -542,26 +620,24 @@ if (query.exec()) { while (query.next()) { - VerMultiCal calibration; - calibration.id = query.value("id").toString(); - calibration.params = query.value("params").toString(); - calibration.capacity = query.value("capacity").toString(); - calibration.unit = query.value("unit").toString(); - calibration.frequency = query.value("frequency").toString(); - calibration.range_range = query.value("range_range").toString(); - calibration.standard_value = query.value("standard_value").toString(); - calibration.resolution = query.value("resolution").toString(); - calibration.maximum_error = query.value("maximum_error").toString(); - calibration.error_param_a = query.value("error_param_a").toString(); - calibration.error_param_b = query.value("error_param_b").toString(); - - result.append(calibration); + result.clear(); + result.append(query.value("id").toString()); + result.append(query.value("params").toString()); + result.append(query.value("capacity").toString()); + result.append(query.value("unit").toString()); + result.append(query.value("frequency").toString()); + result.append(query.value("range_range").toString()); + result.append(query.value("standard_value").toString()); + result.append(query.value("resolution").toString()); + result.append(query.value("maximum_error").toString()); + result.append(query.value("error_param_a").toString()); + result.append(query.value("error_param_b").toString()); + resultData.append(result); } } else { qDebug() << "Query execution failed: " << query.lastError().text(); } - *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; - return result; + *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; } //检定数据管理 首页 @@ -757,7 +833,7 @@ " LEFT JOIN biz_equipment_standard_check_info besci ON besci.item_category_id = bescidc.item_category_id " " WHERE bescidc.equipment_id = :equipment_id "); - // 将参数绑定到占位符 '1692796512381222914' + // 将参数绑定到占位符 1692796512381222914 query.bindValue(":equipment_id", equipment_id); if (query.exec()) { while (query.next()) { @@ -788,12 +864,13 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " + bool isSuccess = query.exec("SELECT brtf.id,brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " " FROM biz_resource_technique_file brtf"); if (isSuccess) { while (query.next()) { Technique_File file; + file.id=query.value("id").toString(); file.file_distribute_no = query.value("file_distribute_no").toString(); file.file_name = query.value("file_name").toString(); file.version_no = query.value("version_no").toString(); @@ -876,7 +953,7 @@ QList result; QSqlQuery query; query.prepare("SELECT id,device_id ,communication_type ,serial_port ,visa ,create_time ,update_time " - "FROM zd_communication_setting WHERE device_id = ' :deviceId '"); + "FROM zd_communication_setting WHERE device_id = :deviceId "); query.bindValue(":deviceId", deviceId); if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h index 1b70cb9..ff8a320 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.h +++ b/softwareDirectory/AutoVerScheme/basecommonapi.h @@ -9,7 +9,7 @@ #include "databaseconnection.h" #include "id\IdWorker.h" - +#include "QStringList" //部门任务 @@ -52,6 +52,7 @@ QDateTime require_over_time; QString deliverer; QString is_urgent; + }; //创建任务单-查看任务单 class CatTask @@ -241,9 +242,15 @@ QString belong_standard_equipment; }; +class BaseEntity: public QObject +{ + Q_OBJECT + public: + +}; //被检设备管理-检定项目及检定点-检定项多功能校准源 -class VerMultiCal +class VerMultiCal:public BaseEntity { public: QString id; @@ -365,6 +372,7 @@ class Technique_File { public: + QString id; QString file_distribute_no; QString file_name; QString version_no; @@ -444,12 +452,22 @@ public: BaseCommonApi(); + // + static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList); + //部门任务 + static QList getAllData(); + //部门任务 参数登录用户的id static QList getAllData(QString userId); + //我的任务 static QList getMyTasks(QString id); //获取创建任务首页数据 - static QListgetCreateTaskList(QString id); + + static QListgetCreateTaskList(QString userId); + + + //创建任务-查看任务单顶部 static QListgetCatTask(QString orderNo); //创建任务-查看任务列表底部 @@ -479,7 +497,10 @@ //判断 哪个 装置表 传参 设备id 返回itemId static QList getJudgeCalibrationTable(QString id); //被检设备管理-检定项目及检定点-多功能校准源 - static QList getVerMultiCal(QString itemId,QStringList *headList); + + + static QList getVerMultiCal(QString itemId,QStringList *headList); + // 获取检定数据管理 首页 static QList getVerificationData(); // 检定数据管理-检定基本信息 @@ -494,6 +515,7 @@ static QList getCheckDataManageResultManageMult(QString equipment_id); //技术文件 static QList getTechnique_File(); + //检定程序管理首页查询 static QList getVerificationProgramInfoMain(); //检定程序管理 编辑 @@ -525,7 +547,6 @@ IdWorker &idWorker = Singleton::instance(); //自动检定 - }; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp index c3b2786..70148f4 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp @@ -4,6 +4,7 @@ #include "basecommonapi.h" //#include "tested_device_manage_serve.h" +#include "QStringList" //被检设备 BeExamined_DeviceItem::BeExamined_DeviceItem(QWidget *parent) : @@ -32,19 +33,32 @@ "}"); // ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); // item->setTextAlignment(Qt::AlignCenter); //ui->tableWidget->setItem(0, 0, item); //设置数据 - + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" + headers << "ID" << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" << "生产厂家"<<"所在单位" <<"使用部门"<<"计量标识"<<"检定周期"<<"证书有效期"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); + //详情页面tableWidgetItem设置 + ui->tableWidgetItem->setStyleSheet("QHeaderView::section {" + "border: 1px solid rgba(197, 196, 196, 1);" + "border-left:none;" + "border-top:none;" + "background-color:white;" + "}"); + + // ui->tableWidget->setRowCount(10); // 设置10行 + //ui->tableWidgetItem->setColumnCount(14); // 设置11列 + ui->tableWidgetItem->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 + ui->tableWidgetItem->verticalHeader()->setParent(nullptr); //隐藏行头 + } void BeExamined_DeviceItem::ShowMessageBox(QString title,QString value) { // 创建一个QMessageBox对象 @@ -64,24 +78,19 @@ } void BeExamined_DeviceItem::Load() { - //获取主页面内容 - //进入主页面 - /* - ui->stackedWidget->setCurrentIndex(0); + // ======================================================================================== + // 主页面初始化 + // ==================================================================================== + + + ui->stackedWidget->setCurrentIndex(0); //先设置为行为0 ui->tableWidget->setRowCount(0); - - - // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BeExamined_DeviceItem dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; int row=0; - QList data = dbManager.getBizDeviceManage(); - - - for (const BizDevice& bizDevice : data) { + QList data = dbManager.getTestedDevice(); + for (const TestedDevice& bizDevice : data) { rowCount = ui->tableWidget->rowCount(); ui->tableWidget->insertRow(rowCount); @@ -89,34 +98,118 @@ ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); ui->tableWidget->setItem(row, 2, new QTableWidgetItem(bizDevice.equipment_name)); ui->tableWidget->setItem(row, 3, new QTableWidgetItem(bizDevice.model)); - ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacture_no)); - ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.help_instruction)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacture_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(bizDevice.FULL_NAME)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(bizDevice.meter_identify)); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem(bizDevice.check_cycle)); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(bizDevice.certificate_valid)); + //添加操作按钮 QPushButton *button = new QPushButton("查看"); - ui->tableWidget->setCellWidget(row, 6, button); + ui->tableWidget->setCellWidget(row, 12, button); //设置按钮简单样式 button->setStyleSheet("QPushButton {" - " border: none; /* 无边框 "*/ - // " color: green; /* 文本颜色 */" - // " text-decoration: underline; /* 文本下划线 */" - // "}"); + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); // 设置鼠标悬停时的光标样式为小手图标 - // button->setCursor(Qt::PointingHandCursor); + button->setCursor(Qt::PointingHandCursor); // 连接按钮的 clicked 信号到自定义槽函数 - // connect(button, &QPushButton::clicked, this, [this, button, row]() { - // 获取当前行第一列的 ID - // QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); - // if (idItem) { - // QString id = idItem->text(); -// - // OnButtonSelectClicked(id); - // } + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); - // }); + OnButtonSelectClicked(id); + } - // row++; - - // } + }); + row++; + } } +void BeExamined_DeviceItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + + DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +//返回按钮 +void BeExamined_DeviceItem::on_pushButton_2_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); +} +void BeExamined_DeviceItem::DeviceInfoInit(QString id) +{ + // ======================================================================================== + // 初始化详情 + // ==================================================================================== + + QList data = dbManager.getTestedCatDevice(id); + for (const TestedCatDevice& testedCatDevice : data) { + + ui->equipment_name->setText(testedCatDevice.equipment_name); + ui->model->setText(testedCatDevice.model); + ui->help_instruction->setText(testedCatDevice.help_instruction); + ui->manufacture_no->setText(testedCatDevice.manufacture_no); + ui->product_country->setText(testedCatDevice.product_country); + ui->manufacturer->setText(testedCatDevice.manufacturer); + ui->product_date->setText(testedCatDevice.product_date); + ui->purchase_date->setText(testedCatDevice.purchase_date); + ui->unit_price->setText(testedCatDevice.unit_price); + ui->usage_status->setText(testedCatDevice.usage_status); + ui->quality_condition->setText(testedCatDevice.quality_condition); + ui->dept_name->setText(testedCatDevice.FULL_NAME); + ui->category->setText(testedCatDevice.category); + ui->check_cycle->setText(testedCatDevice.check_cycle); + ui->level->setText(testedCatDevice.level); + ui->remark->setText(testedCatDevice.remark); + } + + + // ======================================================================================== + // 初始化检定项目及核查点 + // ==================================================================================== + + //获取核查点tablewight的数据 + QStringList headlist; + + QList Data=dbManager.Search_CalibrationTable(id,&headlist); + + //tableWidgetItem + ui->tableWidgetItem->setRowCount(0); + ui->tableWidgetItem->setColumnCount(headlist.count()); + ui->tableWidgetItem->setHorizontalHeaderLabels(headlist); + //循环数据 + int rowCount=0; + int row=0; + ; + for (const QStringList& item : Data) + { + //获取行号 并进行添加行 + rowCount = ui->tableWidgetItem->rowCount(); + ui->tableWidgetItem->insertRow(rowCount); + //添加 序号 + ui->tableWidgetItem->setItem(row, 0, new QTableWidgetItem(QString::number(row+1))); + //循环读取值 headlist,count是列的数量 + for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型 + } + + row++; + + } +} + + + diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h index ffdc22a..0050ee7 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h @@ -21,6 +21,11 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + + void DeviceInfoInit(QString id); + + void on_pushButton_2_clicked(); private: Ui::BeExamined_DeviceItem *ui; diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/InfoBase.h b/softwareDirectory/AutoVerScheme/InfoBase.h index 6dd59f3..bce9609 100644 --- a/softwareDirectory/AutoVerScheme/InfoBase.h +++ b/softwareDirectory/AutoVerScheme/InfoBase.h @@ -4,6 +4,7 @@ #include #include "QStandardItemModel" #include "databaseconnection.h" +#include "basecommonapi.h" ///信号管理页面的基类 所有信息管理页面都继承于InfoBase /// 便于统一管理 所有子类必须实现Load方法 /// 每次按钮点击切换都会调用Load方法 用于每次页面的数据刷新 @@ -16,7 +17,7 @@ //QStandardItemModel 的实例。这个模型将用于存储和管理数据。 QStandardItemModel *model; //信息管理页面 基类定义Conn对象 - DatabaseConnection *Conn=DatabaseConnection::getInstance(); + BaseCommonApi dbManager; }; #endif // INFOBASE_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index f62915b..6170ee7 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -15,7 +15,7 @@ " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id " " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID " " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID " - " WHERE sys_user.ID = ' :userId '"); + " WHERE sys_user.ID = :userId"); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -75,6 +75,35 @@ } return result; } + +//获取创建任务首页数据 +QList BaseCommonApi::getCreateTaskList(QString userId) +{ + userId="1640229293790650370"; + QList result; + QSqlQuery query; + query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " + " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " + " WHERE bi.create_user_id = :userId"); + // 将参数绑定到占位符 + query.bindValue(":userId", userId); + if (query.exec()) { + while (query.next()) { + CreateTaskList task; + task.id = query.value("id").toString(); + task.order_no = query.value("order_no").toString(); + task.customer_name = query.value("customer_name").toString(); + task.DEPT_FULL_NAME = query.value("FULL_NAME").toString(); + task.require_over_time = query.value("require_over_time").toDateTime(); + task.deliverer = query.value("deliverer").toString(); + task.is_urgent = query.value("is_urgent").toString(); + result.append(task); + } + } else { + qDebug() << "Query execution failed: " << query.lastError().text(); + } + return result; +} //获取创建任务首页数据 QListgetCreateTaskList(QString userId) { @@ -82,7 +111,7 @@ QSqlQuery query; query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " - " WHERE bi.create_user_id = ':userId' "); + " WHERE bi.create_user_id = :userId "); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -103,6 +132,7 @@ return result; } + //创建任务单-查看/编辑 顶部数据 传参该条数据的id QListBaseCommonApi::getCatTask(QString id) { @@ -111,7 +141,7 @@ query.prepare("SELECT bi.order_no ,bi.customer_name ,dept.FULL_NAME ,bi.require_over_time ," " bi.deliverer ,bi.deliverer_tel ,bi.undertaker_name ,bi.undertake_time , bi.is_urgent AS ," " bi.receive_illustrate FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID" - " WHERE bi.id = ' :id '"); + " WHERE bi.id = :id "); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -140,6 +170,7 @@ //获取创建任务 -任务单列表 + QListBaseCommonApi::getCatTaskList(QString orderId) { QList result; @@ -380,6 +411,7 @@ QListBaseCommonApi::getCheckDCPower(QString equipment_id,QStringList *headList) { + equipment_id="1693435753272557570"; QList result; QSqlQuery query; query.prepare("SELECT besciddp.id ,besciddp.params,besciddp.unit,resolution,besciddp.urel,besciddp.check_type,datum_point,cycle_number " @@ -407,9 +439,11 @@ } else { qDebug() << "Query execution failed: " << query.lastError().text(); } + *headList <<"序号"<<"核查项目"<<"核查点"<<"单位"<<"分辨力"<<"Urel"<<"核查类型"<<"是否为基准点(1/0)"<<"循环次数" <<"电阻值/频率"<<"电阻值单位/频率单位"<<"核查项备注"; + return result; } //根据id获取装置名称 @@ -436,9 +470,9 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " - " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id " - " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); +bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " + " JOIN sys_dept ON sys_dept.ID = eei.dept_id " + " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); if (isSuccess) { while (query.next()) { TestedDevice testedDevice; @@ -504,9 +538,10 @@ //判断 哪个 装置表 传参 设备id QList BaseCommonApi::getJudgeCalibrationTable(QString id) { + id="1716997603953311746"; QList result; QSqlQuery query; - query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = ':id')"); + query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = :id )"); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -526,12 +561,55 @@ return result; } +//标准装置字典类型 +/** + * 多功能校准源标准装置 = 1 + * 直流稳压电源检定装置 = 2 + * 多功能电气安全校准器标准装置 = 3 + * 0.02级活塞式压力计标准装置 = 4 + * 二等铂电阻温度计标准装置 = 5 + * 安全阀校验装置 = 6 + * 精密露点仪标准装置 = 7 + * E2等级砝码标准装置 = 8 + * 频谱分析仪标准装置 = 9 + * 信号发生器标准装置 = 10 + * 微波衰减标准装置 = 11 + * 频率短期稳定度标准装置 =12 + * 示波器标准装置 = 13 + * 铯原子频率标准装置 =14 + * 小功率标准装置 = 15 + * 低频信号发生器标准装置 = 16 + * S参数标准装置 = 17 + * 失真度标准装置 = 18 + */ +//根据被检设备ID获取当前设备的 核查项目及核查点 + +QList BaseCommonApi::Search_CalibrationTable(QString DeiverId,QStringList *HeadList) +{ + + QList DataList; + DataList.clear(); + QList CliTable=BaseCommonApi::getJudgeCalibrationTable(DeiverId); + if(CliTable.count()==0)return DataList; + switch (CliTable[0].belong_standard_equipment.toInt()) + { + case 1: + + //CliTable[0].item_category_id + DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList); + break; + } + + return DataList; +} //被检设备管理-检定项目及检定点-多功能校准源 -QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) +QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) { -QList result; +QList resultData; +QStringList result; +resultData.clear(); QSqlQuery query; query.prepare("SELECT bbdmidc.id ,bbdmidc.params ,bbdmidc.capacity ,bbdmidc.unit ,bbdmidc.frequency , bbdmidc.range_range , bbdmidc.standard_value , bbdmidc.resolution , bbdmidc.maximum_error , bbdmidc.error_param_a , bbdmidc.error_param_b " @@ -542,26 +620,24 @@ if (query.exec()) { while (query.next()) { - VerMultiCal calibration; - calibration.id = query.value("id").toString(); - calibration.params = query.value("params").toString(); - calibration.capacity = query.value("capacity").toString(); - calibration.unit = query.value("unit").toString(); - calibration.frequency = query.value("frequency").toString(); - calibration.range_range = query.value("range_range").toString(); - calibration.standard_value = query.value("standard_value").toString(); - calibration.resolution = query.value("resolution").toString(); - calibration.maximum_error = query.value("maximum_error").toString(); - calibration.error_param_a = query.value("error_param_a").toString(); - calibration.error_param_b = query.value("error_param_b").toString(); - - result.append(calibration); + result.clear(); + result.append(query.value("id").toString()); + result.append(query.value("params").toString()); + result.append(query.value("capacity").toString()); + result.append(query.value("unit").toString()); + result.append(query.value("frequency").toString()); + result.append(query.value("range_range").toString()); + result.append(query.value("standard_value").toString()); + result.append(query.value("resolution").toString()); + result.append(query.value("maximum_error").toString()); + result.append(query.value("error_param_a").toString()); + result.append(query.value("error_param_b").toString()); + resultData.append(result); } } else { qDebug() << "Query execution failed: " << query.lastError().text(); } - *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; - return result; + *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; } //检定数据管理 首页 @@ -757,7 +833,7 @@ " LEFT JOIN biz_equipment_standard_check_info besci ON besci.item_category_id = bescidc.item_category_id " " WHERE bescidc.equipment_id = :equipment_id "); - // 将参数绑定到占位符 '1692796512381222914' + // 将参数绑定到占位符 1692796512381222914 query.bindValue(":equipment_id", equipment_id); if (query.exec()) { while (query.next()) { @@ -788,12 +864,13 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " + bool isSuccess = query.exec("SELECT brtf.id,brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " " FROM biz_resource_technique_file brtf"); if (isSuccess) { while (query.next()) { Technique_File file; + file.id=query.value("id").toString(); file.file_distribute_no = query.value("file_distribute_no").toString(); file.file_name = query.value("file_name").toString(); file.version_no = query.value("version_no").toString(); @@ -876,7 +953,7 @@ QList result; QSqlQuery query; query.prepare("SELECT id,device_id ,communication_type ,serial_port ,visa ,create_time ,update_time " - "FROM zd_communication_setting WHERE device_id = ' :deviceId '"); + "FROM zd_communication_setting WHERE device_id = :deviceId "); query.bindValue(":deviceId", deviceId); if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h index 1b70cb9..ff8a320 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.h +++ b/softwareDirectory/AutoVerScheme/basecommonapi.h @@ -9,7 +9,7 @@ #include "databaseconnection.h" #include "id\IdWorker.h" - +#include "QStringList" //部门任务 @@ -52,6 +52,7 @@ QDateTime require_over_time; QString deliverer; QString is_urgent; + }; //创建任务单-查看任务单 class CatTask @@ -241,9 +242,15 @@ QString belong_standard_equipment; }; +class BaseEntity: public QObject +{ + Q_OBJECT + public: + +}; //被检设备管理-检定项目及检定点-检定项多功能校准源 -class VerMultiCal +class VerMultiCal:public BaseEntity { public: QString id; @@ -365,6 +372,7 @@ class Technique_File { public: + QString id; QString file_distribute_no; QString file_name; QString version_no; @@ -444,12 +452,22 @@ public: BaseCommonApi(); + // + static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList); + //部门任务 + static QList getAllData(); + //部门任务 参数登录用户的id static QList getAllData(QString userId); + //我的任务 static QList getMyTasks(QString id); //获取创建任务首页数据 - static QListgetCreateTaskList(QString id); + + static QListgetCreateTaskList(QString userId); + + + //创建任务-查看任务单顶部 static QListgetCatTask(QString orderNo); //创建任务-查看任务列表底部 @@ -479,7 +497,10 @@ //判断 哪个 装置表 传参 设备id 返回itemId static QList getJudgeCalibrationTable(QString id); //被检设备管理-检定项目及检定点-多功能校准源 - static QList getVerMultiCal(QString itemId,QStringList *headList); + + + static QList getVerMultiCal(QString itemId,QStringList *headList); + // 获取检定数据管理 首页 static QList getVerificationData(); // 检定数据管理-检定基本信息 @@ -494,6 +515,7 @@ static QList getCheckDataManageResultManageMult(QString equipment_id); //技术文件 static QList getTechnique_File(); + //检定程序管理首页查询 static QList getVerificationProgramInfoMain(); //检定程序管理 编辑 @@ -525,7 +547,6 @@ IdWorker &idWorker = Singleton::instance(); //自动检定 - }; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp index c3b2786..70148f4 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp @@ -4,6 +4,7 @@ #include "basecommonapi.h" //#include "tested_device_manage_serve.h" +#include "QStringList" //被检设备 BeExamined_DeviceItem::BeExamined_DeviceItem(QWidget *parent) : @@ -32,19 +33,32 @@ "}"); // ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); // item->setTextAlignment(Qt::AlignCenter); //ui->tableWidget->setItem(0, 0, item); //设置数据 - + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" + headers << "ID" << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" << "生产厂家"<<"所在单位" <<"使用部门"<<"计量标识"<<"检定周期"<<"证书有效期"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); + //详情页面tableWidgetItem设置 + ui->tableWidgetItem->setStyleSheet("QHeaderView::section {" + "border: 1px solid rgba(197, 196, 196, 1);" + "border-left:none;" + "border-top:none;" + "background-color:white;" + "}"); + + // ui->tableWidget->setRowCount(10); // 设置10行 + //ui->tableWidgetItem->setColumnCount(14); // 设置11列 + ui->tableWidgetItem->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 + ui->tableWidgetItem->verticalHeader()->setParent(nullptr); //隐藏行头 + } void BeExamined_DeviceItem::ShowMessageBox(QString title,QString value) { // 创建一个QMessageBox对象 @@ -64,24 +78,19 @@ } void BeExamined_DeviceItem::Load() { - //获取主页面内容 - //进入主页面 - /* - ui->stackedWidget->setCurrentIndex(0); + // ======================================================================================== + // 主页面初始化 + // ==================================================================================== + + + ui->stackedWidget->setCurrentIndex(0); //先设置为行为0 ui->tableWidget->setRowCount(0); - - - // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BeExamined_DeviceItem dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; int row=0; - QList data = dbManager.getBizDeviceManage(); - - - for (const BizDevice& bizDevice : data) { + QList data = dbManager.getTestedDevice(); + for (const TestedDevice& bizDevice : data) { rowCount = ui->tableWidget->rowCount(); ui->tableWidget->insertRow(rowCount); @@ -89,34 +98,118 @@ ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); ui->tableWidget->setItem(row, 2, new QTableWidgetItem(bizDevice.equipment_name)); ui->tableWidget->setItem(row, 3, new QTableWidgetItem(bizDevice.model)); - ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacture_no)); - ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.help_instruction)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacture_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(bizDevice.FULL_NAME)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(bizDevice.meter_identify)); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem(bizDevice.check_cycle)); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(bizDevice.certificate_valid)); + //添加操作按钮 QPushButton *button = new QPushButton("查看"); - ui->tableWidget->setCellWidget(row, 6, button); + ui->tableWidget->setCellWidget(row, 12, button); //设置按钮简单样式 button->setStyleSheet("QPushButton {" - " border: none; /* 无边框 "*/ - // " color: green; /* 文本颜色 */" - // " text-decoration: underline; /* 文本下划线 */" - // "}"); + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); // 设置鼠标悬停时的光标样式为小手图标 - // button->setCursor(Qt::PointingHandCursor); + button->setCursor(Qt::PointingHandCursor); // 连接按钮的 clicked 信号到自定义槽函数 - // connect(button, &QPushButton::clicked, this, [this, button, row]() { - // 获取当前行第一列的 ID - // QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); - // if (idItem) { - // QString id = idItem->text(); -// - // OnButtonSelectClicked(id); - // } + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); - // }); + OnButtonSelectClicked(id); + } - // row++; - - // } + }); + row++; + } } +void BeExamined_DeviceItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + + DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +//返回按钮 +void BeExamined_DeviceItem::on_pushButton_2_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); +} +void BeExamined_DeviceItem::DeviceInfoInit(QString id) +{ + // ======================================================================================== + // 初始化详情 + // ==================================================================================== + + QList data = dbManager.getTestedCatDevice(id); + for (const TestedCatDevice& testedCatDevice : data) { + + ui->equipment_name->setText(testedCatDevice.equipment_name); + ui->model->setText(testedCatDevice.model); + ui->help_instruction->setText(testedCatDevice.help_instruction); + ui->manufacture_no->setText(testedCatDevice.manufacture_no); + ui->product_country->setText(testedCatDevice.product_country); + ui->manufacturer->setText(testedCatDevice.manufacturer); + ui->product_date->setText(testedCatDevice.product_date); + ui->purchase_date->setText(testedCatDevice.purchase_date); + ui->unit_price->setText(testedCatDevice.unit_price); + ui->usage_status->setText(testedCatDevice.usage_status); + ui->quality_condition->setText(testedCatDevice.quality_condition); + ui->dept_name->setText(testedCatDevice.FULL_NAME); + ui->category->setText(testedCatDevice.category); + ui->check_cycle->setText(testedCatDevice.check_cycle); + ui->level->setText(testedCatDevice.level); + ui->remark->setText(testedCatDevice.remark); + } + + + // ======================================================================================== + // 初始化检定项目及核查点 + // ==================================================================================== + + //获取核查点tablewight的数据 + QStringList headlist; + + QList Data=dbManager.Search_CalibrationTable(id,&headlist); + + //tableWidgetItem + ui->tableWidgetItem->setRowCount(0); + ui->tableWidgetItem->setColumnCount(headlist.count()); + ui->tableWidgetItem->setHorizontalHeaderLabels(headlist); + //循环数据 + int rowCount=0; + int row=0; + ; + for (const QStringList& item : Data) + { + //获取行号 并进行添加行 + rowCount = ui->tableWidgetItem->rowCount(); + ui->tableWidgetItem->insertRow(rowCount); + //添加 序号 + ui->tableWidgetItem->setItem(row, 0, new QTableWidgetItem(QString::number(row+1))); + //循环读取值 headlist,count是列的数量 + for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型 + } + + row++; + + } +} + + + diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h index ffdc22a..0050ee7 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h @@ -21,6 +21,11 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + + void DeviceInfoInit(QString id); + + void on_pushButton_2_clicked(); private: Ui::BeExamined_DeviceItem *ui; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui index ce63879..cdacfaf 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui @@ -215,6 +215,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -225,6 +230,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 @@ -391,7 +401,7 @@ - + ForbiddenCursor @@ -412,7 +422,7 @@ - + ForbiddenCursor @@ -428,12 +438,12 @@ - 出厂编号: + 辅助字段: - + ForbiddenCursor @@ -449,12 +459,12 @@ - 检定有效期: + 出厂编号: - + ForbiddenCursor @@ -475,7 +485,7 @@ - + ForbiddenCursor @@ -496,7 +506,7 @@ - + ForbiddenCursor @@ -517,7 +527,7 @@ - + ForbiddenCursor @@ -538,7 +548,7 @@ - + ForbiddenCursor @@ -552,14 +562,14 @@ - + - 使用年限: + 设备单价: - + ForbiddenCursor @@ -573,14 +583,14 @@ - + - 设备单价: + 使用状态: - + ForbiddenCursor @@ -594,14 +604,14 @@ - + - 使用状态: + 质量状况: - + ForbiddenCursor @@ -615,14 +625,14 @@ - + - 质量状况: + 所在单位: - + ForbiddenCursor @@ -638,12 +648,12 @@ - 所属部门: + 使用部门: - + ForbiddenCursor @@ -657,14 +667,14 @@ - + - 负责人: + 设备分类: - + ForbiddenCursor @@ -678,14 +688,14 @@ - + - 设备供方: + 检定周期: - + ForbiddenCursor @@ -699,14 +709,14 @@ - + - 位置信息: + 重要等级: - + ForbiddenCursor @@ -720,140 +730,14 @@ - - - 设备类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 标准类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 设备分类: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 重要等级: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 检定周期: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 对应开箱记录: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - 备注: - - + + ForbiddenCursor @@ -892,7 +776,7 @@ - + diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/InfoBase.h b/softwareDirectory/AutoVerScheme/InfoBase.h index 6dd59f3..bce9609 100644 --- a/softwareDirectory/AutoVerScheme/InfoBase.h +++ b/softwareDirectory/AutoVerScheme/InfoBase.h @@ -4,6 +4,7 @@ #include #include "QStandardItemModel" #include "databaseconnection.h" +#include "basecommonapi.h" ///信号管理页面的基类 所有信息管理页面都继承于InfoBase /// 便于统一管理 所有子类必须实现Load方法 /// 每次按钮点击切换都会调用Load方法 用于每次页面的数据刷新 @@ -16,7 +17,7 @@ //QStandardItemModel 的实例。这个模型将用于存储和管理数据。 QStandardItemModel *model; //信息管理页面 基类定义Conn对象 - DatabaseConnection *Conn=DatabaseConnection::getInstance(); + BaseCommonApi dbManager; }; #endif // INFOBASE_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index f62915b..6170ee7 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -15,7 +15,7 @@ " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id " " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID " " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID " - " WHERE sys_user.ID = ' :userId '"); + " WHERE sys_user.ID = :userId"); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -75,6 +75,35 @@ } return result; } + +//获取创建任务首页数据 +QList BaseCommonApi::getCreateTaskList(QString userId) +{ + userId="1640229293790650370"; + QList result; + QSqlQuery query; + query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " + " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " + " WHERE bi.create_user_id = :userId"); + // 将参数绑定到占位符 + query.bindValue(":userId", userId); + if (query.exec()) { + while (query.next()) { + CreateTaskList task; + task.id = query.value("id").toString(); + task.order_no = query.value("order_no").toString(); + task.customer_name = query.value("customer_name").toString(); + task.DEPT_FULL_NAME = query.value("FULL_NAME").toString(); + task.require_over_time = query.value("require_over_time").toDateTime(); + task.deliverer = query.value("deliverer").toString(); + task.is_urgent = query.value("is_urgent").toString(); + result.append(task); + } + } else { + qDebug() << "Query execution failed: " << query.lastError().text(); + } + return result; +} //获取创建任务首页数据 QListgetCreateTaskList(QString userId) { @@ -82,7 +111,7 @@ QSqlQuery query; query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " - " WHERE bi.create_user_id = ':userId' "); + " WHERE bi.create_user_id = :userId "); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -103,6 +132,7 @@ return result; } + //创建任务单-查看/编辑 顶部数据 传参该条数据的id QListBaseCommonApi::getCatTask(QString id) { @@ -111,7 +141,7 @@ query.prepare("SELECT bi.order_no ,bi.customer_name ,dept.FULL_NAME ,bi.require_over_time ," " bi.deliverer ,bi.deliverer_tel ,bi.undertaker_name ,bi.undertake_time , bi.is_urgent AS ," " bi.receive_illustrate FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID" - " WHERE bi.id = ' :id '"); + " WHERE bi.id = :id "); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -140,6 +170,7 @@ //获取创建任务 -任务单列表 + QListBaseCommonApi::getCatTaskList(QString orderId) { QList result; @@ -380,6 +411,7 @@ QListBaseCommonApi::getCheckDCPower(QString equipment_id,QStringList *headList) { + equipment_id="1693435753272557570"; QList result; QSqlQuery query; query.prepare("SELECT besciddp.id ,besciddp.params,besciddp.unit,resolution,besciddp.urel,besciddp.check_type,datum_point,cycle_number " @@ -407,9 +439,11 @@ } else { qDebug() << "Query execution failed: " << query.lastError().text(); } + *headList <<"序号"<<"核查项目"<<"核查点"<<"单位"<<"分辨力"<<"Urel"<<"核查类型"<<"是否为基准点(1/0)"<<"循环次数" <<"电阻值/频率"<<"电阻值单位/频率单位"<<"核查项备注"; + return result; } //根据id获取装置名称 @@ -436,9 +470,9 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " - " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id " - " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); +bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " + " JOIN sys_dept ON sys_dept.ID = eei.dept_id " + " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); if (isSuccess) { while (query.next()) { TestedDevice testedDevice; @@ -504,9 +538,10 @@ //判断 哪个 装置表 传参 设备id QList BaseCommonApi::getJudgeCalibrationTable(QString id) { + id="1716997603953311746"; QList result; QSqlQuery query; - query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = ':id')"); + query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = :id )"); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -526,12 +561,55 @@ return result; } +//标准装置字典类型 +/** + * 多功能校准源标准装置 = 1 + * 直流稳压电源检定装置 = 2 + * 多功能电气安全校准器标准装置 = 3 + * 0.02级活塞式压力计标准装置 = 4 + * 二等铂电阻温度计标准装置 = 5 + * 安全阀校验装置 = 6 + * 精密露点仪标准装置 = 7 + * E2等级砝码标准装置 = 8 + * 频谱分析仪标准装置 = 9 + * 信号发生器标准装置 = 10 + * 微波衰减标准装置 = 11 + * 频率短期稳定度标准装置 =12 + * 示波器标准装置 = 13 + * 铯原子频率标准装置 =14 + * 小功率标准装置 = 15 + * 低频信号发生器标准装置 = 16 + * S参数标准装置 = 17 + * 失真度标准装置 = 18 + */ +//根据被检设备ID获取当前设备的 核查项目及核查点 + +QList BaseCommonApi::Search_CalibrationTable(QString DeiverId,QStringList *HeadList) +{ + + QList DataList; + DataList.clear(); + QList CliTable=BaseCommonApi::getJudgeCalibrationTable(DeiverId); + if(CliTable.count()==0)return DataList; + switch (CliTable[0].belong_standard_equipment.toInt()) + { + case 1: + + //CliTable[0].item_category_id + DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList); + break; + } + + return DataList; +} //被检设备管理-检定项目及检定点-多功能校准源 -QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) +QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) { -QList result; +QList resultData; +QStringList result; +resultData.clear(); QSqlQuery query; query.prepare("SELECT bbdmidc.id ,bbdmidc.params ,bbdmidc.capacity ,bbdmidc.unit ,bbdmidc.frequency , bbdmidc.range_range , bbdmidc.standard_value , bbdmidc.resolution , bbdmidc.maximum_error , bbdmidc.error_param_a , bbdmidc.error_param_b " @@ -542,26 +620,24 @@ if (query.exec()) { while (query.next()) { - VerMultiCal calibration; - calibration.id = query.value("id").toString(); - calibration.params = query.value("params").toString(); - calibration.capacity = query.value("capacity").toString(); - calibration.unit = query.value("unit").toString(); - calibration.frequency = query.value("frequency").toString(); - calibration.range_range = query.value("range_range").toString(); - calibration.standard_value = query.value("standard_value").toString(); - calibration.resolution = query.value("resolution").toString(); - calibration.maximum_error = query.value("maximum_error").toString(); - calibration.error_param_a = query.value("error_param_a").toString(); - calibration.error_param_b = query.value("error_param_b").toString(); - - result.append(calibration); + result.clear(); + result.append(query.value("id").toString()); + result.append(query.value("params").toString()); + result.append(query.value("capacity").toString()); + result.append(query.value("unit").toString()); + result.append(query.value("frequency").toString()); + result.append(query.value("range_range").toString()); + result.append(query.value("standard_value").toString()); + result.append(query.value("resolution").toString()); + result.append(query.value("maximum_error").toString()); + result.append(query.value("error_param_a").toString()); + result.append(query.value("error_param_b").toString()); + resultData.append(result); } } else { qDebug() << "Query execution failed: " << query.lastError().text(); } - *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; - return result; + *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; } //检定数据管理 首页 @@ -757,7 +833,7 @@ " LEFT JOIN biz_equipment_standard_check_info besci ON besci.item_category_id = bescidc.item_category_id " " WHERE bescidc.equipment_id = :equipment_id "); - // 将参数绑定到占位符 '1692796512381222914' + // 将参数绑定到占位符 1692796512381222914 query.bindValue(":equipment_id", equipment_id); if (query.exec()) { while (query.next()) { @@ -788,12 +864,13 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " + bool isSuccess = query.exec("SELECT brtf.id,brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " " FROM biz_resource_technique_file brtf"); if (isSuccess) { while (query.next()) { Technique_File file; + file.id=query.value("id").toString(); file.file_distribute_no = query.value("file_distribute_no").toString(); file.file_name = query.value("file_name").toString(); file.version_no = query.value("version_no").toString(); @@ -876,7 +953,7 @@ QList result; QSqlQuery query; query.prepare("SELECT id,device_id ,communication_type ,serial_port ,visa ,create_time ,update_time " - "FROM zd_communication_setting WHERE device_id = ' :deviceId '"); + "FROM zd_communication_setting WHERE device_id = :deviceId "); query.bindValue(":deviceId", deviceId); if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h index 1b70cb9..ff8a320 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.h +++ b/softwareDirectory/AutoVerScheme/basecommonapi.h @@ -9,7 +9,7 @@ #include "databaseconnection.h" #include "id\IdWorker.h" - +#include "QStringList" //部门任务 @@ -52,6 +52,7 @@ QDateTime require_over_time; QString deliverer; QString is_urgent; + }; //创建任务单-查看任务单 class CatTask @@ -241,9 +242,15 @@ QString belong_standard_equipment; }; +class BaseEntity: public QObject +{ + Q_OBJECT + public: + +}; //被检设备管理-检定项目及检定点-检定项多功能校准源 -class VerMultiCal +class VerMultiCal:public BaseEntity { public: QString id; @@ -365,6 +372,7 @@ class Technique_File { public: + QString id; QString file_distribute_no; QString file_name; QString version_no; @@ -444,12 +452,22 @@ public: BaseCommonApi(); + // + static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList); + //部门任务 + static QList getAllData(); + //部门任务 参数登录用户的id static QList getAllData(QString userId); + //我的任务 static QList getMyTasks(QString id); //获取创建任务首页数据 - static QListgetCreateTaskList(QString id); + + static QListgetCreateTaskList(QString userId); + + + //创建任务-查看任务单顶部 static QListgetCatTask(QString orderNo); //创建任务-查看任务列表底部 @@ -479,7 +497,10 @@ //判断 哪个 装置表 传参 设备id 返回itemId static QList getJudgeCalibrationTable(QString id); //被检设备管理-检定项目及检定点-多功能校准源 - static QList getVerMultiCal(QString itemId,QStringList *headList); + + + static QList getVerMultiCal(QString itemId,QStringList *headList); + // 获取检定数据管理 首页 static QList getVerificationData(); // 检定数据管理-检定基本信息 @@ -494,6 +515,7 @@ static QList getCheckDataManageResultManageMult(QString equipment_id); //技术文件 static QList getTechnique_File(); + //检定程序管理首页查询 static QList getVerificationProgramInfoMain(); //检定程序管理 编辑 @@ -525,7 +547,6 @@ IdWorker &idWorker = Singleton::instance(); //自动检定 - }; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp index c3b2786..70148f4 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp @@ -4,6 +4,7 @@ #include "basecommonapi.h" //#include "tested_device_manage_serve.h" +#include "QStringList" //被检设备 BeExamined_DeviceItem::BeExamined_DeviceItem(QWidget *parent) : @@ -32,19 +33,32 @@ "}"); // ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); // item->setTextAlignment(Qt::AlignCenter); //ui->tableWidget->setItem(0, 0, item); //设置数据 - + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" + headers << "ID" << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" << "生产厂家"<<"所在单位" <<"使用部门"<<"计量标识"<<"检定周期"<<"证书有效期"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); + //详情页面tableWidgetItem设置 + ui->tableWidgetItem->setStyleSheet("QHeaderView::section {" + "border: 1px solid rgba(197, 196, 196, 1);" + "border-left:none;" + "border-top:none;" + "background-color:white;" + "}"); + + // ui->tableWidget->setRowCount(10); // 设置10行 + //ui->tableWidgetItem->setColumnCount(14); // 设置11列 + ui->tableWidgetItem->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 + ui->tableWidgetItem->verticalHeader()->setParent(nullptr); //隐藏行头 + } void BeExamined_DeviceItem::ShowMessageBox(QString title,QString value) { // 创建一个QMessageBox对象 @@ -64,24 +78,19 @@ } void BeExamined_DeviceItem::Load() { - //获取主页面内容 - //进入主页面 - /* - ui->stackedWidget->setCurrentIndex(0); + // ======================================================================================== + // 主页面初始化 + // ==================================================================================== + + + ui->stackedWidget->setCurrentIndex(0); //先设置为行为0 ui->tableWidget->setRowCount(0); - - - // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BeExamined_DeviceItem dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; int row=0; - QList data = dbManager.getBizDeviceManage(); - - - for (const BizDevice& bizDevice : data) { + QList data = dbManager.getTestedDevice(); + for (const TestedDevice& bizDevice : data) { rowCount = ui->tableWidget->rowCount(); ui->tableWidget->insertRow(rowCount); @@ -89,34 +98,118 @@ ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); ui->tableWidget->setItem(row, 2, new QTableWidgetItem(bizDevice.equipment_name)); ui->tableWidget->setItem(row, 3, new QTableWidgetItem(bizDevice.model)); - ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacture_no)); - ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.help_instruction)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacture_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(bizDevice.FULL_NAME)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(bizDevice.meter_identify)); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem(bizDevice.check_cycle)); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(bizDevice.certificate_valid)); + //添加操作按钮 QPushButton *button = new QPushButton("查看"); - ui->tableWidget->setCellWidget(row, 6, button); + ui->tableWidget->setCellWidget(row, 12, button); //设置按钮简单样式 button->setStyleSheet("QPushButton {" - " border: none; /* 无边框 "*/ - // " color: green; /* 文本颜色 */" - // " text-decoration: underline; /* 文本下划线 */" - // "}"); + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); // 设置鼠标悬停时的光标样式为小手图标 - // button->setCursor(Qt::PointingHandCursor); + button->setCursor(Qt::PointingHandCursor); // 连接按钮的 clicked 信号到自定义槽函数 - // connect(button, &QPushButton::clicked, this, [this, button, row]() { - // 获取当前行第一列的 ID - // QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); - // if (idItem) { - // QString id = idItem->text(); -// - // OnButtonSelectClicked(id); - // } + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); - // }); + OnButtonSelectClicked(id); + } - // row++; - - // } + }); + row++; + } } +void BeExamined_DeviceItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + + DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +//返回按钮 +void BeExamined_DeviceItem::on_pushButton_2_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); +} +void BeExamined_DeviceItem::DeviceInfoInit(QString id) +{ + // ======================================================================================== + // 初始化详情 + // ==================================================================================== + + QList data = dbManager.getTestedCatDevice(id); + for (const TestedCatDevice& testedCatDevice : data) { + + ui->equipment_name->setText(testedCatDevice.equipment_name); + ui->model->setText(testedCatDevice.model); + ui->help_instruction->setText(testedCatDevice.help_instruction); + ui->manufacture_no->setText(testedCatDevice.manufacture_no); + ui->product_country->setText(testedCatDevice.product_country); + ui->manufacturer->setText(testedCatDevice.manufacturer); + ui->product_date->setText(testedCatDevice.product_date); + ui->purchase_date->setText(testedCatDevice.purchase_date); + ui->unit_price->setText(testedCatDevice.unit_price); + ui->usage_status->setText(testedCatDevice.usage_status); + ui->quality_condition->setText(testedCatDevice.quality_condition); + ui->dept_name->setText(testedCatDevice.FULL_NAME); + ui->category->setText(testedCatDevice.category); + ui->check_cycle->setText(testedCatDevice.check_cycle); + ui->level->setText(testedCatDevice.level); + ui->remark->setText(testedCatDevice.remark); + } + + + // ======================================================================================== + // 初始化检定项目及核查点 + // ==================================================================================== + + //获取核查点tablewight的数据 + QStringList headlist; + + QList Data=dbManager.Search_CalibrationTable(id,&headlist); + + //tableWidgetItem + ui->tableWidgetItem->setRowCount(0); + ui->tableWidgetItem->setColumnCount(headlist.count()); + ui->tableWidgetItem->setHorizontalHeaderLabels(headlist); + //循环数据 + int rowCount=0; + int row=0; + ; + for (const QStringList& item : Data) + { + //获取行号 并进行添加行 + rowCount = ui->tableWidgetItem->rowCount(); + ui->tableWidgetItem->insertRow(rowCount); + //添加 序号 + ui->tableWidgetItem->setItem(row, 0, new QTableWidgetItem(QString::number(row+1))); + //循环读取值 headlist,count是列的数量 + for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型 + } + + row++; + + } +} + + + diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h index ffdc22a..0050ee7 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h @@ -21,6 +21,11 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + + void DeviceInfoInit(QString id); + + void on_pushButton_2_clicked(); private: Ui::BeExamined_DeviceItem *ui; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui index ce63879..cdacfaf 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui @@ -215,6 +215,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -225,6 +230,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 @@ -391,7 +401,7 @@ - + ForbiddenCursor @@ -412,7 +422,7 @@ - + ForbiddenCursor @@ -428,12 +438,12 @@ - 出厂编号: + 辅助字段: - + ForbiddenCursor @@ -449,12 +459,12 @@ - 检定有效期: + 出厂编号: - + ForbiddenCursor @@ -475,7 +485,7 @@ - + ForbiddenCursor @@ -496,7 +506,7 @@ - + ForbiddenCursor @@ -517,7 +527,7 @@ - + ForbiddenCursor @@ -538,7 +548,7 @@ - + ForbiddenCursor @@ -552,14 +562,14 @@ - + - 使用年限: + 设备单价: - + ForbiddenCursor @@ -573,14 +583,14 @@ - + - 设备单价: + 使用状态: - + ForbiddenCursor @@ -594,14 +604,14 @@ - + - 使用状态: + 质量状况: - + ForbiddenCursor @@ -615,14 +625,14 @@ - + - 质量状况: + 所在单位: - + ForbiddenCursor @@ -638,12 +648,12 @@ - 所属部门: + 使用部门: - + ForbiddenCursor @@ -657,14 +667,14 @@ - + - 负责人: + 设备分类: - + ForbiddenCursor @@ -678,14 +688,14 @@ - + - 设备供方: + 检定周期: - + ForbiddenCursor @@ -699,14 +709,14 @@ - + - 位置信息: + 重要等级: - + ForbiddenCursor @@ -720,140 +730,14 @@ - - - 设备类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 标准类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 设备分类: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 重要等级: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 检定周期: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 对应开箱记录: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - 备注: - - + + ForbiddenCursor @@ -892,7 +776,7 @@ - + diff --git a/softwareDirectory/AutoVerScheme/create_task.cpp b/softwareDirectory/AutoVerScheme/create_task.cpp index 9b49a1a..ddd78ef 100644 --- a/softwareDirectory/AutoVerScheme/create_task.cpp +++ b/softwareDirectory/AutoVerScheme/create_task.cpp @@ -2,12 +2,15 @@ #include "ui_create_task.h" #include "QMessageBox" + + QString Create_Task::State=""; Create_Task::Create_Task(QWidget *parent) : InfoBase(parent), ui(new Ui::Create_Task) { ui->setupUi(this); this->initForm(); + } Create_Task::~Create_Task() @@ -25,17 +28,19 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(8); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(9); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "任务单编号" << "委托方"<< "使用部门" << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; + headers <<"ID"<< "序号" << "任务单编号" << "委托方"<< "使用部门" + << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); //ShowMessageBox("标题","初始化完成"); } @@ -57,5 +62,171 @@ } void Create_Task::Load() { - //ShowMessageBox("创建任务界面","创建任务界面初始化完成"); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + + QList data = BaseCommonApi::getCreateTaskList(""); + + int rowCount = 0; + int row=0; + QString is_urgent; + for (const CreateTaskList& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.order_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.customer_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.DEPT_FULL_NAME)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.require_over_time.toString())); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.deliverer)); + if(item.is_urgent=="1") + is_urgent="是"; + else + is_urgent="否"; + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(is_urgent)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("查看"); + QPushButton *button2 = new QPushButton("编辑"); + QPushButton *button3 = new QPushButton("删除"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + Create_Task::State="Select"; + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonUpdateClicked(id); + Create_Task::State="Update"; + } + + }); + //设置按钮3简单样式 + button3->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: red; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button3->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button3, &QPushButton::clicked, this, [this, button3, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtoDeleteClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->addWidget(button3); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 8, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void Create_Task::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + HiddenButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "查看按钮ID",id); +} +void Create_Task::OnButtonUpdateClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "编辑按钮ID",id); +} +void Create_Task::OnButtoDeleteClicked(QString id) +{ + // ======================================================================================== + // 删除按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + + QMessageBox::information(this, "删除按钮ID",id); +} + +void Create_Task::on_pushButton_2_clicked() +{ + // ======================================================================================== + // 创建任务单按钮 + // ==================================================================================== + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + Create_Task::State="Create"; +} +void Create_Task::HiddenButton() +{ + ui->SaveButton->hide(); + ui->CreateButton->hide(); + ui->ScanButton->hide(); + ui->deletebutton->hide(); +} +void Create_Task::DisplayButton() +{ + ui->SaveButton->show(); + ui->CreateButton->show(); + ui->ScanButton->show(); + ui->deletebutton->show(); +} + +void Create_Task::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/InfoBase.h b/softwareDirectory/AutoVerScheme/InfoBase.h index 6dd59f3..bce9609 100644 --- a/softwareDirectory/AutoVerScheme/InfoBase.h +++ b/softwareDirectory/AutoVerScheme/InfoBase.h @@ -4,6 +4,7 @@ #include #include "QStandardItemModel" #include "databaseconnection.h" +#include "basecommonapi.h" ///信号管理页面的基类 所有信息管理页面都继承于InfoBase /// 便于统一管理 所有子类必须实现Load方法 /// 每次按钮点击切换都会调用Load方法 用于每次页面的数据刷新 @@ -16,7 +17,7 @@ //QStandardItemModel 的实例。这个模型将用于存储和管理数据。 QStandardItemModel *model; //信息管理页面 基类定义Conn对象 - DatabaseConnection *Conn=DatabaseConnection::getInstance(); + BaseCommonApi dbManager; }; #endif // INFOBASE_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index f62915b..6170ee7 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -15,7 +15,7 @@ " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id " " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID " " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID " - " WHERE sys_user.ID = ' :userId '"); + " WHERE sys_user.ID = :userId"); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -75,6 +75,35 @@ } return result; } + +//获取创建任务首页数据 +QList BaseCommonApi::getCreateTaskList(QString userId) +{ + userId="1640229293790650370"; + QList result; + QSqlQuery query; + query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " + " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " + " WHERE bi.create_user_id = :userId"); + // 将参数绑定到占位符 + query.bindValue(":userId", userId); + if (query.exec()) { + while (query.next()) { + CreateTaskList task; + task.id = query.value("id").toString(); + task.order_no = query.value("order_no").toString(); + task.customer_name = query.value("customer_name").toString(); + task.DEPT_FULL_NAME = query.value("FULL_NAME").toString(); + task.require_over_time = query.value("require_over_time").toDateTime(); + task.deliverer = query.value("deliverer").toString(); + task.is_urgent = query.value("is_urgent").toString(); + result.append(task); + } + } else { + qDebug() << "Query execution failed: " << query.lastError().text(); + } + return result; +} //获取创建任务首页数据 QListgetCreateTaskList(QString userId) { @@ -82,7 +111,7 @@ QSqlQuery query; query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " - " WHERE bi.create_user_id = ':userId' "); + " WHERE bi.create_user_id = :userId "); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -103,6 +132,7 @@ return result; } + //创建任务单-查看/编辑 顶部数据 传参该条数据的id QListBaseCommonApi::getCatTask(QString id) { @@ -111,7 +141,7 @@ query.prepare("SELECT bi.order_no ,bi.customer_name ,dept.FULL_NAME ,bi.require_over_time ," " bi.deliverer ,bi.deliverer_tel ,bi.undertaker_name ,bi.undertake_time , bi.is_urgent AS ," " bi.receive_illustrate FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID" - " WHERE bi.id = ' :id '"); + " WHERE bi.id = :id "); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -140,6 +170,7 @@ //获取创建任务 -任务单列表 + QListBaseCommonApi::getCatTaskList(QString orderId) { QList result; @@ -380,6 +411,7 @@ QListBaseCommonApi::getCheckDCPower(QString equipment_id,QStringList *headList) { + equipment_id="1693435753272557570"; QList result; QSqlQuery query; query.prepare("SELECT besciddp.id ,besciddp.params,besciddp.unit,resolution,besciddp.urel,besciddp.check_type,datum_point,cycle_number " @@ -407,9 +439,11 @@ } else { qDebug() << "Query execution failed: " << query.lastError().text(); } + *headList <<"序号"<<"核查项目"<<"核查点"<<"单位"<<"分辨力"<<"Urel"<<"核查类型"<<"是否为基准点(1/0)"<<"循环次数" <<"电阻值/频率"<<"电阻值单位/频率单位"<<"核查项备注"; + return result; } //根据id获取装置名称 @@ -436,9 +470,9 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " - " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id " - " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); +bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " + " JOIN sys_dept ON sys_dept.ID = eei.dept_id " + " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); if (isSuccess) { while (query.next()) { TestedDevice testedDevice; @@ -504,9 +538,10 @@ //判断 哪个 装置表 传参 设备id QList BaseCommonApi::getJudgeCalibrationTable(QString id) { + id="1716997603953311746"; QList result; QSqlQuery query; - query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = ':id')"); + query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = :id )"); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -526,12 +561,55 @@ return result; } +//标准装置字典类型 +/** + * 多功能校准源标准装置 = 1 + * 直流稳压电源检定装置 = 2 + * 多功能电气安全校准器标准装置 = 3 + * 0.02级活塞式压力计标准装置 = 4 + * 二等铂电阻温度计标准装置 = 5 + * 安全阀校验装置 = 6 + * 精密露点仪标准装置 = 7 + * E2等级砝码标准装置 = 8 + * 频谱分析仪标准装置 = 9 + * 信号发生器标准装置 = 10 + * 微波衰减标准装置 = 11 + * 频率短期稳定度标准装置 =12 + * 示波器标准装置 = 13 + * 铯原子频率标准装置 =14 + * 小功率标准装置 = 15 + * 低频信号发生器标准装置 = 16 + * S参数标准装置 = 17 + * 失真度标准装置 = 18 + */ +//根据被检设备ID获取当前设备的 核查项目及核查点 + +QList BaseCommonApi::Search_CalibrationTable(QString DeiverId,QStringList *HeadList) +{ + + QList DataList; + DataList.clear(); + QList CliTable=BaseCommonApi::getJudgeCalibrationTable(DeiverId); + if(CliTable.count()==0)return DataList; + switch (CliTable[0].belong_standard_equipment.toInt()) + { + case 1: + + //CliTable[0].item_category_id + DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList); + break; + } + + return DataList; +} //被检设备管理-检定项目及检定点-多功能校准源 -QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) +QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) { -QList result; +QList resultData; +QStringList result; +resultData.clear(); QSqlQuery query; query.prepare("SELECT bbdmidc.id ,bbdmidc.params ,bbdmidc.capacity ,bbdmidc.unit ,bbdmidc.frequency , bbdmidc.range_range , bbdmidc.standard_value , bbdmidc.resolution , bbdmidc.maximum_error , bbdmidc.error_param_a , bbdmidc.error_param_b " @@ -542,26 +620,24 @@ if (query.exec()) { while (query.next()) { - VerMultiCal calibration; - calibration.id = query.value("id").toString(); - calibration.params = query.value("params").toString(); - calibration.capacity = query.value("capacity").toString(); - calibration.unit = query.value("unit").toString(); - calibration.frequency = query.value("frequency").toString(); - calibration.range_range = query.value("range_range").toString(); - calibration.standard_value = query.value("standard_value").toString(); - calibration.resolution = query.value("resolution").toString(); - calibration.maximum_error = query.value("maximum_error").toString(); - calibration.error_param_a = query.value("error_param_a").toString(); - calibration.error_param_b = query.value("error_param_b").toString(); - - result.append(calibration); + result.clear(); + result.append(query.value("id").toString()); + result.append(query.value("params").toString()); + result.append(query.value("capacity").toString()); + result.append(query.value("unit").toString()); + result.append(query.value("frequency").toString()); + result.append(query.value("range_range").toString()); + result.append(query.value("standard_value").toString()); + result.append(query.value("resolution").toString()); + result.append(query.value("maximum_error").toString()); + result.append(query.value("error_param_a").toString()); + result.append(query.value("error_param_b").toString()); + resultData.append(result); } } else { qDebug() << "Query execution failed: " << query.lastError().text(); } - *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; - return result; + *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; } //检定数据管理 首页 @@ -757,7 +833,7 @@ " LEFT JOIN biz_equipment_standard_check_info besci ON besci.item_category_id = bescidc.item_category_id " " WHERE bescidc.equipment_id = :equipment_id "); - // 将参数绑定到占位符 '1692796512381222914' + // 将参数绑定到占位符 1692796512381222914 query.bindValue(":equipment_id", equipment_id); if (query.exec()) { while (query.next()) { @@ -788,12 +864,13 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " + bool isSuccess = query.exec("SELECT brtf.id,brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " " FROM biz_resource_technique_file brtf"); if (isSuccess) { while (query.next()) { Technique_File file; + file.id=query.value("id").toString(); file.file_distribute_no = query.value("file_distribute_no").toString(); file.file_name = query.value("file_name").toString(); file.version_no = query.value("version_no").toString(); @@ -876,7 +953,7 @@ QList result; QSqlQuery query; query.prepare("SELECT id,device_id ,communication_type ,serial_port ,visa ,create_time ,update_time " - "FROM zd_communication_setting WHERE device_id = ' :deviceId '"); + "FROM zd_communication_setting WHERE device_id = :deviceId "); query.bindValue(":deviceId", deviceId); if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h index 1b70cb9..ff8a320 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.h +++ b/softwareDirectory/AutoVerScheme/basecommonapi.h @@ -9,7 +9,7 @@ #include "databaseconnection.h" #include "id\IdWorker.h" - +#include "QStringList" //部门任务 @@ -52,6 +52,7 @@ QDateTime require_over_time; QString deliverer; QString is_urgent; + }; //创建任务单-查看任务单 class CatTask @@ -241,9 +242,15 @@ QString belong_standard_equipment; }; +class BaseEntity: public QObject +{ + Q_OBJECT + public: + +}; //被检设备管理-检定项目及检定点-检定项多功能校准源 -class VerMultiCal +class VerMultiCal:public BaseEntity { public: QString id; @@ -365,6 +372,7 @@ class Technique_File { public: + QString id; QString file_distribute_no; QString file_name; QString version_no; @@ -444,12 +452,22 @@ public: BaseCommonApi(); + // + static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList); + //部门任务 + static QList getAllData(); + //部门任务 参数登录用户的id static QList getAllData(QString userId); + //我的任务 static QList getMyTasks(QString id); //获取创建任务首页数据 - static QListgetCreateTaskList(QString id); + + static QListgetCreateTaskList(QString userId); + + + //创建任务-查看任务单顶部 static QListgetCatTask(QString orderNo); //创建任务-查看任务列表底部 @@ -479,7 +497,10 @@ //判断 哪个 装置表 传参 设备id 返回itemId static QList getJudgeCalibrationTable(QString id); //被检设备管理-检定项目及检定点-多功能校准源 - static QList getVerMultiCal(QString itemId,QStringList *headList); + + + static QList getVerMultiCal(QString itemId,QStringList *headList); + // 获取检定数据管理 首页 static QList getVerificationData(); // 检定数据管理-检定基本信息 @@ -494,6 +515,7 @@ static QList getCheckDataManageResultManageMult(QString equipment_id); //技术文件 static QList getTechnique_File(); + //检定程序管理首页查询 static QList getVerificationProgramInfoMain(); //检定程序管理 编辑 @@ -525,7 +547,6 @@ IdWorker &idWorker = Singleton::instance(); //自动检定 - }; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp index c3b2786..70148f4 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp @@ -4,6 +4,7 @@ #include "basecommonapi.h" //#include "tested_device_manage_serve.h" +#include "QStringList" //被检设备 BeExamined_DeviceItem::BeExamined_DeviceItem(QWidget *parent) : @@ -32,19 +33,32 @@ "}"); // ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); // item->setTextAlignment(Qt::AlignCenter); //ui->tableWidget->setItem(0, 0, item); //设置数据 - + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" + headers << "ID" << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" << "生产厂家"<<"所在单位" <<"使用部门"<<"计量标识"<<"检定周期"<<"证书有效期"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); + //详情页面tableWidgetItem设置 + ui->tableWidgetItem->setStyleSheet("QHeaderView::section {" + "border: 1px solid rgba(197, 196, 196, 1);" + "border-left:none;" + "border-top:none;" + "background-color:white;" + "}"); + + // ui->tableWidget->setRowCount(10); // 设置10行 + //ui->tableWidgetItem->setColumnCount(14); // 设置11列 + ui->tableWidgetItem->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 + ui->tableWidgetItem->verticalHeader()->setParent(nullptr); //隐藏行头 + } void BeExamined_DeviceItem::ShowMessageBox(QString title,QString value) { // 创建一个QMessageBox对象 @@ -64,24 +78,19 @@ } void BeExamined_DeviceItem::Load() { - //获取主页面内容 - //进入主页面 - /* - ui->stackedWidget->setCurrentIndex(0); + // ======================================================================================== + // 主页面初始化 + // ==================================================================================== + + + ui->stackedWidget->setCurrentIndex(0); //先设置为行为0 ui->tableWidget->setRowCount(0); - - - // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BeExamined_DeviceItem dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; int row=0; - QList data = dbManager.getBizDeviceManage(); - - - for (const BizDevice& bizDevice : data) { + QList data = dbManager.getTestedDevice(); + for (const TestedDevice& bizDevice : data) { rowCount = ui->tableWidget->rowCount(); ui->tableWidget->insertRow(rowCount); @@ -89,34 +98,118 @@ ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); ui->tableWidget->setItem(row, 2, new QTableWidgetItem(bizDevice.equipment_name)); ui->tableWidget->setItem(row, 3, new QTableWidgetItem(bizDevice.model)); - ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacture_no)); - ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.help_instruction)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacture_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(bizDevice.FULL_NAME)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(bizDevice.meter_identify)); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem(bizDevice.check_cycle)); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(bizDevice.certificate_valid)); + //添加操作按钮 QPushButton *button = new QPushButton("查看"); - ui->tableWidget->setCellWidget(row, 6, button); + ui->tableWidget->setCellWidget(row, 12, button); //设置按钮简单样式 button->setStyleSheet("QPushButton {" - " border: none; /* 无边框 "*/ - // " color: green; /* 文本颜色 */" - // " text-decoration: underline; /* 文本下划线 */" - // "}"); + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); // 设置鼠标悬停时的光标样式为小手图标 - // button->setCursor(Qt::PointingHandCursor); + button->setCursor(Qt::PointingHandCursor); // 连接按钮的 clicked 信号到自定义槽函数 - // connect(button, &QPushButton::clicked, this, [this, button, row]() { - // 获取当前行第一列的 ID - // QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); - // if (idItem) { - // QString id = idItem->text(); -// - // OnButtonSelectClicked(id); - // } + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); - // }); + OnButtonSelectClicked(id); + } - // row++; - - // } + }); + row++; + } } +void BeExamined_DeviceItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + + DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +//返回按钮 +void BeExamined_DeviceItem::on_pushButton_2_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); +} +void BeExamined_DeviceItem::DeviceInfoInit(QString id) +{ + // ======================================================================================== + // 初始化详情 + // ==================================================================================== + + QList data = dbManager.getTestedCatDevice(id); + for (const TestedCatDevice& testedCatDevice : data) { + + ui->equipment_name->setText(testedCatDevice.equipment_name); + ui->model->setText(testedCatDevice.model); + ui->help_instruction->setText(testedCatDevice.help_instruction); + ui->manufacture_no->setText(testedCatDevice.manufacture_no); + ui->product_country->setText(testedCatDevice.product_country); + ui->manufacturer->setText(testedCatDevice.manufacturer); + ui->product_date->setText(testedCatDevice.product_date); + ui->purchase_date->setText(testedCatDevice.purchase_date); + ui->unit_price->setText(testedCatDevice.unit_price); + ui->usage_status->setText(testedCatDevice.usage_status); + ui->quality_condition->setText(testedCatDevice.quality_condition); + ui->dept_name->setText(testedCatDevice.FULL_NAME); + ui->category->setText(testedCatDevice.category); + ui->check_cycle->setText(testedCatDevice.check_cycle); + ui->level->setText(testedCatDevice.level); + ui->remark->setText(testedCatDevice.remark); + } + + + // ======================================================================================== + // 初始化检定项目及核查点 + // ==================================================================================== + + //获取核查点tablewight的数据 + QStringList headlist; + + QList Data=dbManager.Search_CalibrationTable(id,&headlist); + + //tableWidgetItem + ui->tableWidgetItem->setRowCount(0); + ui->tableWidgetItem->setColumnCount(headlist.count()); + ui->tableWidgetItem->setHorizontalHeaderLabels(headlist); + //循环数据 + int rowCount=0; + int row=0; + ; + for (const QStringList& item : Data) + { + //获取行号 并进行添加行 + rowCount = ui->tableWidgetItem->rowCount(); + ui->tableWidgetItem->insertRow(rowCount); + //添加 序号 + ui->tableWidgetItem->setItem(row, 0, new QTableWidgetItem(QString::number(row+1))); + //循环读取值 headlist,count是列的数量 + for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型 + } + + row++; + + } +} + + + diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h index ffdc22a..0050ee7 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h @@ -21,6 +21,11 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + + void DeviceInfoInit(QString id); + + void on_pushButton_2_clicked(); private: Ui::BeExamined_DeviceItem *ui; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui index ce63879..cdacfaf 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui @@ -215,6 +215,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -225,6 +230,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 @@ -391,7 +401,7 @@ - + ForbiddenCursor @@ -412,7 +422,7 @@ - + ForbiddenCursor @@ -428,12 +438,12 @@ - 出厂编号: + 辅助字段: - + ForbiddenCursor @@ -449,12 +459,12 @@ - 检定有效期: + 出厂编号: - + ForbiddenCursor @@ -475,7 +485,7 @@ - + ForbiddenCursor @@ -496,7 +506,7 @@ - + ForbiddenCursor @@ -517,7 +527,7 @@ - + ForbiddenCursor @@ -538,7 +548,7 @@ - + ForbiddenCursor @@ -552,14 +562,14 @@ - + - 使用年限: + 设备单价: - + ForbiddenCursor @@ -573,14 +583,14 @@ - + - 设备单价: + 使用状态: - + ForbiddenCursor @@ -594,14 +604,14 @@ - + - 使用状态: + 质量状况: - + ForbiddenCursor @@ -615,14 +625,14 @@ - + - 质量状况: + 所在单位: - + ForbiddenCursor @@ -638,12 +648,12 @@ - 所属部门: + 使用部门: - + ForbiddenCursor @@ -657,14 +667,14 @@ - + - 负责人: + 设备分类: - + ForbiddenCursor @@ -678,14 +688,14 @@ - + - 设备供方: + 检定周期: - + ForbiddenCursor @@ -699,14 +709,14 @@ - + - 位置信息: + 重要等级: - + ForbiddenCursor @@ -720,140 +730,14 @@ - - - 设备类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 标准类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 设备分类: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 重要等级: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 检定周期: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 对应开箱记录: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - 备注: - - + + ForbiddenCursor @@ -892,7 +776,7 @@ - + diff --git a/softwareDirectory/AutoVerScheme/create_task.cpp b/softwareDirectory/AutoVerScheme/create_task.cpp index 9b49a1a..ddd78ef 100644 --- a/softwareDirectory/AutoVerScheme/create_task.cpp +++ b/softwareDirectory/AutoVerScheme/create_task.cpp @@ -2,12 +2,15 @@ #include "ui_create_task.h" #include "QMessageBox" + + QString Create_Task::State=""; Create_Task::Create_Task(QWidget *parent) : InfoBase(parent), ui(new Ui::Create_Task) { ui->setupUi(this); this->initForm(); + } Create_Task::~Create_Task() @@ -25,17 +28,19 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(8); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(9); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "任务单编号" << "委托方"<< "使用部门" << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; + headers <<"ID"<< "序号" << "任务单编号" << "委托方"<< "使用部门" + << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); //ShowMessageBox("标题","初始化完成"); } @@ -57,5 +62,171 @@ } void Create_Task::Load() { - //ShowMessageBox("创建任务界面","创建任务界面初始化完成"); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + + QList data = BaseCommonApi::getCreateTaskList(""); + + int rowCount = 0; + int row=0; + QString is_urgent; + for (const CreateTaskList& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.order_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.customer_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.DEPT_FULL_NAME)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.require_over_time.toString())); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.deliverer)); + if(item.is_urgent=="1") + is_urgent="是"; + else + is_urgent="否"; + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(is_urgent)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("查看"); + QPushButton *button2 = new QPushButton("编辑"); + QPushButton *button3 = new QPushButton("删除"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + Create_Task::State="Select"; + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonUpdateClicked(id); + Create_Task::State="Update"; + } + + }); + //设置按钮3简单样式 + button3->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: red; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button3->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button3, &QPushButton::clicked, this, [this, button3, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtoDeleteClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->addWidget(button3); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 8, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void Create_Task::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + HiddenButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "查看按钮ID",id); +} +void Create_Task::OnButtonUpdateClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "编辑按钮ID",id); +} +void Create_Task::OnButtoDeleteClicked(QString id) +{ + // ======================================================================================== + // 删除按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + + QMessageBox::information(this, "删除按钮ID",id); +} + +void Create_Task::on_pushButton_2_clicked() +{ + // ======================================================================================== + // 创建任务单按钮 + // ==================================================================================== + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + Create_Task::State="Create"; +} +void Create_Task::HiddenButton() +{ + ui->SaveButton->hide(); + ui->CreateButton->hide(); + ui->ScanButton->hide(); + ui->deletebutton->hide(); +} +void Create_Task::DisplayButton() +{ + ui->SaveButton->show(); + ui->CreateButton->show(); + ui->ScanButton->show(); + ui->deletebutton->show(); +} + +void Create_Task::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/create_task.h b/softwareDirectory/AutoVerScheme/create_task.h index 7cf383f..6b67c7c 100644 --- a/softwareDirectory/AutoVerScheme/create_task.h +++ b/softwareDirectory/AutoVerScheme/create_task.h @@ -16,11 +16,22 @@ explicit Create_Task(QWidget *parent = nullptr); ~Create_Task(); + //全局静态变量 + static QString State; private slots: void initForm(); //初始化界面数据 void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonUpdateClicked(QString id); + void OnButtoDeleteClicked(QString id); + void on_pushButton_2_clicked(); + void HiddenButton(); + void DisplayButton(); + + void on_pushButton_clicked(); + private: Ui::Create_Task *ui; }; diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/InfoBase.h b/softwareDirectory/AutoVerScheme/InfoBase.h index 6dd59f3..bce9609 100644 --- a/softwareDirectory/AutoVerScheme/InfoBase.h +++ b/softwareDirectory/AutoVerScheme/InfoBase.h @@ -4,6 +4,7 @@ #include #include "QStandardItemModel" #include "databaseconnection.h" +#include "basecommonapi.h" ///信号管理页面的基类 所有信息管理页面都继承于InfoBase /// 便于统一管理 所有子类必须实现Load方法 /// 每次按钮点击切换都会调用Load方法 用于每次页面的数据刷新 @@ -16,7 +17,7 @@ //QStandardItemModel 的实例。这个模型将用于存储和管理数据。 QStandardItemModel *model; //信息管理页面 基类定义Conn对象 - DatabaseConnection *Conn=DatabaseConnection::getInstance(); + BaseCommonApi dbManager; }; #endif // INFOBASE_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index f62915b..6170ee7 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -15,7 +15,7 @@ " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id " " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID " " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID " - " WHERE sys_user.ID = ' :userId '"); + " WHERE sys_user.ID = :userId"); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -75,6 +75,35 @@ } return result; } + +//获取创建任务首页数据 +QList BaseCommonApi::getCreateTaskList(QString userId) +{ + userId="1640229293790650370"; + QList result; + QSqlQuery query; + query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " + " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " + " WHERE bi.create_user_id = :userId"); + // 将参数绑定到占位符 + query.bindValue(":userId", userId); + if (query.exec()) { + while (query.next()) { + CreateTaskList task; + task.id = query.value("id").toString(); + task.order_no = query.value("order_no").toString(); + task.customer_name = query.value("customer_name").toString(); + task.DEPT_FULL_NAME = query.value("FULL_NAME").toString(); + task.require_over_time = query.value("require_over_time").toDateTime(); + task.deliverer = query.value("deliverer").toString(); + task.is_urgent = query.value("is_urgent").toString(); + result.append(task); + } + } else { + qDebug() << "Query execution failed: " << query.lastError().text(); + } + return result; +} //获取创建任务首页数据 QListgetCreateTaskList(QString userId) { @@ -82,7 +111,7 @@ QSqlQuery query; query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " - " WHERE bi.create_user_id = ':userId' "); + " WHERE bi.create_user_id = :userId "); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -103,6 +132,7 @@ return result; } + //创建任务单-查看/编辑 顶部数据 传参该条数据的id QListBaseCommonApi::getCatTask(QString id) { @@ -111,7 +141,7 @@ query.prepare("SELECT bi.order_no ,bi.customer_name ,dept.FULL_NAME ,bi.require_over_time ," " bi.deliverer ,bi.deliverer_tel ,bi.undertaker_name ,bi.undertake_time , bi.is_urgent AS ," " bi.receive_illustrate FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID" - " WHERE bi.id = ' :id '"); + " WHERE bi.id = :id "); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -140,6 +170,7 @@ //获取创建任务 -任务单列表 + QListBaseCommonApi::getCatTaskList(QString orderId) { QList result; @@ -380,6 +411,7 @@ QListBaseCommonApi::getCheckDCPower(QString equipment_id,QStringList *headList) { + equipment_id="1693435753272557570"; QList result; QSqlQuery query; query.prepare("SELECT besciddp.id ,besciddp.params,besciddp.unit,resolution,besciddp.urel,besciddp.check_type,datum_point,cycle_number " @@ -407,9 +439,11 @@ } else { qDebug() << "Query execution failed: " << query.lastError().text(); } + *headList <<"序号"<<"核查项目"<<"核查点"<<"单位"<<"分辨力"<<"Urel"<<"核查类型"<<"是否为基准点(1/0)"<<"循环次数" <<"电阻值/频率"<<"电阻值单位/频率单位"<<"核查项备注"; + return result; } //根据id获取装置名称 @@ -436,9 +470,9 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " - " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id " - " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); +bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " + " JOIN sys_dept ON sys_dept.ID = eei.dept_id " + " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); if (isSuccess) { while (query.next()) { TestedDevice testedDevice; @@ -504,9 +538,10 @@ //判断 哪个 装置表 传参 设备id QList BaseCommonApi::getJudgeCalibrationTable(QString id) { + id="1716997603953311746"; QList result; QSqlQuery query; - query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = ':id')"); + query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = :id )"); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -526,12 +561,55 @@ return result; } +//标准装置字典类型 +/** + * 多功能校准源标准装置 = 1 + * 直流稳压电源检定装置 = 2 + * 多功能电气安全校准器标准装置 = 3 + * 0.02级活塞式压力计标准装置 = 4 + * 二等铂电阻温度计标准装置 = 5 + * 安全阀校验装置 = 6 + * 精密露点仪标准装置 = 7 + * E2等级砝码标准装置 = 8 + * 频谱分析仪标准装置 = 9 + * 信号发生器标准装置 = 10 + * 微波衰减标准装置 = 11 + * 频率短期稳定度标准装置 =12 + * 示波器标准装置 = 13 + * 铯原子频率标准装置 =14 + * 小功率标准装置 = 15 + * 低频信号发生器标准装置 = 16 + * S参数标准装置 = 17 + * 失真度标准装置 = 18 + */ +//根据被检设备ID获取当前设备的 核查项目及核查点 + +QList BaseCommonApi::Search_CalibrationTable(QString DeiverId,QStringList *HeadList) +{ + + QList DataList; + DataList.clear(); + QList CliTable=BaseCommonApi::getJudgeCalibrationTable(DeiverId); + if(CliTable.count()==0)return DataList; + switch (CliTable[0].belong_standard_equipment.toInt()) + { + case 1: + + //CliTable[0].item_category_id + DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList); + break; + } + + return DataList; +} //被检设备管理-检定项目及检定点-多功能校准源 -QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) +QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) { -QList result; +QList resultData; +QStringList result; +resultData.clear(); QSqlQuery query; query.prepare("SELECT bbdmidc.id ,bbdmidc.params ,bbdmidc.capacity ,bbdmidc.unit ,bbdmidc.frequency , bbdmidc.range_range , bbdmidc.standard_value , bbdmidc.resolution , bbdmidc.maximum_error , bbdmidc.error_param_a , bbdmidc.error_param_b " @@ -542,26 +620,24 @@ if (query.exec()) { while (query.next()) { - VerMultiCal calibration; - calibration.id = query.value("id").toString(); - calibration.params = query.value("params").toString(); - calibration.capacity = query.value("capacity").toString(); - calibration.unit = query.value("unit").toString(); - calibration.frequency = query.value("frequency").toString(); - calibration.range_range = query.value("range_range").toString(); - calibration.standard_value = query.value("standard_value").toString(); - calibration.resolution = query.value("resolution").toString(); - calibration.maximum_error = query.value("maximum_error").toString(); - calibration.error_param_a = query.value("error_param_a").toString(); - calibration.error_param_b = query.value("error_param_b").toString(); - - result.append(calibration); + result.clear(); + result.append(query.value("id").toString()); + result.append(query.value("params").toString()); + result.append(query.value("capacity").toString()); + result.append(query.value("unit").toString()); + result.append(query.value("frequency").toString()); + result.append(query.value("range_range").toString()); + result.append(query.value("standard_value").toString()); + result.append(query.value("resolution").toString()); + result.append(query.value("maximum_error").toString()); + result.append(query.value("error_param_a").toString()); + result.append(query.value("error_param_b").toString()); + resultData.append(result); } } else { qDebug() << "Query execution failed: " << query.lastError().text(); } - *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; - return result; + *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; } //检定数据管理 首页 @@ -757,7 +833,7 @@ " LEFT JOIN biz_equipment_standard_check_info besci ON besci.item_category_id = bescidc.item_category_id " " WHERE bescidc.equipment_id = :equipment_id "); - // 将参数绑定到占位符 '1692796512381222914' + // 将参数绑定到占位符 1692796512381222914 query.bindValue(":equipment_id", equipment_id); if (query.exec()) { while (query.next()) { @@ -788,12 +864,13 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " + bool isSuccess = query.exec("SELECT brtf.id,brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " " FROM biz_resource_technique_file brtf"); if (isSuccess) { while (query.next()) { Technique_File file; + file.id=query.value("id").toString(); file.file_distribute_no = query.value("file_distribute_no").toString(); file.file_name = query.value("file_name").toString(); file.version_no = query.value("version_no").toString(); @@ -876,7 +953,7 @@ QList result; QSqlQuery query; query.prepare("SELECT id,device_id ,communication_type ,serial_port ,visa ,create_time ,update_time " - "FROM zd_communication_setting WHERE device_id = ' :deviceId '"); + "FROM zd_communication_setting WHERE device_id = :deviceId "); query.bindValue(":deviceId", deviceId); if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h index 1b70cb9..ff8a320 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.h +++ b/softwareDirectory/AutoVerScheme/basecommonapi.h @@ -9,7 +9,7 @@ #include "databaseconnection.h" #include "id\IdWorker.h" - +#include "QStringList" //部门任务 @@ -52,6 +52,7 @@ QDateTime require_over_time; QString deliverer; QString is_urgent; + }; //创建任务单-查看任务单 class CatTask @@ -241,9 +242,15 @@ QString belong_standard_equipment; }; +class BaseEntity: public QObject +{ + Q_OBJECT + public: + +}; //被检设备管理-检定项目及检定点-检定项多功能校准源 -class VerMultiCal +class VerMultiCal:public BaseEntity { public: QString id; @@ -365,6 +372,7 @@ class Technique_File { public: + QString id; QString file_distribute_no; QString file_name; QString version_no; @@ -444,12 +452,22 @@ public: BaseCommonApi(); + // + static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList); + //部门任务 + static QList getAllData(); + //部门任务 参数登录用户的id static QList getAllData(QString userId); + //我的任务 static QList getMyTasks(QString id); //获取创建任务首页数据 - static QListgetCreateTaskList(QString id); + + static QListgetCreateTaskList(QString userId); + + + //创建任务-查看任务单顶部 static QListgetCatTask(QString orderNo); //创建任务-查看任务列表底部 @@ -479,7 +497,10 @@ //判断 哪个 装置表 传参 设备id 返回itemId static QList getJudgeCalibrationTable(QString id); //被检设备管理-检定项目及检定点-多功能校准源 - static QList getVerMultiCal(QString itemId,QStringList *headList); + + + static QList getVerMultiCal(QString itemId,QStringList *headList); + // 获取检定数据管理 首页 static QList getVerificationData(); // 检定数据管理-检定基本信息 @@ -494,6 +515,7 @@ static QList getCheckDataManageResultManageMult(QString equipment_id); //技术文件 static QList getTechnique_File(); + //检定程序管理首页查询 static QList getVerificationProgramInfoMain(); //检定程序管理 编辑 @@ -525,7 +547,6 @@ IdWorker &idWorker = Singleton::instance(); //自动检定 - }; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp index c3b2786..70148f4 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp @@ -4,6 +4,7 @@ #include "basecommonapi.h" //#include "tested_device_manage_serve.h" +#include "QStringList" //被检设备 BeExamined_DeviceItem::BeExamined_DeviceItem(QWidget *parent) : @@ -32,19 +33,32 @@ "}"); // ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); // item->setTextAlignment(Qt::AlignCenter); //ui->tableWidget->setItem(0, 0, item); //设置数据 - + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" + headers << "ID" << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" << "生产厂家"<<"所在单位" <<"使用部门"<<"计量标识"<<"检定周期"<<"证书有效期"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); + //详情页面tableWidgetItem设置 + ui->tableWidgetItem->setStyleSheet("QHeaderView::section {" + "border: 1px solid rgba(197, 196, 196, 1);" + "border-left:none;" + "border-top:none;" + "background-color:white;" + "}"); + + // ui->tableWidget->setRowCount(10); // 设置10行 + //ui->tableWidgetItem->setColumnCount(14); // 设置11列 + ui->tableWidgetItem->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 + ui->tableWidgetItem->verticalHeader()->setParent(nullptr); //隐藏行头 + } void BeExamined_DeviceItem::ShowMessageBox(QString title,QString value) { // 创建一个QMessageBox对象 @@ -64,24 +78,19 @@ } void BeExamined_DeviceItem::Load() { - //获取主页面内容 - //进入主页面 - /* - ui->stackedWidget->setCurrentIndex(0); + // ======================================================================================== + // 主页面初始化 + // ==================================================================================== + + + ui->stackedWidget->setCurrentIndex(0); //先设置为行为0 ui->tableWidget->setRowCount(0); - - - // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BeExamined_DeviceItem dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; int row=0; - QList data = dbManager.getBizDeviceManage(); - - - for (const BizDevice& bizDevice : data) { + QList data = dbManager.getTestedDevice(); + for (const TestedDevice& bizDevice : data) { rowCount = ui->tableWidget->rowCount(); ui->tableWidget->insertRow(rowCount); @@ -89,34 +98,118 @@ ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); ui->tableWidget->setItem(row, 2, new QTableWidgetItem(bizDevice.equipment_name)); ui->tableWidget->setItem(row, 3, new QTableWidgetItem(bizDevice.model)); - ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacture_no)); - ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.help_instruction)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacture_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(bizDevice.FULL_NAME)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(bizDevice.meter_identify)); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem(bizDevice.check_cycle)); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(bizDevice.certificate_valid)); + //添加操作按钮 QPushButton *button = new QPushButton("查看"); - ui->tableWidget->setCellWidget(row, 6, button); + ui->tableWidget->setCellWidget(row, 12, button); //设置按钮简单样式 button->setStyleSheet("QPushButton {" - " border: none; /* 无边框 "*/ - // " color: green; /* 文本颜色 */" - // " text-decoration: underline; /* 文本下划线 */" - // "}"); + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); // 设置鼠标悬停时的光标样式为小手图标 - // button->setCursor(Qt::PointingHandCursor); + button->setCursor(Qt::PointingHandCursor); // 连接按钮的 clicked 信号到自定义槽函数 - // connect(button, &QPushButton::clicked, this, [this, button, row]() { - // 获取当前行第一列的 ID - // QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); - // if (idItem) { - // QString id = idItem->text(); -// - // OnButtonSelectClicked(id); - // } + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); - // }); + OnButtonSelectClicked(id); + } - // row++; - - // } + }); + row++; + } } +void BeExamined_DeviceItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + + DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +//返回按钮 +void BeExamined_DeviceItem::on_pushButton_2_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); +} +void BeExamined_DeviceItem::DeviceInfoInit(QString id) +{ + // ======================================================================================== + // 初始化详情 + // ==================================================================================== + + QList data = dbManager.getTestedCatDevice(id); + for (const TestedCatDevice& testedCatDevice : data) { + + ui->equipment_name->setText(testedCatDevice.equipment_name); + ui->model->setText(testedCatDevice.model); + ui->help_instruction->setText(testedCatDevice.help_instruction); + ui->manufacture_no->setText(testedCatDevice.manufacture_no); + ui->product_country->setText(testedCatDevice.product_country); + ui->manufacturer->setText(testedCatDevice.manufacturer); + ui->product_date->setText(testedCatDevice.product_date); + ui->purchase_date->setText(testedCatDevice.purchase_date); + ui->unit_price->setText(testedCatDevice.unit_price); + ui->usage_status->setText(testedCatDevice.usage_status); + ui->quality_condition->setText(testedCatDevice.quality_condition); + ui->dept_name->setText(testedCatDevice.FULL_NAME); + ui->category->setText(testedCatDevice.category); + ui->check_cycle->setText(testedCatDevice.check_cycle); + ui->level->setText(testedCatDevice.level); + ui->remark->setText(testedCatDevice.remark); + } + + + // ======================================================================================== + // 初始化检定项目及核查点 + // ==================================================================================== + + //获取核查点tablewight的数据 + QStringList headlist; + + QList Data=dbManager.Search_CalibrationTable(id,&headlist); + + //tableWidgetItem + ui->tableWidgetItem->setRowCount(0); + ui->tableWidgetItem->setColumnCount(headlist.count()); + ui->tableWidgetItem->setHorizontalHeaderLabels(headlist); + //循环数据 + int rowCount=0; + int row=0; + ; + for (const QStringList& item : Data) + { + //获取行号 并进行添加行 + rowCount = ui->tableWidgetItem->rowCount(); + ui->tableWidgetItem->insertRow(rowCount); + //添加 序号 + ui->tableWidgetItem->setItem(row, 0, new QTableWidgetItem(QString::number(row+1))); + //循环读取值 headlist,count是列的数量 + for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型 + } + + row++; + + } +} + + + diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h index ffdc22a..0050ee7 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h @@ -21,6 +21,11 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + + void DeviceInfoInit(QString id); + + void on_pushButton_2_clicked(); private: Ui::BeExamined_DeviceItem *ui; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui index ce63879..cdacfaf 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui @@ -215,6 +215,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -225,6 +230,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 @@ -391,7 +401,7 @@ - + ForbiddenCursor @@ -412,7 +422,7 @@ - + ForbiddenCursor @@ -428,12 +438,12 @@ - 出厂编号: + 辅助字段: - + ForbiddenCursor @@ -449,12 +459,12 @@ - 检定有效期: + 出厂编号: - + ForbiddenCursor @@ -475,7 +485,7 @@ - + ForbiddenCursor @@ -496,7 +506,7 @@ - + ForbiddenCursor @@ -517,7 +527,7 @@ - + ForbiddenCursor @@ -538,7 +548,7 @@ - + ForbiddenCursor @@ -552,14 +562,14 @@ - + - 使用年限: + 设备单价: - + ForbiddenCursor @@ -573,14 +583,14 @@ - + - 设备单价: + 使用状态: - + ForbiddenCursor @@ -594,14 +604,14 @@ - + - 使用状态: + 质量状况: - + ForbiddenCursor @@ -615,14 +625,14 @@ - + - 质量状况: + 所在单位: - + ForbiddenCursor @@ -638,12 +648,12 @@ - 所属部门: + 使用部门: - + ForbiddenCursor @@ -657,14 +667,14 @@ - + - 负责人: + 设备分类: - + ForbiddenCursor @@ -678,14 +688,14 @@ - + - 设备供方: + 检定周期: - + ForbiddenCursor @@ -699,14 +709,14 @@ - + - 位置信息: + 重要等级: - + ForbiddenCursor @@ -720,140 +730,14 @@ - - - 设备类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 标准类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 设备分类: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 重要等级: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 检定周期: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 对应开箱记录: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - 备注: - - + + ForbiddenCursor @@ -892,7 +776,7 @@ - + diff --git a/softwareDirectory/AutoVerScheme/create_task.cpp b/softwareDirectory/AutoVerScheme/create_task.cpp index 9b49a1a..ddd78ef 100644 --- a/softwareDirectory/AutoVerScheme/create_task.cpp +++ b/softwareDirectory/AutoVerScheme/create_task.cpp @@ -2,12 +2,15 @@ #include "ui_create_task.h" #include "QMessageBox" + + QString Create_Task::State=""; Create_Task::Create_Task(QWidget *parent) : InfoBase(parent), ui(new Ui::Create_Task) { ui->setupUi(this); this->initForm(); + } Create_Task::~Create_Task() @@ -25,17 +28,19 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(8); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(9); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "任务单编号" << "委托方"<< "使用部门" << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; + headers <<"ID"<< "序号" << "任务单编号" << "委托方"<< "使用部门" + << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); //ShowMessageBox("标题","初始化完成"); } @@ -57,5 +62,171 @@ } void Create_Task::Load() { - //ShowMessageBox("创建任务界面","创建任务界面初始化完成"); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + + QList data = BaseCommonApi::getCreateTaskList(""); + + int rowCount = 0; + int row=0; + QString is_urgent; + for (const CreateTaskList& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.order_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.customer_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.DEPT_FULL_NAME)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.require_over_time.toString())); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.deliverer)); + if(item.is_urgent=="1") + is_urgent="是"; + else + is_urgent="否"; + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(is_urgent)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("查看"); + QPushButton *button2 = new QPushButton("编辑"); + QPushButton *button3 = new QPushButton("删除"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + Create_Task::State="Select"; + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonUpdateClicked(id); + Create_Task::State="Update"; + } + + }); + //设置按钮3简单样式 + button3->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: red; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button3->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button3, &QPushButton::clicked, this, [this, button3, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtoDeleteClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->addWidget(button3); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 8, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void Create_Task::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + HiddenButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "查看按钮ID",id); +} +void Create_Task::OnButtonUpdateClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "编辑按钮ID",id); +} +void Create_Task::OnButtoDeleteClicked(QString id) +{ + // ======================================================================================== + // 删除按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + + QMessageBox::information(this, "删除按钮ID",id); +} + +void Create_Task::on_pushButton_2_clicked() +{ + // ======================================================================================== + // 创建任务单按钮 + // ==================================================================================== + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + Create_Task::State="Create"; +} +void Create_Task::HiddenButton() +{ + ui->SaveButton->hide(); + ui->CreateButton->hide(); + ui->ScanButton->hide(); + ui->deletebutton->hide(); +} +void Create_Task::DisplayButton() +{ + ui->SaveButton->show(); + ui->CreateButton->show(); + ui->ScanButton->show(); + ui->deletebutton->show(); +} + +void Create_Task::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/create_task.h b/softwareDirectory/AutoVerScheme/create_task.h index 7cf383f..6b67c7c 100644 --- a/softwareDirectory/AutoVerScheme/create_task.h +++ b/softwareDirectory/AutoVerScheme/create_task.h @@ -16,11 +16,22 @@ explicit Create_Task(QWidget *parent = nullptr); ~Create_Task(); + //全局静态变量 + static QString State; private slots: void initForm(); //初始化界面数据 void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonUpdateClicked(QString id); + void OnButtoDeleteClicked(QString id); + void on_pushButton_2_clicked(); + void HiddenButton(); + void DisplayButton(); + + void on_pushButton_clicked(); + private: Ui::Create_Task *ui; }; diff --git a/softwareDirectory/AutoVerScheme/create_task.ui b/softwareDirectory/AutoVerScheme/create_task.ui index d9d88ed..b45af33 100644 --- a/softwareDirectory/AutoVerScheme/create_task.ui +++ b/softwareDirectory/AutoVerScheme/create_task.ui @@ -19,278 +19,651 @@ - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 1 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 任务单编号: - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - 委托方: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 使用部门: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 要求完成时间: - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(3, 58, 132); + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 任务单编号: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 委托方: + + + + + + + + + + 使用部门: + + + + + + + + + + 要求检完时间: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); color:white; - - - 查询 - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(207, 132, 33); + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); color:white; - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - 6 + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + 3 + + + + + + 50 + 40 + + + + + 100 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 创建任务单 + + + + + + + + + + + + + + + + + + + + + color:black; - - 9 - - - 9 - - - 9 - - - - - - 0 - 0 - - - - - 120 - 40 - - - - OpenHandCursor - - - Qt::DefaultContextMenu - - - Qt::RightToLeft - - - false - - - background-color:rgb(9, 89, 179); + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 创建任务单 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 保存 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; color:white; - - - 创建任务单 - - - true - - - - - - - - - - - - - - SizeVerCursor - - - - - - - + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接人: + + + + + + + 要求检完时间: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 是否加急: + + + + + + + 电话: + + + + + + + 委托方: + + + + + + + 任务单编号: + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接时间: + + + + + + + 送检人: + + + + + + + 接收说明: + + + + + + + 使用部门: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + 任务单列表: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 扫描增加 + + + false + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 增加行 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 删除行 + + + + + + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/InfoBase.h b/softwareDirectory/AutoVerScheme/InfoBase.h index 6dd59f3..bce9609 100644 --- a/softwareDirectory/AutoVerScheme/InfoBase.h +++ b/softwareDirectory/AutoVerScheme/InfoBase.h @@ -4,6 +4,7 @@ #include #include "QStandardItemModel" #include "databaseconnection.h" +#include "basecommonapi.h" ///信号管理页面的基类 所有信息管理页面都继承于InfoBase /// 便于统一管理 所有子类必须实现Load方法 /// 每次按钮点击切换都会调用Load方法 用于每次页面的数据刷新 @@ -16,7 +17,7 @@ //QStandardItemModel 的实例。这个模型将用于存储和管理数据。 QStandardItemModel *model; //信息管理页面 基类定义Conn对象 - DatabaseConnection *Conn=DatabaseConnection::getInstance(); + BaseCommonApi dbManager; }; #endif // INFOBASE_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index f62915b..6170ee7 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -15,7 +15,7 @@ " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id " " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID " " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID " - " WHERE sys_user.ID = ' :userId '"); + " WHERE sys_user.ID = :userId"); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -75,6 +75,35 @@ } return result; } + +//获取创建任务首页数据 +QList BaseCommonApi::getCreateTaskList(QString userId) +{ + userId="1640229293790650370"; + QList result; + QSqlQuery query; + query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " + " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " + " WHERE bi.create_user_id = :userId"); + // 将参数绑定到占位符 + query.bindValue(":userId", userId); + if (query.exec()) { + while (query.next()) { + CreateTaskList task; + task.id = query.value("id").toString(); + task.order_no = query.value("order_no").toString(); + task.customer_name = query.value("customer_name").toString(); + task.DEPT_FULL_NAME = query.value("FULL_NAME").toString(); + task.require_over_time = query.value("require_over_time").toDateTime(); + task.deliverer = query.value("deliverer").toString(); + task.is_urgent = query.value("is_urgent").toString(); + result.append(task); + } + } else { + qDebug() << "Query execution failed: " << query.lastError().text(); + } + return result; +} //获取创建任务首页数据 QListgetCreateTaskList(QString userId) { @@ -82,7 +111,7 @@ QSqlQuery query; query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " - " WHERE bi.create_user_id = ':userId' "); + " WHERE bi.create_user_id = :userId "); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -103,6 +132,7 @@ return result; } + //创建任务单-查看/编辑 顶部数据 传参该条数据的id QListBaseCommonApi::getCatTask(QString id) { @@ -111,7 +141,7 @@ query.prepare("SELECT bi.order_no ,bi.customer_name ,dept.FULL_NAME ,bi.require_over_time ," " bi.deliverer ,bi.deliverer_tel ,bi.undertaker_name ,bi.undertake_time , bi.is_urgent AS ," " bi.receive_illustrate FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID" - " WHERE bi.id = ' :id '"); + " WHERE bi.id = :id "); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -140,6 +170,7 @@ //获取创建任务 -任务单列表 + QListBaseCommonApi::getCatTaskList(QString orderId) { QList result; @@ -380,6 +411,7 @@ QListBaseCommonApi::getCheckDCPower(QString equipment_id,QStringList *headList) { + equipment_id="1693435753272557570"; QList result; QSqlQuery query; query.prepare("SELECT besciddp.id ,besciddp.params,besciddp.unit,resolution,besciddp.urel,besciddp.check_type,datum_point,cycle_number " @@ -407,9 +439,11 @@ } else { qDebug() << "Query execution failed: " << query.lastError().text(); } + *headList <<"序号"<<"核查项目"<<"核查点"<<"单位"<<"分辨力"<<"Urel"<<"核查类型"<<"是否为基准点(1/0)"<<"循环次数" <<"电阻值/频率"<<"电阻值单位/频率单位"<<"核查项备注"; + return result; } //根据id获取装置名称 @@ -436,9 +470,9 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " - " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id " - " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); +bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " + " JOIN sys_dept ON sys_dept.ID = eei.dept_id " + " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); if (isSuccess) { while (query.next()) { TestedDevice testedDevice; @@ -504,9 +538,10 @@ //判断 哪个 装置表 传参 设备id QList BaseCommonApi::getJudgeCalibrationTable(QString id) { + id="1716997603953311746"; QList result; QSqlQuery query; - query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = ':id')"); + query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = :id )"); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -526,12 +561,55 @@ return result; } +//标准装置字典类型 +/** + * 多功能校准源标准装置 = 1 + * 直流稳压电源检定装置 = 2 + * 多功能电气安全校准器标准装置 = 3 + * 0.02级活塞式压力计标准装置 = 4 + * 二等铂电阻温度计标准装置 = 5 + * 安全阀校验装置 = 6 + * 精密露点仪标准装置 = 7 + * E2等级砝码标准装置 = 8 + * 频谱分析仪标准装置 = 9 + * 信号发生器标准装置 = 10 + * 微波衰减标准装置 = 11 + * 频率短期稳定度标准装置 =12 + * 示波器标准装置 = 13 + * 铯原子频率标准装置 =14 + * 小功率标准装置 = 15 + * 低频信号发生器标准装置 = 16 + * S参数标准装置 = 17 + * 失真度标准装置 = 18 + */ +//根据被检设备ID获取当前设备的 核查项目及核查点 + +QList BaseCommonApi::Search_CalibrationTable(QString DeiverId,QStringList *HeadList) +{ + + QList DataList; + DataList.clear(); + QList CliTable=BaseCommonApi::getJudgeCalibrationTable(DeiverId); + if(CliTable.count()==0)return DataList; + switch (CliTable[0].belong_standard_equipment.toInt()) + { + case 1: + + //CliTable[0].item_category_id + DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList); + break; + } + + return DataList; +} //被检设备管理-检定项目及检定点-多功能校准源 -QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) +QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) { -QList result; +QList resultData; +QStringList result; +resultData.clear(); QSqlQuery query; query.prepare("SELECT bbdmidc.id ,bbdmidc.params ,bbdmidc.capacity ,bbdmidc.unit ,bbdmidc.frequency , bbdmidc.range_range , bbdmidc.standard_value , bbdmidc.resolution , bbdmidc.maximum_error , bbdmidc.error_param_a , bbdmidc.error_param_b " @@ -542,26 +620,24 @@ if (query.exec()) { while (query.next()) { - VerMultiCal calibration; - calibration.id = query.value("id").toString(); - calibration.params = query.value("params").toString(); - calibration.capacity = query.value("capacity").toString(); - calibration.unit = query.value("unit").toString(); - calibration.frequency = query.value("frequency").toString(); - calibration.range_range = query.value("range_range").toString(); - calibration.standard_value = query.value("standard_value").toString(); - calibration.resolution = query.value("resolution").toString(); - calibration.maximum_error = query.value("maximum_error").toString(); - calibration.error_param_a = query.value("error_param_a").toString(); - calibration.error_param_b = query.value("error_param_b").toString(); - - result.append(calibration); + result.clear(); + result.append(query.value("id").toString()); + result.append(query.value("params").toString()); + result.append(query.value("capacity").toString()); + result.append(query.value("unit").toString()); + result.append(query.value("frequency").toString()); + result.append(query.value("range_range").toString()); + result.append(query.value("standard_value").toString()); + result.append(query.value("resolution").toString()); + result.append(query.value("maximum_error").toString()); + result.append(query.value("error_param_a").toString()); + result.append(query.value("error_param_b").toString()); + resultData.append(result); } } else { qDebug() << "Query execution failed: " << query.lastError().text(); } - *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; - return result; + *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; } //检定数据管理 首页 @@ -757,7 +833,7 @@ " LEFT JOIN biz_equipment_standard_check_info besci ON besci.item_category_id = bescidc.item_category_id " " WHERE bescidc.equipment_id = :equipment_id "); - // 将参数绑定到占位符 '1692796512381222914' + // 将参数绑定到占位符 1692796512381222914 query.bindValue(":equipment_id", equipment_id); if (query.exec()) { while (query.next()) { @@ -788,12 +864,13 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " + bool isSuccess = query.exec("SELECT brtf.id,brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " " FROM biz_resource_technique_file brtf"); if (isSuccess) { while (query.next()) { Technique_File file; + file.id=query.value("id").toString(); file.file_distribute_no = query.value("file_distribute_no").toString(); file.file_name = query.value("file_name").toString(); file.version_no = query.value("version_no").toString(); @@ -876,7 +953,7 @@ QList result; QSqlQuery query; query.prepare("SELECT id,device_id ,communication_type ,serial_port ,visa ,create_time ,update_time " - "FROM zd_communication_setting WHERE device_id = ' :deviceId '"); + "FROM zd_communication_setting WHERE device_id = :deviceId "); query.bindValue(":deviceId", deviceId); if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h index 1b70cb9..ff8a320 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.h +++ b/softwareDirectory/AutoVerScheme/basecommonapi.h @@ -9,7 +9,7 @@ #include "databaseconnection.h" #include "id\IdWorker.h" - +#include "QStringList" //部门任务 @@ -52,6 +52,7 @@ QDateTime require_over_time; QString deliverer; QString is_urgent; + }; //创建任务单-查看任务单 class CatTask @@ -241,9 +242,15 @@ QString belong_standard_equipment; }; +class BaseEntity: public QObject +{ + Q_OBJECT + public: + +}; //被检设备管理-检定项目及检定点-检定项多功能校准源 -class VerMultiCal +class VerMultiCal:public BaseEntity { public: QString id; @@ -365,6 +372,7 @@ class Technique_File { public: + QString id; QString file_distribute_no; QString file_name; QString version_no; @@ -444,12 +452,22 @@ public: BaseCommonApi(); + // + static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList); + //部门任务 + static QList getAllData(); + //部门任务 参数登录用户的id static QList getAllData(QString userId); + //我的任务 static QList getMyTasks(QString id); //获取创建任务首页数据 - static QListgetCreateTaskList(QString id); + + static QListgetCreateTaskList(QString userId); + + + //创建任务-查看任务单顶部 static QListgetCatTask(QString orderNo); //创建任务-查看任务列表底部 @@ -479,7 +497,10 @@ //判断 哪个 装置表 传参 设备id 返回itemId static QList getJudgeCalibrationTable(QString id); //被检设备管理-检定项目及检定点-多功能校准源 - static QList getVerMultiCal(QString itemId,QStringList *headList); + + + static QList getVerMultiCal(QString itemId,QStringList *headList); + // 获取检定数据管理 首页 static QList getVerificationData(); // 检定数据管理-检定基本信息 @@ -494,6 +515,7 @@ static QList getCheckDataManageResultManageMult(QString equipment_id); //技术文件 static QList getTechnique_File(); + //检定程序管理首页查询 static QList getVerificationProgramInfoMain(); //检定程序管理 编辑 @@ -525,7 +547,6 @@ IdWorker &idWorker = Singleton::instance(); //自动检定 - }; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp index c3b2786..70148f4 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp @@ -4,6 +4,7 @@ #include "basecommonapi.h" //#include "tested_device_manage_serve.h" +#include "QStringList" //被检设备 BeExamined_DeviceItem::BeExamined_DeviceItem(QWidget *parent) : @@ -32,19 +33,32 @@ "}"); // ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); // item->setTextAlignment(Qt::AlignCenter); //ui->tableWidget->setItem(0, 0, item); //设置数据 - + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" + headers << "ID" << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" << "生产厂家"<<"所在单位" <<"使用部门"<<"计量标识"<<"检定周期"<<"证书有效期"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); + //详情页面tableWidgetItem设置 + ui->tableWidgetItem->setStyleSheet("QHeaderView::section {" + "border: 1px solid rgba(197, 196, 196, 1);" + "border-left:none;" + "border-top:none;" + "background-color:white;" + "}"); + + // ui->tableWidget->setRowCount(10); // 设置10行 + //ui->tableWidgetItem->setColumnCount(14); // 设置11列 + ui->tableWidgetItem->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 + ui->tableWidgetItem->verticalHeader()->setParent(nullptr); //隐藏行头 + } void BeExamined_DeviceItem::ShowMessageBox(QString title,QString value) { // 创建一个QMessageBox对象 @@ -64,24 +78,19 @@ } void BeExamined_DeviceItem::Load() { - //获取主页面内容 - //进入主页面 - /* - ui->stackedWidget->setCurrentIndex(0); + // ======================================================================================== + // 主页面初始化 + // ==================================================================================== + + + ui->stackedWidget->setCurrentIndex(0); //先设置为行为0 ui->tableWidget->setRowCount(0); - - - // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BeExamined_DeviceItem dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; int row=0; - QList data = dbManager.getBizDeviceManage(); - - - for (const BizDevice& bizDevice : data) { + QList data = dbManager.getTestedDevice(); + for (const TestedDevice& bizDevice : data) { rowCount = ui->tableWidget->rowCount(); ui->tableWidget->insertRow(rowCount); @@ -89,34 +98,118 @@ ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); ui->tableWidget->setItem(row, 2, new QTableWidgetItem(bizDevice.equipment_name)); ui->tableWidget->setItem(row, 3, new QTableWidgetItem(bizDevice.model)); - ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacture_no)); - ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.help_instruction)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacture_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(bizDevice.FULL_NAME)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(bizDevice.meter_identify)); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem(bizDevice.check_cycle)); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(bizDevice.certificate_valid)); + //添加操作按钮 QPushButton *button = new QPushButton("查看"); - ui->tableWidget->setCellWidget(row, 6, button); + ui->tableWidget->setCellWidget(row, 12, button); //设置按钮简单样式 button->setStyleSheet("QPushButton {" - " border: none; /* 无边框 "*/ - // " color: green; /* 文本颜色 */" - // " text-decoration: underline; /* 文本下划线 */" - // "}"); + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); // 设置鼠标悬停时的光标样式为小手图标 - // button->setCursor(Qt::PointingHandCursor); + button->setCursor(Qt::PointingHandCursor); // 连接按钮的 clicked 信号到自定义槽函数 - // connect(button, &QPushButton::clicked, this, [this, button, row]() { - // 获取当前行第一列的 ID - // QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); - // if (idItem) { - // QString id = idItem->text(); -// - // OnButtonSelectClicked(id); - // } + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); - // }); + OnButtonSelectClicked(id); + } - // row++; - - // } + }); + row++; + } } +void BeExamined_DeviceItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + + DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +//返回按钮 +void BeExamined_DeviceItem::on_pushButton_2_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); +} +void BeExamined_DeviceItem::DeviceInfoInit(QString id) +{ + // ======================================================================================== + // 初始化详情 + // ==================================================================================== + + QList data = dbManager.getTestedCatDevice(id); + for (const TestedCatDevice& testedCatDevice : data) { + + ui->equipment_name->setText(testedCatDevice.equipment_name); + ui->model->setText(testedCatDevice.model); + ui->help_instruction->setText(testedCatDevice.help_instruction); + ui->manufacture_no->setText(testedCatDevice.manufacture_no); + ui->product_country->setText(testedCatDevice.product_country); + ui->manufacturer->setText(testedCatDevice.manufacturer); + ui->product_date->setText(testedCatDevice.product_date); + ui->purchase_date->setText(testedCatDevice.purchase_date); + ui->unit_price->setText(testedCatDevice.unit_price); + ui->usage_status->setText(testedCatDevice.usage_status); + ui->quality_condition->setText(testedCatDevice.quality_condition); + ui->dept_name->setText(testedCatDevice.FULL_NAME); + ui->category->setText(testedCatDevice.category); + ui->check_cycle->setText(testedCatDevice.check_cycle); + ui->level->setText(testedCatDevice.level); + ui->remark->setText(testedCatDevice.remark); + } + + + // ======================================================================================== + // 初始化检定项目及核查点 + // ==================================================================================== + + //获取核查点tablewight的数据 + QStringList headlist; + + QList Data=dbManager.Search_CalibrationTable(id,&headlist); + + //tableWidgetItem + ui->tableWidgetItem->setRowCount(0); + ui->tableWidgetItem->setColumnCount(headlist.count()); + ui->tableWidgetItem->setHorizontalHeaderLabels(headlist); + //循环数据 + int rowCount=0; + int row=0; + ; + for (const QStringList& item : Data) + { + //获取行号 并进行添加行 + rowCount = ui->tableWidgetItem->rowCount(); + ui->tableWidgetItem->insertRow(rowCount); + //添加 序号 + ui->tableWidgetItem->setItem(row, 0, new QTableWidgetItem(QString::number(row+1))); + //循环读取值 headlist,count是列的数量 + for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型 + } + + row++; + + } +} + + + diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h index ffdc22a..0050ee7 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h @@ -21,6 +21,11 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + + void DeviceInfoInit(QString id); + + void on_pushButton_2_clicked(); private: Ui::BeExamined_DeviceItem *ui; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui index ce63879..cdacfaf 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui @@ -215,6 +215,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -225,6 +230,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 @@ -391,7 +401,7 @@ - + ForbiddenCursor @@ -412,7 +422,7 @@ - + ForbiddenCursor @@ -428,12 +438,12 @@ - 出厂编号: + 辅助字段: - + ForbiddenCursor @@ -449,12 +459,12 @@ - 检定有效期: + 出厂编号: - + ForbiddenCursor @@ -475,7 +485,7 @@ - + ForbiddenCursor @@ -496,7 +506,7 @@ - + ForbiddenCursor @@ -517,7 +527,7 @@ - + ForbiddenCursor @@ -538,7 +548,7 @@ - + ForbiddenCursor @@ -552,14 +562,14 @@ - + - 使用年限: + 设备单价: - + ForbiddenCursor @@ -573,14 +583,14 @@ - + - 设备单价: + 使用状态: - + ForbiddenCursor @@ -594,14 +604,14 @@ - + - 使用状态: + 质量状况: - + ForbiddenCursor @@ -615,14 +625,14 @@ - + - 质量状况: + 所在单位: - + ForbiddenCursor @@ -638,12 +648,12 @@ - 所属部门: + 使用部门: - + ForbiddenCursor @@ -657,14 +667,14 @@ - + - 负责人: + 设备分类: - + ForbiddenCursor @@ -678,14 +688,14 @@ - + - 设备供方: + 检定周期: - + ForbiddenCursor @@ -699,14 +709,14 @@ - + - 位置信息: + 重要等级: - + ForbiddenCursor @@ -720,140 +730,14 @@ - - - 设备类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 标准类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 设备分类: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 重要等级: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 检定周期: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 对应开箱记录: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - 备注: - - + + ForbiddenCursor @@ -892,7 +776,7 @@ - + diff --git a/softwareDirectory/AutoVerScheme/create_task.cpp b/softwareDirectory/AutoVerScheme/create_task.cpp index 9b49a1a..ddd78ef 100644 --- a/softwareDirectory/AutoVerScheme/create_task.cpp +++ b/softwareDirectory/AutoVerScheme/create_task.cpp @@ -2,12 +2,15 @@ #include "ui_create_task.h" #include "QMessageBox" + + QString Create_Task::State=""; Create_Task::Create_Task(QWidget *parent) : InfoBase(parent), ui(new Ui::Create_Task) { ui->setupUi(this); this->initForm(); + } Create_Task::~Create_Task() @@ -25,17 +28,19 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(8); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(9); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "任务单编号" << "委托方"<< "使用部门" << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; + headers <<"ID"<< "序号" << "任务单编号" << "委托方"<< "使用部门" + << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); //ShowMessageBox("标题","初始化完成"); } @@ -57,5 +62,171 @@ } void Create_Task::Load() { - //ShowMessageBox("创建任务界面","创建任务界面初始化完成"); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + + QList data = BaseCommonApi::getCreateTaskList(""); + + int rowCount = 0; + int row=0; + QString is_urgent; + for (const CreateTaskList& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.order_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.customer_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.DEPT_FULL_NAME)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.require_over_time.toString())); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.deliverer)); + if(item.is_urgent=="1") + is_urgent="是"; + else + is_urgent="否"; + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(is_urgent)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("查看"); + QPushButton *button2 = new QPushButton("编辑"); + QPushButton *button3 = new QPushButton("删除"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + Create_Task::State="Select"; + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonUpdateClicked(id); + Create_Task::State="Update"; + } + + }); + //设置按钮3简单样式 + button3->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: red; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button3->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button3, &QPushButton::clicked, this, [this, button3, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtoDeleteClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->addWidget(button3); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 8, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void Create_Task::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + HiddenButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "查看按钮ID",id); +} +void Create_Task::OnButtonUpdateClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "编辑按钮ID",id); +} +void Create_Task::OnButtoDeleteClicked(QString id) +{ + // ======================================================================================== + // 删除按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + + QMessageBox::information(this, "删除按钮ID",id); +} + +void Create_Task::on_pushButton_2_clicked() +{ + // ======================================================================================== + // 创建任务单按钮 + // ==================================================================================== + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + Create_Task::State="Create"; +} +void Create_Task::HiddenButton() +{ + ui->SaveButton->hide(); + ui->CreateButton->hide(); + ui->ScanButton->hide(); + ui->deletebutton->hide(); +} +void Create_Task::DisplayButton() +{ + ui->SaveButton->show(); + ui->CreateButton->show(); + ui->ScanButton->show(); + ui->deletebutton->show(); +} + +void Create_Task::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/create_task.h b/softwareDirectory/AutoVerScheme/create_task.h index 7cf383f..6b67c7c 100644 --- a/softwareDirectory/AutoVerScheme/create_task.h +++ b/softwareDirectory/AutoVerScheme/create_task.h @@ -16,11 +16,22 @@ explicit Create_Task(QWidget *parent = nullptr); ~Create_Task(); + //全局静态变量 + static QString State; private slots: void initForm(); //初始化界面数据 void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonUpdateClicked(QString id); + void OnButtoDeleteClicked(QString id); + void on_pushButton_2_clicked(); + void HiddenButton(); + void DisplayButton(); + + void on_pushButton_clicked(); + private: Ui::Create_Task *ui; }; diff --git a/softwareDirectory/AutoVerScheme/create_task.ui b/softwareDirectory/AutoVerScheme/create_task.ui index d9d88ed..b45af33 100644 --- a/softwareDirectory/AutoVerScheme/create_task.ui +++ b/softwareDirectory/AutoVerScheme/create_task.ui @@ -19,278 +19,651 @@ - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 1 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 任务单编号: - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - 委托方: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 使用部门: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 要求完成时间: - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(3, 58, 132); + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 任务单编号: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 委托方: + + + + + + + + + + 使用部门: + + + + + + + + + + 要求检完时间: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); color:white; - - - 查询 - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(207, 132, 33); + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); color:white; - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - 6 + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + 3 + + + + + + 50 + 40 + + + + + 100 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 创建任务单 + + + + + + + + + + + + + + + + + + + + + color:black; - - 9 - - - 9 - - - 9 - - - - - - 0 - 0 - - - - - 120 - 40 - - - - OpenHandCursor - - - Qt::DefaultContextMenu - - - Qt::RightToLeft - - - false - - - background-color:rgb(9, 89, 179); + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 创建任务单 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 保存 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; color:white; - - - 创建任务单 - - - true - - - - - - - - - - - - - - SizeVerCursor - - - - - - - + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接人: + + + + + + + 要求检完时间: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 是否加急: + + + + + + + 电话: + + + + + + + 委托方: + + + + + + + 任务单编号: + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接时间: + + + + + + + 送检人: + + + + + + + 接收说明: + + + + + + + 使用部门: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + 任务单列表: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 扫描增加 + + + false + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 增加行 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 删除行 + + + + + + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/depar_task.ui b/softwareDirectory/AutoVerScheme/depar_task.ui index efb7561..f44829d 100644 --- a/softwareDirectory/AutoVerScheme/depar_task.ui +++ b/softwareDirectory/AutoVerScheme/depar_task.ui @@ -213,86 +213,6 @@ - - - 12 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/InfoBase.h b/softwareDirectory/AutoVerScheme/InfoBase.h index 6dd59f3..bce9609 100644 --- a/softwareDirectory/AutoVerScheme/InfoBase.h +++ b/softwareDirectory/AutoVerScheme/InfoBase.h @@ -4,6 +4,7 @@ #include #include "QStandardItemModel" #include "databaseconnection.h" +#include "basecommonapi.h" ///信号管理页面的基类 所有信息管理页面都继承于InfoBase /// 便于统一管理 所有子类必须实现Load方法 /// 每次按钮点击切换都会调用Load方法 用于每次页面的数据刷新 @@ -16,7 +17,7 @@ //QStandardItemModel 的实例。这个模型将用于存储和管理数据。 QStandardItemModel *model; //信息管理页面 基类定义Conn对象 - DatabaseConnection *Conn=DatabaseConnection::getInstance(); + BaseCommonApi dbManager; }; #endif // INFOBASE_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index f62915b..6170ee7 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -15,7 +15,7 @@ " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id " " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID " " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID " - " WHERE sys_user.ID = ' :userId '"); + " WHERE sys_user.ID = :userId"); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -75,6 +75,35 @@ } return result; } + +//获取创建任务首页数据 +QList BaseCommonApi::getCreateTaskList(QString userId) +{ + userId="1640229293790650370"; + QList result; + QSqlQuery query; + query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " + " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " + " WHERE bi.create_user_id = :userId"); + // 将参数绑定到占位符 + query.bindValue(":userId", userId); + if (query.exec()) { + while (query.next()) { + CreateTaskList task; + task.id = query.value("id").toString(); + task.order_no = query.value("order_no").toString(); + task.customer_name = query.value("customer_name").toString(); + task.DEPT_FULL_NAME = query.value("FULL_NAME").toString(); + task.require_over_time = query.value("require_over_time").toDateTime(); + task.deliverer = query.value("deliverer").toString(); + task.is_urgent = query.value("is_urgent").toString(); + result.append(task); + } + } else { + qDebug() << "Query execution failed: " << query.lastError().text(); + } + return result; +} //获取创建任务首页数据 QListgetCreateTaskList(QString userId) { @@ -82,7 +111,7 @@ QSqlQuery query; query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " - " WHERE bi.create_user_id = ':userId' "); + " WHERE bi.create_user_id = :userId "); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -103,6 +132,7 @@ return result; } + //创建任务单-查看/编辑 顶部数据 传参该条数据的id QListBaseCommonApi::getCatTask(QString id) { @@ -111,7 +141,7 @@ query.prepare("SELECT bi.order_no ,bi.customer_name ,dept.FULL_NAME ,bi.require_over_time ," " bi.deliverer ,bi.deliverer_tel ,bi.undertaker_name ,bi.undertake_time , bi.is_urgent AS ," " bi.receive_illustrate FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID" - " WHERE bi.id = ' :id '"); + " WHERE bi.id = :id "); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -140,6 +170,7 @@ //获取创建任务 -任务单列表 + QListBaseCommonApi::getCatTaskList(QString orderId) { QList result; @@ -380,6 +411,7 @@ QListBaseCommonApi::getCheckDCPower(QString equipment_id,QStringList *headList) { + equipment_id="1693435753272557570"; QList result; QSqlQuery query; query.prepare("SELECT besciddp.id ,besciddp.params,besciddp.unit,resolution,besciddp.urel,besciddp.check_type,datum_point,cycle_number " @@ -407,9 +439,11 @@ } else { qDebug() << "Query execution failed: " << query.lastError().text(); } + *headList <<"序号"<<"核查项目"<<"核查点"<<"单位"<<"分辨力"<<"Urel"<<"核查类型"<<"是否为基准点(1/0)"<<"循环次数" <<"电阻值/频率"<<"电阻值单位/频率单位"<<"核查项备注"; + return result; } //根据id获取装置名称 @@ -436,9 +470,9 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " - " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id " - " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); +bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " + " JOIN sys_dept ON sys_dept.ID = eei.dept_id " + " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); if (isSuccess) { while (query.next()) { TestedDevice testedDevice; @@ -504,9 +538,10 @@ //判断 哪个 装置表 传参 设备id QList BaseCommonApi::getJudgeCalibrationTable(QString id) { + id="1716997603953311746"; QList result; QSqlQuery query; - query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = ':id')"); + query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = :id )"); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -526,12 +561,55 @@ return result; } +//标准装置字典类型 +/** + * 多功能校准源标准装置 = 1 + * 直流稳压电源检定装置 = 2 + * 多功能电气安全校准器标准装置 = 3 + * 0.02级活塞式压力计标准装置 = 4 + * 二等铂电阻温度计标准装置 = 5 + * 安全阀校验装置 = 6 + * 精密露点仪标准装置 = 7 + * E2等级砝码标准装置 = 8 + * 频谱分析仪标准装置 = 9 + * 信号发生器标准装置 = 10 + * 微波衰减标准装置 = 11 + * 频率短期稳定度标准装置 =12 + * 示波器标准装置 = 13 + * 铯原子频率标准装置 =14 + * 小功率标准装置 = 15 + * 低频信号发生器标准装置 = 16 + * S参数标准装置 = 17 + * 失真度标准装置 = 18 + */ +//根据被检设备ID获取当前设备的 核查项目及核查点 + +QList BaseCommonApi::Search_CalibrationTable(QString DeiverId,QStringList *HeadList) +{ + + QList DataList; + DataList.clear(); + QList CliTable=BaseCommonApi::getJudgeCalibrationTable(DeiverId); + if(CliTable.count()==0)return DataList; + switch (CliTable[0].belong_standard_equipment.toInt()) + { + case 1: + + //CliTable[0].item_category_id + DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList); + break; + } + + return DataList; +} //被检设备管理-检定项目及检定点-多功能校准源 -QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) +QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) { -QList result; +QList resultData; +QStringList result; +resultData.clear(); QSqlQuery query; query.prepare("SELECT bbdmidc.id ,bbdmidc.params ,bbdmidc.capacity ,bbdmidc.unit ,bbdmidc.frequency , bbdmidc.range_range , bbdmidc.standard_value , bbdmidc.resolution , bbdmidc.maximum_error , bbdmidc.error_param_a , bbdmidc.error_param_b " @@ -542,26 +620,24 @@ if (query.exec()) { while (query.next()) { - VerMultiCal calibration; - calibration.id = query.value("id").toString(); - calibration.params = query.value("params").toString(); - calibration.capacity = query.value("capacity").toString(); - calibration.unit = query.value("unit").toString(); - calibration.frequency = query.value("frequency").toString(); - calibration.range_range = query.value("range_range").toString(); - calibration.standard_value = query.value("standard_value").toString(); - calibration.resolution = query.value("resolution").toString(); - calibration.maximum_error = query.value("maximum_error").toString(); - calibration.error_param_a = query.value("error_param_a").toString(); - calibration.error_param_b = query.value("error_param_b").toString(); - - result.append(calibration); + result.clear(); + result.append(query.value("id").toString()); + result.append(query.value("params").toString()); + result.append(query.value("capacity").toString()); + result.append(query.value("unit").toString()); + result.append(query.value("frequency").toString()); + result.append(query.value("range_range").toString()); + result.append(query.value("standard_value").toString()); + result.append(query.value("resolution").toString()); + result.append(query.value("maximum_error").toString()); + result.append(query.value("error_param_a").toString()); + result.append(query.value("error_param_b").toString()); + resultData.append(result); } } else { qDebug() << "Query execution failed: " << query.lastError().text(); } - *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; - return result; + *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; } //检定数据管理 首页 @@ -757,7 +833,7 @@ " LEFT JOIN biz_equipment_standard_check_info besci ON besci.item_category_id = bescidc.item_category_id " " WHERE bescidc.equipment_id = :equipment_id "); - // 将参数绑定到占位符 '1692796512381222914' + // 将参数绑定到占位符 1692796512381222914 query.bindValue(":equipment_id", equipment_id); if (query.exec()) { while (query.next()) { @@ -788,12 +864,13 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " + bool isSuccess = query.exec("SELECT brtf.id,brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " " FROM biz_resource_technique_file brtf"); if (isSuccess) { while (query.next()) { Technique_File file; + file.id=query.value("id").toString(); file.file_distribute_no = query.value("file_distribute_no").toString(); file.file_name = query.value("file_name").toString(); file.version_no = query.value("version_no").toString(); @@ -876,7 +953,7 @@ QList result; QSqlQuery query; query.prepare("SELECT id,device_id ,communication_type ,serial_port ,visa ,create_time ,update_time " - "FROM zd_communication_setting WHERE device_id = ' :deviceId '"); + "FROM zd_communication_setting WHERE device_id = :deviceId "); query.bindValue(":deviceId", deviceId); if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h index 1b70cb9..ff8a320 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.h +++ b/softwareDirectory/AutoVerScheme/basecommonapi.h @@ -9,7 +9,7 @@ #include "databaseconnection.h" #include "id\IdWorker.h" - +#include "QStringList" //部门任务 @@ -52,6 +52,7 @@ QDateTime require_over_time; QString deliverer; QString is_urgent; + }; //创建任务单-查看任务单 class CatTask @@ -241,9 +242,15 @@ QString belong_standard_equipment; }; +class BaseEntity: public QObject +{ + Q_OBJECT + public: + +}; //被检设备管理-检定项目及检定点-检定项多功能校准源 -class VerMultiCal +class VerMultiCal:public BaseEntity { public: QString id; @@ -365,6 +372,7 @@ class Technique_File { public: + QString id; QString file_distribute_no; QString file_name; QString version_no; @@ -444,12 +452,22 @@ public: BaseCommonApi(); + // + static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList); + //部门任务 + static QList getAllData(); + //部门任务 参数登录用户的id static QList getAllData(QString userId); + //我的任务 static QList getMyTasks(QString id); //获取创建任务首页数据 - static QListgetCreateTaskList(QString id); + + static QListgetCreateTaskList(QString userId); + + + //创建任务-查看任务单顶部 static QListgetCatTask(QString orderNo); //创建任务-查看任务列表底部 @@ -479,7 +497,10 @@ //判断 哪个 装置表 传参 设备id 返回itemId static QList getJudgeCalibrationTable(QString id); //被检设备管理-检定项目及检定点-多功能校准源 - static QList getVerMultiCal(QString itemId,QStringList *headList); + + + static QList getVerMultiCal(QString itemId,QStringList *headList); + // 获取检定数据管理 首页 static QList getVerificationData(); // 检定数据管理-检定基本信息 @@ -494,6 +515,7 @@ static QList getCheckDataManageResultManageMult(QString equipment_id); //技术文件 static QList getTechnique_File(); + //检定程序管理首页查询 static QList getVerificationProgramInfoMain(); //检定程序管理 编辑 @@ -525,7 +547,6 @@ IdWorker &idWorker = Singleton::instance(); //自动检定 - }; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp index c3b2786..70148f4 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp @@ -4,6 +4,7 @@ #include "basecommonapi.h" //#include "tested_device_manage_serve.h" +#include "QStringList" //被检设备 BeExamined_DeviceItem::BeExamined_DeviceItem(QWidget *parent) : @@ -32,19 +33,32 @@ "}"); // ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); // item->setTextAlignment(Qt::AlignCenter); //ui->tableWidget->setItem(0, 0, item); //设置数据 - + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" + headers << "ID" << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" << "生产厂家"<<"所在单位" <<"使用部门"<<"计量标识"<<"检定周期"<<"证书有效期"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); + //详情页面tableWidgetItem设置 + ui->tableWidgetItem->setStyleSheet("QHeaderView::section {" + "border: 1px solid rgba(197, 196, 196, 1);" + "border-left:none;" + "border-top:none;" + "background-color:white;" + "}"); + + // ui->tableWidget->setRowCount(10); // 设置10行 + //ui->tableWidgetItem->setColumnCount(14); // 设置11列 + ui->tableWidgetItem->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 + ui->tableWidgetItem->verticalHeader()->setParent(nullptr); //隐藏行头 + } void BeExamined_DeviceItem::ShowMessageBox(QString title,QString value) { // 创建一个QMessageBox对象 @@ -64,24 +78,19 @@ } void BeExamined_DeviceItem::Load() { - //获取主页面内容 - //进入主页面 - /* - ui->stackedWidget->setCurrentIndex(0); + // ======================================================================================== + // 主页面初始化 + // ==================================================================================== + + + ui->stackedWidget->setCurrentIndex(0); //先设置为行为0 ui->tableWidget->setRowCount(0); - - - // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BeExamined_DeviceItem dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; int row=0; - QList data = dbManager.getBizDeviceManage(); - - - for (const BizDevice& bizDevice : data) { + QList data = dbManager.getTestedDevice(); + for (const TestedDevice& bizDevice : data) { rowCount = ui->tableWidget->rowCount(); ui->tableWidget->insertRow(rowCount); @@ -89,34 +98,118 @@ ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); ui->tableWidget->setItem(row, 2, new QTableWidgetItem(bizDevice.equipment_name)); ui->tableWidget->setItem(row, 3, new QTableWidgetItem(bizDevice.model)); - ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacture_no)); - ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.help_instruction)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacture_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(bizDevice.FULL_NAME)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(bizDevice.meter_identify)); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem(bizDevice.check_cycle)); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(bizDevice.certificate_valid)); + //添加操作按钮 QPushButton *button = new QPushButton("查看"); - ui->tableWidget->setCellWidget(row, 6, button); + ui->tableWidget->setCellWidget(row, 12, button); //设置按钮简单样式 button->setStyleSheet("QPushButton {" - " border: none; /* 无边框 "*/ - // " color: green; /* 文本颜色 */" - // " text-decoration: underline; /* 文本下划线 */" - // "}"); + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); // 设置鼠标悬停时的光标样式为小手图标 - // button->setCursor(Qt::PointingHandCursor); + button->setCursor(Qt::PointingHandCursor); // 连接按钮的 clicked 信号到自定义槽函数 - // connect(button, &QPushButton::clicked, this, [this, button, row]() { - // 获取当前行第一列的 ID - // QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); - // if (idItem) { - // QString id = idItem->text(); -// - // OnButtonSelectClicked(id); - // } + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); - // }); + OnButtonSelectClicked(id); + } - // row++; - - // } + }); + row++; + } } +void BeExamined_DeviceItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + + DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +//返回按钮 +void BeExamined_DeviceItem::on_pushButton_2_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); +} +void BeExamined_DeviceItem::DeviceInfoInit(QString id) +{ + // ======================================================================================== + // 初始化详情 + // ==================================================================================== + + QList data = dbManager.getTestedCatDevice(id); + for (const TestedCatDevice& testedCatDevice : data) { + + ui->equipment_name->setText(testedCatDevice.equipment_name); + ui->model->setText(testedCatDevice.model); + ui->help_instruction->setText(testedCatDevice.help_instruction); + ui->manufacture_no->setText(testedCatDevice.manufacture_no); + ui->product_country->setText(testedCatDevice.product_country); + ui->manufacturer->setText(testedCatDevice.manufacturer); + ui->product_date->setText(testedCatDevice.product_date); + ui->purchase_date->setText(testedCatDevice.purchase_date); + ui->unit_price->setText(testedCatDevice.unit_price); + ui->usage_status->setText(testedCatDevice.usage_status); + ui->quality_condition->setText(testedCatDevice.quality_condition); + ui->dept_name->setText(testedCatDevice.FULL_NAME); + ui->category->setText(testedCatDevice.category); + ui->check_cycle->setText(testedCatDevice.check_cycle); + ui->level->setText(testedCatDevice.level); + ui->remark->setText(testedCatDevice.remark); + } + + + // ======================================================================================== + // 初始化检定项目及核查点 + // ==================================================================================== + + //获取核查点tablewight的数据 + QStringList headlist; + + QList Data=dbManager.Search_CalibrationTable(id,&headlist); + + //tableWidgetItem + ui->tableWidgetItem->setRowCount(0); + ui->tableWidgetItem->setColumnCount(headlist.count()); + ui->tableWidgetItem->setHorizontalHeaderLabels(headlist); + //循环数据 + int rowCount=0; + int row=0; + ; + for (const QStringList& item : Data) + { + //获取行号 并进行添加行 + rowCount = ui->tableWidgetItem->rowCount(); + ui->tableWidgetItem->insertRow(rowCount); + //添加 序号 + ui->tableWidgetItem->setItem(row, 0, new QTableWidgetItem(QString::number(row+1))); + //循环读取值 headlist,count是列的数量 + for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型 + } + + row++; + + } +} + + + diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h index ffdc22a..0050ee7 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h @@ -21,6 +21,11 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + + void DeviceInfoInit(QString id); + + void on_pushButton_2_clicked(); private: Ui::BeExamined_DeviceItem *ui; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui index ce63879..cdacfaf 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui @@ -215,6 +215,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -225,6 +230,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 @@ -391,7 +401,7 @@ - + ForbiddenCursor @@ -412,7 +422,7 @@ - + ForbiddenCursor @@ -428,12 +438,12 @@ - 出厂编号: + 辅助字段: - + ForbiddenCursor @@ -449,12 +459,12 @@ - 检定有效期: + 出厂编号: - + ForbiddenCursor @@ -475,7 +485,7 @@ - + ForbiddenCursor @@ -496,7 +506,7 @@ - + ForbiddenCursor @@ -517,7 +527,7 @@ - + ForbiddenCursor @@ -538,7 +548,7 @@ - + ForbiddenCursor @@ -552,14 +562,14 @@ - + - 使用年限: + 设备单价: - + ForbiddenCursor @@ -573,14 +583,14 @@ - + - 设备单价: + 使用状态: - + ForbiddenCursor @@ -594,14 +604,14 @@ - + - 使用状态: + 质量状况: - + ForbiddenCursor @@ -615,14 +625,14 @@ - + - 质量状况: + 所在单位: - + ForbiddenCursor @@ -638,12 +648,12 @@ - 所属部门: + 使用部门: - + ForbiddenCursor @@ -657,14 +667,14 @@ - + - 负责人: + 设备分类: - + ForbiddenCursor @@ -678,14 +688,14 @@ - + - 设备供方: + 检定周期: - + ForbiddenCursor @@ -699,14 +709,14 @@ - + - 位置信息: + 重要等级: - + ForbiddenCursor @@ -720,140 +730,14 @@ - - - 设备类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 标准类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 设备分类: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 重要等级: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 检定周期: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 对应开箱记录: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - 备注: - - + + ForbiddenCursor @@ -892,7 +776,7 @@ - + diff --git a/softwareDirectory/AutoVerScheme/create_task.cpp b/softwareDirectory/AutoVerScheme/create_task.cpp index 9b49a1a..ddd78ef 100644 --- a/softwareDirectory/AutoVerScheme/create_task.cpp +++ b/softwareDirectory/AutoVerScheme/create_task.cpp @@ -2,12 +2,15 @@ #include "ui_create_task.h" #include "QMessageBox" + + QString Create_Task::State=""; Create_Task::Create_Task(QWidget *parent) : InfoBase(parent), ui(new Ui::Create_Task) { ui->setupUi(this); this->initForm(); + } Create_Task::~Create_Task() @@ -25,17 +28,19 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(8); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(9); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "任务单编号" << "委托方"<< "使用部门" << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; + headers <<"ID"<< "序号" << "任务单编号" << "委托方"<< "使用部门" + << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); //ShowMessageBox("标题","初始化完成"); } @@ -57,5 +62,171 @@ } void Create_Task::Load() { - //ShowMessageBox("创建任务界面","创建任务界面初始化完成"); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + + QList data = BaseCommonApi::getCreateTaskList(""); + + int rowCount = 0; + int row=0; + QString is_urgent; + for (const CreateTaskList& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.order_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.customer_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.DEPT_FULL_NAME)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.require_over_time.toString())); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.deliverer)); + if(item.is_urgent=="1") + is_urgent="是"; + else + is_urgent="否"; + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(is_urgent)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("查看"); + QPushButton *button2 = new QPushButton("编辑"); + QPushButton *button3 = new QPushButton("删除"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + Create_Task::State="Select"; + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonUpdateClicked(id); + Create_Task::State="Update"; + } + + }); + //设置按钮3简单样式 + button3->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: red; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button3->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button3, &QPushButton::clicked, this, [this, button3, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtoDeleteClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->addWidget(button3); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 8, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void Create_Task::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + HiddenButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "查看按钮ID",id); +} +void Create_Task::OnButtonUpdateClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "编辑按钮ID",id); +} +void Create_Task::OnButtoDeleteClicked(QString id) +{ + // ======================================================================================== + // 删除按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + + QMessageBox::information(this, "删除按钮ID",id); +} + +void Create_Task::on_pushButton_2_clicked() +{ + // ======================================================================================== + // 创建任务单按钮 + // ==================================================================================== + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + Create_Task::State="Create"; +} +void Create_Task::HiddenButton() +{ + ui->SaveButton->hide(); + ui->CreateButton->hide(); + ui->ScanButton->hide(); + ui->deletebutton->hide(); +} +void Create_Task::DisplayButton() +{ + ui->SaveButton->show(); + ui->CreateButton->show(); + ui->ScanButton->show(); + ui->deletebutton->show(); +} + +void Create_Task::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/create_task.h b/softwareDirectory/AutoVerScheme/create_task.h index 7cf383f..6b67c7c 100644 --- a/softwareDirectory/AutoVerScheme/create_task.h +++ b/softwareDirectory/AutoVerScheme/create_task.h @@ -16,11 +16,22 @@ explicit Create_Task(QWidget *parent = nullptr); ~Create_Task(); + //全局静态变量 + static QString State; private slots: void initForm(); //初始化界面数据 void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonUpdateClicked(QString id); + void OnButtoDeleteClicked(QString id); + void on_pushButton_2_clicked(); + void HiddenButton(); + void DisplayButton(); + + void on_pushButton_clicked(); + private: Ui::Create_Task *ui; }; diff --git a/softwareDirectory/AutoVerScheme/create_task.ui b/softwareDirectory/AutoVerScheme/create_task.ui index d9d88ed..b45af33 100644 --- a/softwareDirectory/AutoVerScheme/create_task.ui +++ b/softwareDirectory/AutoVerScheme/create_task.ui @@ -19,278 +19,651 @@ - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 1 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 任务单编号: - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - 委托方: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 使用部门: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 要求完成时间: - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(3, 58, 132); + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 任务单编号: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 委托方: + + + + + + + + + + 使用部门: + + + + + + + + + + 要求检完时间: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); color:white; - - - 查询 - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(207, 132, 33); + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); color:white; - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - 6 + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + 3 + + + + + + 50 + 40 + + + + + 100 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 创建任务单 + + + + + + + + + + + + + + + + + + + + + color:black; - - 9 - - - 9 - - - 9 - - - - - - 0 - 0 - - - - - 120 - 40 - - - - OpenHandCursor - - - Qt::DefaultContextMenu - - - Qt::RightToLeft - - - false - - - background-color:rgb(9, 89, 179); + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 创建任务单 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 保存 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; color:white; - - - 创建任务单 - - - true - - - - - - - - - - - - - - SizeVerCursor - - - - - - - + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接人: + + + + + + + 要求检完时间: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 是否加急: + + + + + + + 电话: + + + + + + + 委托方: + + + + + + + 任务单编号: + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接时间: + + + + + + + 送检人: + + + + + + + 接收说明: + + + + + + + 使用部门: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + 任务单列表: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 扫描增加 + + + false + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 增加行 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 删除行 + + + + + + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/depar_task.ui b/softwareDirectory/AutoVerScheme/depar_task.ui index efb7561..f44829d 100644 --- a/softwareDirectory/AutoVerScheme/depar_task.ui +++ b/softwareDirectory/AutoVerScheme/depar_task.ui @@ -213,86 +213,6 @@ - - - 12 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - diff --git a/softwareDirectory/AutoVerScheme/infomanageview.ui b/softwareDirectory/AutoVerScheme/infomanageview.ui index ef0b87b..cb76a28 100644 --- a/softwareDirectory/AutoVerScheme/infomanageview.ui +++ b/softwareDirectory/AutoVerScheme/infomanageview.ui @@ -20,7 +20,7 @@ color:black; background-color:rgba(240, 240, 240, 1); - + 0 @@ -37,77 +37,124 @@ 0 - - - - 0 - 0 - - - - - 170 - 0 - - - - - 16777215 - 16777215 - - + - color:White; - font-weight: bold; - font-size: 16px; -background-color:rgba(10, 15, 92, 1); + border-image: url(:/image/Index/u15.png); - - true - - - - - 0 - 0 - 170 - 625 - - - - - 0 - 0 - - - - - 170 - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - + + + + + + 50 + 50 + + + + + 35 + 35 + + + + image: url(:/image/Index/u2158.svg); + + + + + + + + + + color:white; +font-size:18px; +font-weight:bold; + + + 信息管理 + + + + - + + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 16777215 + 16777215 + + + + color:White; + font-weight: bold; + font-size: 16px; +background-color:rgba(10, 15, 92, 1); + + + true + + + + + 0 + 0 + 170 + 570 + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/InfoBase.h b/softwareDirectory/AutoVerScheme/InfoBase.h index 6dd59f3..bce9609 100644 --- a/softwareDirectory/AutoVerScheme/InfoBase.h +++ b/softwareDirectory/AutoVerScheme/InfoBase.h @@ -4,6 +4,7 @@ #include #include "QStandardItemModel" #include "databaseconnection.h" +#include "basecommonapi.h" ///信号管理页面的基类 所有信息管理页面都继承于InfoBase /// 便于统一管理 所有子类必须实现Load方法 /// 每次按钮点击切换都会调用Load方法 用于每次页面的数据刷新 @@ -16,7 +17,7 @@ //QStandardItemModel 的实例。这个模型将用于存储和管理数据。 QStandardItemModel *model; //信息管理页面 基类定义Conn对象 - DatabaseConnection *Conn=DatabaseConnection::getInstance(); + BaseCommonApi dbManager; }; #endif // INFOBASE_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index f62915b..6170ee7 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -15,7 +15,7 @@ " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id " " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID " " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID " - " WHERE sys_user.ID = ' :userId '"); + " WHERE sys_user.ID = :userId"); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -75,6 +75,35 @@ } return result; } + +//获取创建任务首页数据 +QList BaseCommonApi::getCreateTaskList(QString userId) +{ + userId="1640229293790650370"; + QList result; + QSqlQuery query; + query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " + " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " + " WHERE bi.create_user_id = :userId"); + // 将参数绑定到占位符 + query.bindValue(":userId", userId); + if (query.exec()) { + while (query.next()) { + CreateTaskList task; + task.id = query.value("id").toString(); + task.order_no = query.value("order_no").toString(); + task.customer_name = query.value("customer_name").toString(); + task.DEPT_FULL_NAME = query.value("FULL_NAME").toString(); + task.require_over_time = query.value("require_over_time").toDateTime(); + task.deliverer = query.value("deliverer").toString(); + task.is_urgent = query.value("is_urgent").toString(); + result.append(task); + } + } else { + qDebug() << "Query execution failed: " << query.lastError().text(); + } + return result; +} //获取创建任务首页数据 QListgetCreateTaskList(QString userId) { @@ -82,7 +111,7 @@ QSqlQuery query; query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " - " WHERE bi.create_user_id = ':userId' "); + " WHERE bi.create_user_id = :userId "); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -103,6 +132,7 @@ return result; } + //创建任务单-查看/编辑 顶部数据 传参该条数据的id QListBaseCommonApi::getCatTask(QString id) { @@ -111,7 +141,7 @@ query.prepare("SELECT bi.order_no ,bi.customer_name ,dept.FULL_NAME ,bi.require_over_time ," " bi.deliverer ,bi.deliverer_tel ,bi.undertaker_name ,bi.undertake_time , bi.is_urgent AS ," " bi.receive_illustrate FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID" - " WHERE bi.id = ' :id '"); + " WHERE bi.id = :id "); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -140,6 +170,7 @@ //获取创建任务 -任务单列表 + QListBaseCommonApi::getCatTaskList(QString orderId) { QList result; @@ -380,6 +411,7 @@ QListBaseCommonApi::getCheckDCPower(QString equipment_id,QStringList *headList) { + equipment_id="1693435753272557570"; QList result; QSqlQuery query; query.prepare("SELECT besciddp.id ,besciddp.params,besciddp.unit,resolution,besciddp.urel,besciddp.check_type,datum_point,cycle_number " @@ -407,9 +439,11 @@ } else { qDebug() << "Query execution failed: " << query.lastError().text(); } + *headList <<"序号"<<"核查项目"<<"核查点"<<"单位"<<"分辨力"<<"Urel"<<"核查类型"<<"是否为基准点(1/0)"<<"循环次数" <<"电阻值/频率"<<"电阻值单位/频率单位"<<"核查项备注"; + return result; } //根据id获取装置名称 @@ -436,9 +470,9 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " - " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id " - " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); +bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " + " JOIN sys_dept ON sys_dept.ID = eei.dept_id " + " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); if (isSuccess) { while (query.next()) { TestedDevice testedDevice; @@ -504,9 +538,10 @@ //判断 哪个 装置表 传参 设备id QList BaseCommonApi::getJudgeCalibrationTable(QString id) { + id="1716997603953311746"; QList result; QSqlQuery query; - query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = ':id')"); + query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = :id )"); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -526,12 +561,55 @@ return result; } +//标准装置字典类型 +/** + * 多功能校准源标准装置 = 1 + * 直流稳压电源检定装置 = 2 + * 多功能电气安全校准器标准装置 = 3 + * 0.02级活塞式压力计标准装置 = 4 + * 二等铂电阻温度计标准装置 = 5 + * 安全阀校验装置 = 6 + * 精密露点仪标准装置 = 7 + * E2等级砝码标准装置 = 8 + * 频谱分析仪标准装置 = 9 + * 信号发生器标准装置 = 10 + * 微波衰减标准装置 = 11 + * 频率短期稳定度标准装置 =12 + * 示波器标准装置 = 13 + * 铯原子频率标准装置 =14 + * 小功率标准装置 = 15 + * 低频信号发生器标准装置 = 16 + * S参数标准装置 = 17 + * 失真度标准装置 = 18 + */ +//根据被检设备ID获取当前设备的 核查项目及核查点 + +QList BaseCommonApi::Search_CalibrationTable(QString DeiverId,QStringList *HeadList) +{ + + QList DataList; + DataList.clear(); + QList CliTable=BaseCommonApi::getJudgeCalibrationTable(DeiverId); + if(CliTable.count()==0)return DataList; + switch (CliTable[0].belong_standard_equipment.toInt()) + { + case 1: + + //CliTable[0].item_category_id + DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList); + break; + } + + return DataList; +} //被检设备管理-检定项目及检定点-多功能校准源 -QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) +QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) { -QList result; +QList resultData; +QStringList result; +resultData.clear(); QSqlQuery query; query.prepare("SELECT bbdmidc.id ,bbdmidc.params ,bbdmidc.capacity ,bbdmidc.unit ,bbdmidc.frequency , bbdmidc.range_range , bbdmidc.standard_value , bbdmidc.resolution , bbdmidc.maximum_error , bbdmidc.error_param_a , bbdmidc.error_param_b " @@ -542,26 +620,24 @@ if (query.exec()) { while (query.next()) { - VerMultiCal calibration; - calibration.id = query.value("id").toString(); - calibration.params = query.value("params").toString(); - calibration.capacity = query.value("capacity").toString(); - calibration.unit = query.value("unit").toString(); - calibration.frequency = query.value("frequency").toString(); - calibration.range_range = query.value("range_range").toString(); - calibration.standard_value = query.value("standard_value").toString(); - calibration.resolution = query.value("resolution").toString(); - calibration.maximum_error = query.value("maximum_error").toString(); - calibration.error_param_a = query.value("error_param_a").toString(); - calibration.error_param_b = query.value("error_param_b").toString(); - - result.append(calibration); + result.clear(); + result.append(query.value("id").toString()); + result.append(query.value("params").toString()); + result.append(query.value("capacity").toString()); + result.append(query.value("unit").toString()); + result.append(query.value("frequency").toString()); + result.append(query.value("range_range").toString()); + result.append(query.value("standard_value").toString()); + result.append(query.value("resolution").toString()); + result.append(query.value("maximum_error").toString()); + result.append(query.value("error_param_a").toString()); + result.append(query.value("error_param_b").toString()); + resultData.append(result); } } else { qDebug() << "Query execution failed: " << query.lastError().text(); } - *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; - return result; + *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; } //检定数据管理 首页 @@ -757,7 +833,7 @@ " LEFT JOIN biz_equipment_standard_check_info besci ON besci.item_category_id = bescidc.item_category_id " " WHERE bescidc.equipment_id = :equipment_id "); - // 将参数绑定到占位符 '1692796512381222914' + // 将参数绑定到占位符 1692796512381222914 query.bindValue(":equipment_id", equipment_id); if (query.exec()) { while (query.next()) { @@ -788,12 +864,13 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " + bool isSuccess = query.exec("SELECT brtf.id,brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " " FROM biz_resource_technique_file brtf"); if (isSuccess) { while (query.next()) { Technique_File file; + file.id=query.value("id").toString(); file.file_distribute_no = query.value("file_distribute_no").toString(); file.file_name = query.value("file_name").toString(); file.version_no = query.value("version_no").toString(); @@ -876,7 +953,7 @@ QList result; QSqlQuery query; query.prepare("SELECT id,device_id ,communication_type ,serial_port ,visa ,create_time ,update_time " - "FROM zd_communication_setting WHERE device_id = ' :deviceId '"); + "FROM zd_communication_setting WHERE device_id = :deviceId "); query.bindValue(":deviceId", deviceId); if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h index 1b70cb9..ff8a320 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.h +++ b/softwareDirectory/AutoVerScheme/basecommonapi.h @@ -9,7 +9,7 @@ #include "databaseconnection.h" #include "id\IdWorker.h" - +#include "QStringList" //部门任务 @@ -52,6 +52,7 @@ QDateTime require_over_time; QString deliverer; QString is_urgent; + }; //创建任务单-查看任务单 class CatTask @@ -241,9 +242,15 @@ QString belong_standard_equipment; }; +class BaseEntity: public QObject +{ + Q_OBJECT + public: + +}; //被检设备管理-检定项目及检定点-检定项多功能校准源 -class VerMultiCal +class VerMultiCal:public BaseEntity { public: QString id; @@ -365,6 +372,7 @@ class Technique_File { public: + QString id; QString file_distribute_no; QString file_name; QString version_no; @@ -444,12 +452,22 @@ public: BaseCommonApi(); + // + static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList); + //部门任务 + static QList getAllData(); + //部门任务 参数登录用户的id static QList getAllData(QString userId); + //我的任务 static QList getMyTasks(QString id); //获取创建任务首页数据 - static QListgetCreateTaskList(QString id); + + static QListgetCreateTaskList(QString userId); + + + //创建任务-查看任务单顶部 static QListgetCatTask(QString orderNo); //创建任务-查看任务列表底部 @@ -479,7 +497,10 @@ //判断 哪个 装置表 传参 设备id 返回itemId static QList getJudgeCalibrationTable(QString id); //被检设备管理-检定项目及检定点-多功能校准源 - static QList getVerMultiCal(QString itemId,QStringList *headList); + + + static QList getVerMultiCal(QString itemId,QStringList *headList); + // 获取检定数据管理 首页 static QList getVerificationData(); // 检定数据管理-检定基本信息 @@ -494,6 +515,7 @@ static QList getCheckDataManageResultManageMult(QString equipment_id); //技术文件 static QList getTechnique_File(); + //检定程序管理首页查询 static QList getVerificationProgramInfoMain(); //检定程序管理 编辑 @@ -525,7 +547,6 @@ IdWorker &idWorker = Singleton::instance(); //自动检定 - }; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp index c3b2786..70148f4 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp @@ -4,6 +4,7 @@ #include "basecommonapi.h" //#include "tested_device_manage_serve.h" +#include "QStringList" //被检设备 BeExamined_DeviceItem::BeExamined_DeviceItem(QWidget *parent) : @@ -32,19 +33,32 @@ "}"); // ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); // item->setTextAlignment(Qt::AlignCenter); //ui->tableWidget->setItem(0, 0, item); //设置数据 - + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" + headers << "ID" << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" << "生产厂家"<<"所在单位" <<"使用部门"<<"计量标识"<<"检定周期"<<"证书有效期"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); + //详情页面tableWidgetItem设置 + ui->tableWidgetItem->setStyleSheet("QHeaderView::section {" + "border: 1px solid rgba(197, 196, 196, 1);" + "border-left:none;" + "border-top:none;" + "background-color:white;" + "}"); + + // ui->tableWidget->setRowCount(10); // 设置10行 + //ui->tableWidgetItem->setColumnCount(14); // 设置11列 + ui->tableWidgetItem->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 + ui->tableWidgetItem->verticalHeader()->setParent(nullptr); //隐藏行头 + } void BeExamined_DeviceItem::ShowMessageBox(QString title,QString value) { // 创建一个QMessageBox对象 @@ -64,24 +78,19 @@ } void BeExamined_DeviceItem::Load() { - //获取主页面内容 - //进入主页面 - /* - ui->stackedWidget->setCurrentIndex(0); + // ======================================================================================== + // 主页面初始化 + // ==================================================================================== + + + ui->stackedWidget->setCurrentIndex(0); //先设置为行为0 ui->tableWidget->setRowCount(0); - - - // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BeExamined_DeviceItem dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; int row=0; - QList data = dbManager.getBizDeviceManage(); - - - for (const BizDevice& bizDevice : data) { + QList data = dbManager.getTestedDevice(); + for (const TestedDevice& bizDevice : data) { rowCount = ui->tableWidget->rowCount(); ui->tableWidget->insertRow(rowCount); @@ -89,34 +98,118 @@ ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); ui->tableWidget->setItem(row, 2, new QTableWidgetItem(bizDevice.equipment_name)); ui->tableWidget->setItem(row, 3, new QTableWidgetItem(bizDevice.model)); - ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacture_no)); - ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.help_instruction)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacture_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(bizDevice.FULL_NAME)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(bizDevice.meter_identify)); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem(bizDevice.check_cycle)); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(bizDevice.certificate_valid)); + //添加操作按钮 QPushButton *button = new QPushButton("查看"); - ui->tableWidget->setCellWidget(row, 6, button); + ui->tableWidget->setCellWidget(row, 12, button); //设置按钮简单样式 button->setStyleSheet("QPushButton {" - " border: none; /* 无边框 "*/ - // " color: green; /* 文本颜色 */" - // " text-decoration: underline; /* 文本下划线 */" - // "}"); + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); // 设置鼠标悬停时的光标样式为小手图标 - // button->setCursor(Qt::PointingHandCursor); + button->setCursor(Qt::PointingHandCursor); // 连接按钮的 clicked 信号到自定义槽函数 - // connect(button, &QPushButton::clicked, this, [this, button, row]() { - // 获取当前行第一列的 ID - // QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); - // if (idItem) { - // QString id = idItem->text(); -// - // OnButtonSelectClicked(id); - // } + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); - // }); + OnButtonSelectClicked(id); + } - // row++; - - // } + }); + row++; + } } +void BeExamined_DeviceItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + + DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +//返回按钮 +void BeExamined_DeviceItem::on_pushButton_2_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); +} +void BeExamined_DeviceItem::DeviceInfoInit(QString id) +{ + // ======================================================================================== + // 初始化详情 + // ==================================================================================== + + QList data = dbManager.getTestedCatDevice(id); + for (const TestedCatDevice& testedCatDevice : data) { + + ui->equipment_name->setText(testedCatDevice.equipment_name); + ui->model->setText(testedCatDevice.model); + ui->help_instruction->setText(testedCatDevice.help_instruction); + ui->manufacture_no->setText(testedCatDevice.manufacture_no); + ui->product_country->setText(testedCatDevice.product_country); + ui->manufacturer->setText(testedCatDevice.manufacturer); + ui->product_date->setText(testedCatDevice.product_date); + ui->purchase_date->setText(testedCatDevice.purchase_date); + ui->unit_price->setText(testedCatDevice.unit_price); + ui->usage_status->setText(testedCatDevice.usage_status); + ui->quality_condition->setText(testedCatDevice.quality_condition); + ui->dept_name->setText(testedCatDevice.FULL_NAME); + ui->category->setText(testedCatDevice.category); + ui->check_cycle->setText(testedCatDevice.check_cycle); + ui->level->setText(testedCatDevice.level); + ui->remark->setText(testedCatDevice.remark); + } + + + // ======================================================================================== + // 初始化检定项目及核查点 + // ==================================================================================== + + //获取核查点tablewight的数据 + QStringList headlist; + + QList Data=dbManager.Search_CalibrationTable(id,&headlist); + + //tableWidgetItem + ui->tableWidgetItem->setRowCount(0); + ui->tableWidgetItem->setColumnCount(headlist.count()); + ui->tableWidgetItem->setHorizontalHeaderLabels(headlist); + //循环数据 + int rowCount=0; + int row=0; + ; + for (const QStringList& item : Data) + { + //获取行号 并进行添加行 + rowCount = ui->tableWidgetItem->rowCount(); + ui->tableWidgetItem->insertRow(rowCount); + //添加 序号 + ui->tableWidgetItem->setItem(row, 0, new QTableWidgetItem(QString::number(row+1))); + //循环读取值 headlist,count是列的数量 + for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型 + } + + row++; + + } +} + + + diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h index ffdc22a..0050ee7 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h @@ -21,6 +21,11 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + + void DeviceInfoInit(QString id); + + void on_pushButton_2_clicked(); private: Ui::BeExamined_DeviceItem *ui; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui index ce63879..cdacfaf 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui @@ -215,6 +215,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -225,6 +230,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 @@ -391,7 +401,7 @@ - + ForbiddenCursor @@ -412,7 +422,7 @@ - + ForbiddenCursor @@ -428,12 +438,12 @@ - 出厂编号: + 辅助字段: - + ForbiddenCursor @@ -449,12 +459,12 @@ - 检定有效期: + 出厂编号: - + ForbiddenCursor @@ -475,7 +485,7 @@ - + ForbiddenCursor @@ -496,7 +506,7 @@ - + ForbiddenCursor @@ -517,7 +527,7 @@ - + ForbiddenCursor @@ -538,7 +548,7 @@ - + ForbiddenCursor @@ -552,14 +562,14 @@ - + - 使用年限: + 设备单价: - + ForbiddenCursor @@ -573,14 +583,14 @@ - + - 设备单价: + 使用状态: - + ForbiddenCursor @@ -594,14 +604,14 @@ - + - 使用状态: + 质量状况: - + ForbiddenCursor @@ -615,14 +625,14 @@ - + - 质量状况: + 所在单位: - + ForbiddenCursor @@ -638,12 +648,12 @@ - 所属部门: + 使用部门: - + ForbiddenCursor @@ -657,14 +667,14 @@ - + - 负责人: + 设备分类: - + ForbiddenCursor @@ -678,14 +688,14 @@ - + - 设备供方: + 检定周期: - + ForbiddenCursor @@ -699,14 +709,14 @@ - + - 位置信息: + 重要等级: - + ForbiddenCursor @@ -720,140 +730,14 @@ - - - 设备类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 标准类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 设备分类: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 重要等级: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 检定周期: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 对应开箱记录: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - 备注: - - + + ForbiddenCursor @@ -892,7 +776,7 @@ - + diff --git a/softwareDirectory/AutoVerScheme/create_task.cpp b/softwareDirectory/AutoVerScheme/create_task.cpp index 9b49a1a..ddd78ef 100644 --- a/softwareDirectory/AutoVerScheme/create_task.cpp +++ b/softwareDirectory/AutoVerScheme/create_task.cpp @@ -2,12 +2,15 @@ #include "ui_create_task.h" #include "QMessageBox" + + QString Create_Task::State=""; Create_Task::Create_Task(QWidget *parent) : InfoBase(parent), ui(new Ui::Create_Task) { ui->setupUi(this); this->initForm(); + } Create_Task::~Create_Task() @@ -25,17 +28,19 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(8); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(9); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "任务单编号" << "委托方"<< "使用部门" << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; + headers <<"ID"<< "序号" << "任务单编号" << "委托方"<< "使用部门" + << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); //ShowMessageBox("标题","初始化完成"); } @@ -57,5 +62,171 @@ } void Create_Task::Load() { - //ShowMessageBox("创建任务界面","创建任务界面初始化完成"); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + + QList data = BaseCommonApi::getCreateTaskList(""); + + int rowCount = 0; + int row=0; + QString is_urgent; + for (const CreateTaskList& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.order_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.customer_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.DEPT_FULL_NAME)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.require_over_time.toString())); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.deliverer)); + if(item.is_urgent=="1") + is_urgent="是"; + else + is_urgent="否"; + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(is_urgent)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("查看"); + QPushButton *button2 = new QPushButton("编辑"); + QPushButton *button3 = new QPushButton("删除"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + Create_Task::State="Select"; + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonUpdateClicked(id); + Create_Task::State="Update"; + } + + }); + //设置按钮3简单样式 + button3->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: red; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button3->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button3, &QPushButton::clicked, this, [this, button3, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtoDeleteClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->addWidget(button3); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 8, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void Create_Task::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + HiddenButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "查看按钮ID",id); +} +void Create_Task::OnButtonUpdateClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "编辑按钮ID",id); +} +void Create_Task::OnButtoDeleteClicked(QString id) +{ + // ======================================================================================== + // 删除按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + + QMessageBox::information(this, "删除按钮ID",id); +} + +void Create_Task::on_pushButton_2_clicked() +{ + // ======================================================================================== + // 创建任务单按钮 + // ==================================================================================== + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + Create_Task::State="Create"; +} +void Create_Task::HiddenButton() +{ + ui->SaveButton->hide(); + ui->CreateButton->hide(); + ui->ScanButton->hide(); + ui->deletebutton->hide(); +} +void Create_Task::DisplayButton() +{ + ui->SaveButton->show(); + ui->CreateButton->show(); + ui->ScanButton->show(); + ui->deletebutton->show(); +} + +void Create_Task::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/create_task.h b/softwareDirectory/AutoVerScheme/create_task.h index 7cf383f..6b67c7c 100644 --- a/softwareDirectory/AutoVerScheme/create_task.h +++ b/softwareDirectory/AutoVerScheme/create_task.h @@ -16,11 +16,22 @@ explicit Create_Task(QWidget *parent = nullptr); ~Create_Task(); + //全局静态变量 + static QString State; private slots: void initForm(); //初始化界面数据 void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonUpdateClicked(QString id); + void OnButtoDeleteClicked(QString id); + void on_pushButton_2_clicked(); + void HiddenButton(); + void DisplayButton(); + + void on_pushButton_clicked(); + private: Ui::Create_Task *ui; }; diff --git a/softwareDirectory/AutoVerScheme/create_task.ui b/softwareDirectory/AutoVerScheme/create_task.ui index d9d88ed..b45af33 100644 --- a/softwareDirectory/AutoVerScheme/create_task.ui +++ b/softwareDirectory/AutoVerScheme/create_task.ui @@ -19,278 +19,651 @@ - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 1 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 任务单编号: - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - 委托方: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 使用部门: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 要求完成时间: - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(3, 58, 132); + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 任务单编号: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 委托方: + + + + + + + + + + 使用部门: + + + + + + + + + + 要求检完时间: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); color:white; - - - 查询 - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(207, 132, 33); + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); color:white; - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - 6 + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + 3 + + + + + + 50 + 40 + + + + + 100 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 创建任务单 + + + + + + + + + + + + + + + + + + + + + color:black; - - 9 - - - 9 - - - 9 - - - - - - 0 - 0 - - - - - 120 - 40 - - - - OpenHandCursor - - - Qt::DefaultContextMenu - - - Qt::RightToLeft - - - false - - - background-color:rgb(9, 89, 179); + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 创建任务单 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 保存 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; color:white; - - - 创建任务单 - - - true - - - - - - - - - - - - - - SizeVerCursor - - - - - - - + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接人: + + + + + + + 要求检完时间: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 是否加急: + + + + + + + 电话: + + + + + + + 委托方: + + + + + + + 任务单编号: + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接时间: + + + + + + + 送检人: + + + + + + + 接收说明: + + + + + + + 使用部门: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + 任务单列表: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 扫描增加 + + + false + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 增加行 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 删除行 + + + + + + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/depar_task.ui b/softwareDirectory/AutoVerScheme/depar_task.ui index efb7561..f44829d 100644 --- a/softwareDirectory/AutoVerScheme/depar_task.ui +++ b/softwareDirectory/AutoVerScheme/depar_task.ui @@ -213,86 +213,6 @@ - - - 12 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - diff --git a/softwareDirectory/AutoVerScheme/infomanageview.ui b/softwareDirectory/AutoVerScheme/infomanageview.ui index ef0b87b..cb76a28 100644 --- a/softwareDirectory/AutoVerScheme/infomanageview.ui +++ b/softwareDirectory/AutoVerScheme/infomanageview.ui @@ -20,7 +20,7 @@ color:black; background-color:rgba(240, 240, 240, 1); - + 0 @@ -37,77 +37,124 @@ 0 - - - - 0 - 0 - - - - - 170 - 0 - - - - - 16777215 - 16777215 - - + - color:White; - font-weight: bold; - font-size: 16px; -background-color:rgba(10, 15, 92, 1); + border-image: url(:/image/Index/u15.png); - - true - - - - - 0 - 0 - 170 - 625 - - - - - 0 - 0 - - - - - 170 - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - + + + + + + 50 + 50 + + + + + 35 + 35 + + + + image: url(:/image/Index/u2158.svg); + + + + + + + + + + color:white; +font-size:18px; +font-weight:bold; + + + 信息管理 + + + + - + + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 16777215 + 16777215 + + + + color:White; + font-weight: bold; + font-size: 16px; +background-color:rgba(10, 15, 92, 1); + + + true + + + + + 0 + 0 + 170 + 570 + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp index efc00ba..eea27f0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp @@ -25,17 +25,17 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 - + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0,0); //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "出厂编号" + headers <<"ID"<< "序号" << "设备名称" << "型号规则" << "出厂编号" <<"核查件名称"<<"核查件型号"<<"核查件编号" <<"核查员" << "核查日期" <<"实验室"<<"部门"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); @@ -58,5 +58,114 @@ } void InspectDataItem::Load() { - //ShowMessageBox("核查数据","核查数据"); + // ======================================================================================== + // 主页面初始化 核查管理初始化 + // ==================================================================================== + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + // 调用数据库管理器的函数获取数据 + int rowCount=0; + int row=0; + QList data = dbManager.getCheckData(); + for (const CheckData& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.equipment_name)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.model)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.manufacture_no)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.meter_standard_name)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(item.meter_standard_id)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(item.create_user_name)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(item.check_date.toString())); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(item.dept_name)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("详情"); + QPushButton *button2 = new QPushButton("预览"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonPreViewtClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 12, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void InspectDataItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +void InspectDataItem::OnButtonPreViewtClicked(QString id) +{ + // ======================================================================================== + // 预览按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} + +void InspectDataItem::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/InfoBase.h b/softwareDirectory/AutoVerScheme/InfoBase.h index 6dd59f3..bce9609 100644 --- a/softwareDirectory/AutoVerScheme/InfoBase.h +++ b/softwareDirectory/AutoVerScheme/InfoBase.h @@ -4,6 +4,7 @@ #include #include "QStandardItemModel" #include "databaseconnection.h" +#include "basecommonapi.h" ///信号管理页面的基类 所有信息管理页面都继承于InfoBase /// 便于统一管理 所有子类必须实现Load方法 /// 每次按钮点击切换都会调用Load方法 用于每次页面的数据刷新 @@ -16,7 +17,7 @@ //QStandardItemModel 的实例。这个模型将用于存储和管理数据。 QStandardItemModel *model; //信息管理页面 基类定义Conn对象 - DatabaseConnection *Conn=DatabaseConnection::getInstance(); + BaseCommonApi dbManager; }; #endif // INFOBASE_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index f62915b..6170ee7 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -15,7 +15,7 @@ " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id " " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID " " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID " - " WHERE sys_user.ID = ' :userId '"); + " WHERE sys_user.ID = :userId"); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -75,6 +75,35 @@ } return result; } + +//获取创建任务首页数据 +QList BaseCommonApi::getCreateTaskList(QString userId) +{ + userId="1640229293790650370"; + QList result; + QSqlQuery query; + query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " + " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " + " WHERE bi.create_user_id = :userId"); + // 将参数绑定到占位符 + query.bindValue(":userId", userId); + if (query.exec()) { + while (query.next()) { + CreateTaskList task; + task.id = query.value("id").toString(); + task.order_no = query.value("order_no").toString(); + task.customer_name = query.value("customer_name").toString(); + task.DEPT_FULL_NAME = query.value("FULL_NAME").toString(); + task.require_over_time = query.value("require_over_time").toDateTime(); + task.deliverer = query.value("deliverer").toString(); + task.is_urgent = query.value("is_urgent").toString(); + result.append(task); + } + } else { + qDebug() << "Query execution failed: " << query.lastError().text(); + } + return result; +} //获取创建任务首页数据 QListgetCreateTaskList(QString userId) { @@ -82,7 +111,7 @@ QSqlQuery query; query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " - " WHERE bi.create_user_id = ':userId' "); + " WHERE bi.create_user_id = :userId "); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -103,6 +132,7 @@ return result; } + //创建任务单-查看/编辑 顶部数据 传参该条数据的id QListBaseCommonApi::getCatTask(QString id) { @@ -111,7 +141,7 @@ query.prepare("SELECT bi.order_no ,bi.customer_name ,dept.FULL_NAME ,bi.require_over_time ," " bi.deliverer ,bi.deliverer_tel ,bi.undertaker_name ,bi.undertake_time , bi.is_urgent AS ," " bi.receive_illustrate FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID" - " WHERE bi.id = ' :id '"); + " WHERE bi.id = :id "); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -140,6 +170,7 @@ //获取创建任务 -任务单列表 + QListBaseCommonApi::getCatTaskList(QString orderId) { QList result; @@ -380,6 +411,7 @@ QListBaseCommonApi::getCheckDCPower(QString equipment_id,QStringList *headList) { + equipment_id="1693435753272557570"; QList result; QSqlQuery query; query.prepare("SELECT besciddp.id ,besciddp.params,besciddp.unit,resolution,besciddp.urel,besciddp.check_type,datum_point,cycle_number " @@ -407,9 +439,11 @@ } else { qDebug() << "Query execution failed: " << query.lastError().text(); } + *headList <<"序号"<<"核查项目"<<"核查点"<<"单位"<<"分辨力"<<"Urel"<<"核查类型"<<"是否为基准点(1/0)"<<"循环次数" <<"电阻值/频率"<<"电阻值单位/频率单位"<<"核查项备注"; + return result; } //根据id获取装置名称 @@ -436,9 +470,9 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " - " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id " - " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); +bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " + " JOIN sys_dept ON sys_dept.ID = eei.dept_id " + " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); if (isSuccess) { while (query.next()) { TestedDevice testedDevice; @@ -504,9 +538,10 @@ //判断 哪个 装置表 传参 设备id QList BaseCommonApi::getJudgeCalibrationTable(QString id) { + id="1716997603953311746"; QList result; QSqlQuery query; - query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = ':id')"); + query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = :id )"); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -526,12 +561,55 @@ return result; } +//标准装置字典类型 +/** + * 多功能校准源标准装置 = 1 + * 直流稳压电源检定装置 = 2 + * 多功能电气安全校准器标准装置 = 3 + * 0.02级活塞式压力计标准装置 = 4 + * 二等铂电阻温度计标准装置 = 5 + * 安全阀校验装置 = 6 + * 精密露点仪标准装置 = 7 + * E2等级砝码标准装置 = 8 + * 频谱分析仪标准装置 = 9 + * 信号发生器标准装置 = 10 + * 微波衰减标准装置 = 11 + * 频率短期稳定度标准装置 =12 + * 示波器标准装置 = 13 + * 铯原子频率标准装置 =14 + * 小功率标准装置 = 15 + * 低频信号发生器标准装置 = 16 + * S参数标准装置 = 17 + * 失真度标准装置 = 18 + */ +//根据被检设备ID获取当前设备的 核查项目及核查点 + +QList BaseCommonApi::Search_CalibrationTable(QString DeiverId,QStringList *HeadList) +{ + + QList DataList; + DataList.clear(); + QList CliTable=BaseCommonApi::getJudgeCalibrationTable(DeiverId); + if(CliTable.count()==0)return DataList; + switch (CliTable[0].belong_standard_equipment.toInt()) + { + case 1: + + //CliTable[0].item_category_id + DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList); + break; + } + + return DataList; +} //被检设备管理-检定项目及检定点-多功能校准源 -QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) +QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) { -QList result; +QList resultData; +QStringList result; +resultData.clear(); QSqlQuery query; query.prepare("SELECT bbdmidc.id ,bbdmidc.params ,bbdmidc.capacity ,bbdmidc.unit ,bbdmidc.frequency , bbdmidc.range_range , bbdmidc.standard_value , bbdmidc.resolution , bbdmidc.maximum_error , bbdmidc.error_param_a , bbdmidc.error_param_b " @@ -542,26 +620,24 @@ if (query.exec()) { while (query.next()) { - VerMultiCal calibration; - calibration.id = query.value("id").toString(); - calibration.params = query.value("params").toString(); - calibration.capacity = query.value("capacity").toString(); - calibration.unit = query.value("unit").toString(); - calibration.frequency = query.value("frequency").toString(); - calibration.range_range = query.value("range_range").toString(); - calibration.standard_value = query.value("standard_value").toString(); - calibration.resolution = query.value("resolution").toString(); - calibration.maximum_error = query.value("maximum_error").toString(); - calibration.error_param_a = query.value("error_param_a").toString(); - calibration.error_param_b = query.value("error_param_b").toString(); - - result.append(calibration); + result.clear(); + result.append(query.value("id").toString()); + result.append(query.value("params").toString()); + result.append(query.value("capacity").toString()); + result.append(query.value("unit").toString()); + result.append(query.value("frequency").toString()); + result.append(query.value("range_range").toString()); + result.append(query.value("standard_value").toString()); + result.append(query.value("resolution").toString()); + result.append(query.value("maximum_error").toString()); + result.append(query.value("error_param_a").toString()); + result.append(query.value("error_param_b").toString()); + resultData.append(result); } } else { qDebug() << "Query execution failed: " << query.lastError().text(); } - *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; - return result; + *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; } //检定数据管理 首页 @@ -757,7 +833,7 @@ " LEFT JOIN biz_equipment_standard_check_info besci ON besci.item_category_id = bescidc.item_category_id " " WHERE bescidc.equipment_id = :equipment_id "); - // 将参数绑定到占位符 '1692796512381222914' + // 将参数绑定到占位符 1692796512381222914 query.bindValue(":equipment_id", equipment_id); if (query.exec()) { while (query.next()) { @@ -788,12 +864,13 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " + bool isSuccess = query.exec("SELECT brtf.id,brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " " FROM biz_resource_technique_file brtf"); if (isSuccess) { while (query.next()) { Technique_File file; + file.id=query.value("id").toString(); file.file_distribute_no = query.value("file_distribute_no").toString(); file.file_name = query.value("file_name").toString(); file.version_no = query.value("version_no").toString(); @@ -876,7 +953,7 @@ QList result; QSqlQuery query; query.prepare("SELECT id,device_id ,communication_type ,serial_port ,visa ,create_time ,update_time " - "FROM zd_communication_setting WHERE device_id = ' :deviceId '"); + "FROM zd_communication_setting WHERE device_id = :deviceId "); query.bindValue(":deviceId", deviceId); if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h index 1b70cb9..ff8a320 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.h +++ b/softwareDirectory/AutoVerScheme/basecommonapi.h @@ -9,7 +9,7 @@ #include "databaseconnection.h" #include "id\IdWorker.h" - +#include "QStringList" //部门任务 @@ -52,6 +52,7 @@ QDateTime require_over_time; QString deliverer; QString is_urgent; + }; //创建任务单-查看任务单 class CatTask @@ -241,9 +242,15 @@ QString belong_standard_equipment; }; +class BaseEntity: public QObject +{ + Q_OBJECT + public: + +}; //被检设备管理-检定项目及检定点-检定项多功能校准源 -class VerMultiCal +class VerMultiCal:public BaseEntity { public: QString id; @@ -365,6 +372,7 @@ class Technique_File { public: + QString id; QString file_distribute_no; QString file_name; QString version_no; @@ -444,12 +452,22 @@ public: BaseCommonApi(); + // + static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList); + //部门任务 + static QList getAllData(); + //部门任务 参数登录用户的id static QList getAllData(QString userId); + //我的任务 static QList getMyTasks(QString id); //获取创建任务首页数据 - static QListgetCreateTaskList(QString id); + + static QListgetCreateTaskList(QString userId); + + + //创建任务-查看任务单顶部 static QListgetCatTask(QString orderNo); //创建任务-查看任务列表底部 @@ -479,7 +497,10 @@ //判断 哪个 装置表 传参 设备id 返回itemId static QList getJudgeCalibrationTable(QString id); //被检设备管理-检定项目及检定点-多功能校准源 - static QList getVerMultiCal(QString itemId,QStringList *headList); + + + static QList getVerMultiCal(QString itemId,QStringList *headList); + // 获取检定数据管理 首页 static QList getVerificationData(); // 检定数据管理-检定基本信息 @@ -494,6 +515,7 @@ static QList getCheckDataManageResultManageMult(QString equipment_id); //技术文件 static QList getTechnique_File(); + //检定程序管理首页查询 static QList getVerificationProgramInfoMain(); //检定程序管理 编辑 @@ -525,7 +547,6 @@ IdWorker &idWorker = Singleton::instance(); //自动检定 - }; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp index c3b2786..70148f4 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp @@ -4,6 +4,7 @@ #include "basecommonapi.h" //#include "tested_device_manage_serve.h" +#include "QStringList" //被检设备 BeExamined_DeviceItem::BeExamined_DeviceItem(QWidget *parent) : @@ -32,19 +33,32 @@ "}"); // ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); // item->setTextAlignment(Qt::AlignCenter); //ui->tableWidget->setItem(0, 0, item); //设置数据 - + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" + headers << "ID" << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" << "生产厂家"<<"所在单位" <<"使用部门"<<"计量标识"<<"检定周期"<<"证书有效期"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); + //详情页面tableWidgetItem设置 + ui->tableWidgetItem->setStyleSheet("QHeaderView::section {" + "border: 1px solid rgba(197, 196, 196, 1);" + "border-left:none;" + "border-top:none;" + "background-color:white;" + "}"); + + // ui->tableWidget->setRowCount(10); // 设置10行 + //ui->tableWidgetItem->setColumnCount(14); // 设置11列 + ui->tableWidgetItem->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 + ui->tableWidgetItem->verticalHeader()->setParent(nullptr); //隐藏行头 + } void BeExamined_DeviceItem::ShowMessageBox(QString title,QString value) { // 创建一个QMessageBox对象 @@ -64,24 +78,19 @@ } void BeExamined_DeviceItem::Load() { - //获取主页面内容 - //进入主页面 - /* - ui->stackedWidget->setCurrentIndex(0); + // ======================================================================================== + // 主页面初始化 + // ==================================================================================== + + + ui->stackedWidget->setCurrentIndex(0); //先设置为行为0 ui->tableWidget->setRowCount(0); - - - // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BeExamined_DeviceItem dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; int row=0; - QList data = dbManager.getBizDeviceManage(); - - - for (const BizDevice& bizDevice : data) { + QList data = dbManager.getTestedDevice(); + for (const TestedDevice& bizDevice : data) { rowCount = ui->tableWidget->rowCount(); ui->tableWidget->insertRow(rowCount); @@ -89,34 +98,118 @@ ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); ui->tableWidget->setItem(row, 2, new QTableWidgetItem(bizDevice.equipment_name)); ui->tableWidget->setItem(row, 3, new QTableWidgetItem(bizDevice.model)); - ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacture_no)); - ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.help_instruction)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacture_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(bizDevice.FULL_NAME)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(bizDevice.meter_identify)); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem(bizDevice.check_cycle)); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(bizDevice.certificate_valid)); + //添加操作按钮 QPushButton *button = new QPushButton("查看"); - ui->tableWidget->setCellWidget(row, 6, button); + ui->tableWidget->setCellWidget(row, 12, button); //设置按钮简单样式 button->setStyleSheet("QPushButton {" - " border: none; /* 无边框 "*/ - // " color: green; /* 文本颜色 */" - // " text-decoration: underline; /* 文本下划线 */" - // "}"); + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); // 设置鼠标悬停时的光标样式为小手图标 - // button->setCursor(Qt::PointingHandCursor); + button->setCursor(Qt::PointingHandCursor); // 连接按钮的 clicked 信号到自定义槽函数 - // connect(button, &QPushButton::clicked, this, [this, button, row]() { - // 获取当前行第一列的 ID - // QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); - // if (idItem) { - // QString id = idItem->text(); -// - // OnButtonSelectClicked(id); - // } + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); - // }); + OnButtonSelectClicked(id); + } - // row++; - - // } + }); + row++; + } } +void BeExamined_DeviceItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + + DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +//返回按钮 +void BeExamined_DeviceItem::on_pushButton_2_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); +} +void BeExamined_DeviceItem::DeviceInfoInit(QString id) +{ + // ======================================================================================== + // 初始化详情 + // ==================================================================================== + + QList data = dbManager.getTestedCatDevice(id); + for (const TestedCatDevice& testedCatDevice : data) { + + ui->equipment_name->setText(testedCatDevice.equipment_name); + ui->model->setText(testedCatDevice.model); + ui->help_instruction->setText(testedCatDevice.help_instruction); + ui->manufacture_no->setText(testedCatDevice.manufacture_no); + ui->product_country->setText(testedCatDevice.product_country); + ui->manufacturer->setText(testedCatDevice.manufacturer); + ui->product_date->setText(testedCatDevice.product_date); + ui->purchase_date->setText(testedCatDevice.purchase_date); + ui->unit_price->setText(testedCatDevice.unit_price); + ui->usage_status->setText(testedCatDevice.usage_status); + ui->quality_condition->setText(testedCatDevice.quality_condition); + ui->dept_name->setText(testedCatDevice.FULL_NAME); + ui->category->setText(testedCatDevice.category); + ui->check_cycle->setText(testedCatDevice.check_cycle); + ui->level->setText(testedCatDevice.level); + ui->remark->setText(testedCatDevice.remark); + } + + + // ======================================================================================== + // 初始化检定项目及核查点 + // ==================================================================================== + + //获取核查点tablewight的数据 + QStringList headlist; + + QList Data=dbManager.Search_CalibrationTable(id,&headlist); + + //tableWidgetItem + ui->tableWidgetItem->setRowCount(0); + ui->tableWidgetItem->setColumnCount(headlist.count()); + ui->tableWidgetItem->setHorizontalHeaderLabels(headlist); + //循环数据 + int rowCount=0; + int row=0; + ; + for (const QStringList& item : Data) + { + //获取行号 并进行添加行 + rowCount = ui->tableWidgetItem->rowCount(); + ui->tableWidgetItem->insertRow(rowCount); + //添加 序号 + ui->tableWidgetItem->setItem(row, 0, new QTableWidgetItem(QString::number(row+1))); + //循环读取值 headlist,count是列的数量 + for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型 + } + + row++; + + } +} + + + diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h index ffdc22a..0050ee7 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h @@ -21,6 +21,11 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + + void DeviceInfoInit(QString id); + + void on_pushButton_2_clicked(); private: Ui::BeExamined_DeviceItem *ui; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui index ce63879..cdacfaf 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui @@ -215,6 +215,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -225,6 +230,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 @@ -391,7 +401,7 @@ - + ForbiddenCursor @@ -412,7 +422,7 @@ - + ForbiddenCursor @@ -428,12 +438,12 @@ - 出厂编号: + 辅助字段: - + ForbiddenCursor @@ -449,12 +459,12 @@ - 检定有效期: + 出厂编号: - + ForbiddenCursor @@ -475,7 +485,7 @@ - + ForbiddenCursor @@ -496,7 +506,7 @@ - + ForbiddenCursor @@ -517,7 +527,7 @@ - + ForbiddenCursor @@ -538,7 +548,7 @@ - + ForbiddenCursor @@ -552,14 +562,14 @@ - + - 使用年限: + 设备单价: - + ForbiddenCursor @@ -573,14 +583,14 @@ - + - 设备单价: + 使用状态: - + ForbiddenCursor @@ -594,14 +604,14 @@ - + - 使用状态: + 质量状况: - + ForbiddenCursor @@ -615,14 +625,14 @@ - + - 质量状况: + 所在单位: - + ForbiddenCursor @@ -638,12 +648,12 @@ - 所属部门: + 使用部门: - + ForbiddenCursor @@ -657,14 +667,14 @@ - + - 负责人: + 设备分类: - + ForbiddenCursor @@ -678,14 +688,14 @@ - + - 设备供方: + 检定周期: - + ForbiddenCursor @@ -699,14 +709,14 @@ - + - 位置信息: + 重要等级: - + ForbiddenCursor @@ -720,140 +730,14 @@ - - - 设备类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 标准类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 设备分类: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 重要等级: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 检定周期: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 对应开箱记录: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - 备注: - - + + ForbiddenCursor @@ -892,7 +776,7 @@ - + diff --git a/softwareDirectory/AutoVerScheme/create_task.cpp b/softwareDirectory/AutoVerScheme/create_task.cpp index 9b49a1a..ddd78ef 100644 --- a/softwareDirectory/AutoVerScheme/create_task.cpp +++ b/softwareDirectory/AutoVerScheme/create_task.cpp @@ -2,12 +2,15 @@ #include "ui_create_task.h" #include "QMessageBox" + + QString Create_Task::State=""; Create_Task::Create_Task(QWidget *parent) : InfoBase(parent), ui(new Ui::Create_Task) { ui->setupUi(this); this->initForm(); + } Create_Task::~Create_Task() @@ -25,17 +28,19 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(8); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(9); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "任务单编号" << "委托方"<< "使用部门" << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; + headers <<"ID"<< "序号" << "任务单编号" << "委托方"<< "使用部门" + << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); //ShowMessageBox("标题","初始化完成"); } @@ -57,5 +62,171 @@ } void Create_Task::Load() { - //ShowMessageBox("创建任务界面","创建任务界面初始化完成"); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + + QList data = BaseCommonApi::getCreateTaskList(""); + + int rowCount = 0; + int row=0; + QString is_urgent; + for (const CreateTaskList& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.order_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.customer_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.DEPT_FULL_NAME)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.require_over_time.toString())); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.deliverer)); + if(item.is_urgent=="1") + is_urgent="是"; + else + is_urgent="否"; + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(is_urgent)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("查看"); + QPushButton *button2 = new QPushButton("编辑"); + QPushButton *button3 = new QPushButton("删除"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + Create_Task::State="Select"; + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonUpdateClicked(id); + Create_Task::State="Update"; + } + + }); + //设置按钮3简单样式 + button3->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: red; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button3->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button3, &QPushButton::clicked, this, [this, button3, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtoDeleteClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->addWidget(button3); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 8, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void Create_Task::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + HiddenButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "查看按钮ID",id); +} +void Create_Task::OnButtonUpdateClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "编辑按钮ID",id); +} +void Create_Task::OnButtoDeleteClicked(QString id) +{ + // ======================================================================================== + // 删除按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + + QMessageBox::information(this, "删除按钮ID",id); +} + +void Create_Task::on_pushButton_2_clicked() +{ + // ======================================================================================== + // 创建任务单按钮 + // ==================================================================================== + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + Create_Task::State="Create"; +} +void Create_Task::HiddenButton() +{ + ui->SaveButton->hide(); + ui->CreateButton->hide(); + ui->ScanButton->hide(); + ui->deletebutton->hide(); +} +void Create_Task::DisplayButton() +{ + ui->SaveButton->show(); + ui->CreateButton->show(); + ui->ScanButton->show(); + ui->deletebutton->show(); +} + +void Create_Task::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/create_task.h b/softwareDirectory/AutoVerScheme/create_task.h index 7cf383f..6b67c7c 100644 --- a/softwareDirectory/AutoVerScheme/create_task.h +++ b/softwareDirectory/AutoVerScheme/create_task.h @@ -16,11 +16,22 @@ explicit Create_Task(QWidget *parent = nullptr); ~Create_Task(); + //全局静态变量 + static QString State; private slots: void initForm(); //初始化界面数据 void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonUpdateClicked(QString id); + void OnButtoDeleteClicked(QString id); + void on_pushButton_2_clicked(); + void HiddenButton(); + void DisplayButton(); + + void on_pushButton_clicked(); + private: Ui::Create_Task *ui; }; diff --git a/softwareDirectory/AutoVerScheme/create_task.ui b/softwareDirectory/AutoVerScheme/create_task.ui index d9d88ed..b45af33 100644 --- a/softwareDirectory/AutoVerScheme/create_task.ui +++ b/softwareDirectory/AutoVerScheme/create_task.ui @@ -19,278 +19,651 @@ - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 1 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 任务单编号: - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - 委托方: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 使用部门: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 要求完成时间: - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(3, 58, 132); + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 任务单编号: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 委托方: + + + + + + + + + + 使用部门: + + + + + + + + + + 要求检完时间: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); color:white; - - - 查询 - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(207, 132, 33); + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); color:white; - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - 6 + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + 3 + + + + + + 50 + 40 + + + + + 100 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 创建任务单 + + + + + + + + + + + + + + + + + + + + + color:black; - - 9 - - - 9 - - - 9 - - - - - - 0 - 0 - - - - - 120 - 40 - - - - OpenHandCursor - - - Qt::DefaultContextMenu - - - Qt::RightToLeft - - - false - - - background-color:rgb(9, 89, 179); + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 创建任务单 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 保存 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; color:white; - - - 创建任务单 - - - true - - - - - - - - - - - - - - SizeVerCursor - - - - - - - + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接人: + + + + + + + 要求检完时间: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 是否加急: + + + + + + + 电话: + + + + + + + 委托方: + + + + + + + 任务单编号: + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接时间: + + + + + + + 送检人: + + + + + + + 接收说明: + + + + + + + 使用部门: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + 任务单列表: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 扫描增加 + + + false + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 增加行 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 删除行 + + + + + + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/depar_task.ui b/softwareDirectory/AutoVerScheme/depar_task.ui index efb7561..f44829d 100644 --- a/softwareDirectory/AutoVerScheme/depar_task.ui +++ b/softwareDirectory/AutoVerScheme/depar_task.ui @@ -213,86 +213,6 @@ - - - 12 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - diff --git a/softwareDirectory/AutoVerScheme/infomanageview.ui b/softwareDirectory/AutoVerScheme/infomanageview.ui index ef0b87b..cb76a28 100644 --- a/softwareDirectory/AutoVerScheme/infomanageview.ui +++ b/softwareDirectory/AutoVerScheme/infomanageview.ui @@ -20,7 +20,7 @@ color:black; background-color:rgba(240, 240, 240, 1); - + 0 @@ -37,77 +37,124 @@ 0 - - - - 0 - 0 - - - - - 170 - 0 - - - - - 16777215 - 16777215 - - + - color:White; - font-weight: bold; - font-size: 16px; -background-color:rgba(10, 15, 92, 1); + border-image: url(:/image/Index/u15.png); - - true - - - - - 0 - 0 - 170 - 625 - - - - - 0 - 0 - - - - - 170 - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - + + + + + + 50 + 50 + + + + + 35 + 35 + + + + image: url(:/image/Index/u2158.svg); + + + + + + + + + + color:white; +font-size:18px; +font-weight:bold; + + + 信息管理 + + + + - + + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 16777215 + 16777215 + + + + color:White; + font-weight: bold; + font-size: 16px; +background-color:rgba(10, 15, 92, 1); + + + true + + + + + 0 + 0 + 170 + 570 + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp index efc00ba..eea27f0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp @@ -25,17 +25,17 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 - + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0,0); //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "出厂编号" + headers <<"ID"<< "序号" << "设备名称" << "型号规则" << "出厂编号" <<"核查件名称"<<"核查件型号"<<"核查件编号" <<"核查员" << "核查日期" <<"实验室"<<"部门"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); @@ -58,5 +58,114 @@ } void InspectDataItem::Load() { - //ShowMessageBox("核查数据","核查数据"); + // ======================================================================================== + // 主页面初始化 核查管理初始化 + // ==================================================================================== + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + // 调用数据库管理器的函数获取数据 + int rowCount=0; + int row=0; + QList data = dbManager.getCheckData(); + for (const CheckData& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.equipment_name)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.model)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.manufacture_no)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.meter_standard_name)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(item.meter_standard_id)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(item.create_user_name)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(item.check_date.toString())); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(item.dept_name)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("详情"); + QPushButton *button2 = new QPushButton("预览"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonPreViewtClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 12, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void InspectDataItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +void InspectDataItem::OnButtonPreViewtClicked(QString id) +{ + // ======================================================================================== + // 预览按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} + +void InspectDataItem::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.h b/softwareDirectory/AutoVerScheme/inspectdataitem.h index bdf7066..6644339 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.h +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.h @@ -20,6 +20,10 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonPreViewtClicked(QString id); + void on_pushButton_clicked(); + private: Ui::InspectDataItem *ui; }; diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/InfoBase.h b/softwareDirectory/AutoVerScheme/InfoBase.h index 6dd59f3..bce9609 100644 --- a/softwareDirectory/AutoVerScheme/InfoBase.h +++ b/softwareDirectory/AutoVerScheme/InfoBase.h @@ -4,6 +4,7 @@ #include #include "QStandardItemModel" #include "databaseconnection.h" +#include "basecommonapi.h" ///信号管理页面的基类 所有信息管理页面都继承于InfoBase /// 便于统一管理 所有子类必须实现Load方法 /// 每次按钮点击切换都会调用Load方法 用于每次页面的数据刷新 @@ -16,7 +17,7 @@ //QStandardItemModel 的实例。这个模型将用于存储和管理数据。 QStandardItemModel *model; //信息管理页面 基类定义Conn对象 - DatabaseConnection *Conn=DatabaseConnection::getInstance(); + BaseCommonApi dbManager; }; #endif // INFOBASE_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index f62915b..6170ee7 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -15,7 +15,7 @@ " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id " " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID " " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID " - " WHERE sys_user.ID = ' :userId '"); + " WHERE sys_user.ID = :userId"); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -75,6 +75,35 @@ } return result; } + +//获取创建任务首页数据 +QList BaseCommonApi::getCreateTaskList(QString userId) +{ + userId="1640229293790650370"; + QList result; + QSqlQuery query; + query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " + " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " + " WHERE bi.create_user_id = :userId"); + // 将参数绑定到占位符 + query.bindValue(":userId", userId); + if (query.exec()) { + while (query.next()) { + CreateTaskList task; + task.id = query.value("id").toString(); + task.order_no = query.value("order_no").toString(); + task.customer_name = query.value("customer_name").toString(); + task.DEPT_FULL_NAME = query.value("FULL_NAME").toString(); + task.require_over_time = query.value("require_over_time").toDateTime(); + task.deliverer = query.value("deliverer").toString(); + task.is_urgent = query.value("is_urgent").toString(); + result.append(task); + } + } else { + qDebug() << "Query execution failed: " << query.lastError().text(); + } + return result; +} //获取创建任务首页数据 QListgetCreateTaskList(QString userId) { @@ -82,7 +111,7 @@ QSqlQuery query; query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " - " WHERE bi.create_user_id = ':userId' "); + " WHERE bi.create_user_id = :userId "); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -103,6 +132,7 @@ return result; } + //创建任务单-查看/编辑 顶部数据 传参该条数据的id QListBaseCommonApi::getCatTask(QString id) { @@ -111,7 +141,7 @@ query.prepare("SELECT bi.order_no ,bi.customer_name ,dept.FULL_NAME ,bi.require_over_time ," " bi.deliverer ,bi.deliverer_tel ,bi.undertaker_name ,bi.undertake_time , bi.is_urgent AS ," " bi.receive_illustrate FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID" - " WHERE bi.id = ' :id '"); + " WHERE bi.id = :id "); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -140,6 +170,7 @@ //获取创建任务 -任务单列表 + QListBaseCommonApi::getCatTaskList(QString orderId) { QList result; @@ -380,6 +411,7 @@ QListBaseCommonApi::getCheckDCPower(QString equipment_id,QStringList *headList) { + equipment_id="1693435753272557570"; QList result; QSqlQuery query; query.prepare("SELECT besciddp.id ,besciddp.params,besciddp.unit,resolution,besciddp.urel,besciddp.check_type,datum_point,cycle_number " @@ -407,9 +439,11 @@ } else { qDebug() << "Query execution failed: " << query.lastError().text(); } + *headList <<"序号"<<"核查项目"<<"核查点"<<"单位"<<"分辨力"<<"Urel"<<"核查类型"<<"是否为基准点(1/0)"<<"循环次数" <<"电阻值/频率"<<"电阻值单位/频率单位"<<"核查项备注"; + return result; } //根据id获取装置名称 @@ -436,9 +470,9 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " - " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id " - " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); +bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " + " JOIN sys_dept ON sys_dept.ID = eei.dept_id " + " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); if (isSuccess) { while (query.next()) { TestedDevice testedDevice; @@ -504,9 +538,10 @@ //判断 哪个 装置表 传参 设备id QList BaseCommonApi::getJudgeCalibrationTable(QString id) { + id="1716997603953311746"; QList result; QSqlQuery query; - query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = ':id')"); + query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = :id )"); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -526,12 +561,55 @@ return result; } +//标准装置字典类型 +/** + * 多功能校准源标准装置 = 1 + * 直流稳压电源检定装置 = 2 + * 多功能电气安全校准器标准装置 = 3 + * 0.02级活塞式压力计标准装置 = 4 + * 二等铂电阻温度计标准装置 = 5 + * 安全阀校验装置 = 6 + * 精密露点仪标准装置 = 7 + * E2等级砝码标准装置 = 8 + * 频谱分析仪标准装置 = 9 + * 信号发生器标准装置 = 10 + * 微波衰减标准装置 = 11 + * 频率短期稳定度标准装置 =12 + * 示波器标准装置 = 13 + * 铯原子频率标准装置 =14 + * 小功率标准装置 = 15 + * 低频信号发生器标准装置 = 16 + * S参数标准装置 = 17 + * 失真度标准装置 = 18 + */ +//根据被检设备ID获取当前设备的 核查项目及核查点 + +QList BaseCommonApi::Search_CalibrationTable(QString DeiverId,QStringList *HeadList) +{ + + QList DataList; + DataList.clear(); + QList CliTable=BaseCommonApi::getJudgeCalibrationTable(DeiverId); + if(CliTable.count()==0)return DataList; + switch (CliTable[0].belong_standard_equipment.toInt()) + { + case 1: + + //CliTable[0].item_category_id + DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList); + break; + } + + return DataList; +} //被检设备管理-检定项目及检定点-多功能校准源 -QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) +QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) { -QList result; +QList resultData; +QStringList result; +resultData.clear(); QSqlQuery query; query.prepare("SELECT bbdmidc.id ,bbdmidc.params ,bbdmidc.capacity ,bbdmidc.unit ,bbdmidc.frequency , bbdmidc.range_range , bbdmidc.standard_value , bbdmidc.resolution , bbdmidc.maximum_error , bbdmidc.error_param_a , bbdmidc.error_param_b " @@ -542,26 +620,24 @@ if (query.exec()) { while (query.next()) { - VerMultiCal calibration; - calibration.id = query.value("id").toString(); - calibration.params = query.value("params").toString(); - calibration.capacity = query.value("capacity").toString(); - calibration.unit = query.value("unit").toString(); - calibration.frequency = query.value("frequency").toString(); - calibration.range_range = query.value("range_range").toString(); - calibration.standard_value = query.value("standard_value").toString(); - calibration.resolution = query.value("resolution").toString(); - calibration.maximum_error = query.value("maximum_error").toString(); - calibration.error_param_a = query.value("error_param_a").toString(); - calibration.error_param_b = query.value("error_param_b").toString(); - - result.append(calibration); + result.clear(); + result.append(query.value("id").toString()); + result.append(query.value("params").toString()); + result.append(query.value("capacity").toString()); + result.append(query.value("unit").toString()); + result.append(query.value("frequency").toString()); + result.append(query.value("range_range").toString()); + result.append(query.value("standard_value").toString()); + result.append(query.value("resolution").toString()); + result.append(query.value("maximum_error").toString()); + result.append(query.value("error_param_a").toString()); + result.append(query.value("error_param_b").toString()); + resultData.append(result); } } else { qDebug() << "Query execution failed: " << query.lastError().text(); } - *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; - return result; + *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; } //检定数据管理 首页 @@ -757,7 +833,7 @@ " LEFT JOIN biz_equipment_standard_check_info besci ON besci.item_category_id = bescidc.item_category_id " " WHERE bescidc.equipment_id = :equipment_id "); - // 将参数绑定到占位符 '1692796512381222914' + // 将参数绑定到占位符 1692796512381222914 query.bindValue(":equipment_id", equipment_id); if (query.exec()) { while (query.next()) { @@ -788,12 +864,13 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " + bool isSuccess = query.exec("SELECT brtf.id,brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " " FROM biz_resource_technique_file brtf"); if (isSuccess) { while (query.next()) { Technique_File file; + file.id=query.value("id").toString(); file.file_distribute_no = query.value("file_distribute_no").toString(); file.file_name = query.value("file_name").toString(); file.version_no = query.value("version_no").toString(); @@ -876,7 +953,7 @@ QList result; QSqlQuery query; query.prepare("SELECT id,device_id ,communication_type ,serial_port ,visa ,create_time ,update_time " - "FROM zd_communication_setting WHERE device_id = ' :deviceId '"); + "FROM zd_communication_setting WHERE device_id = :deviceId "); query.bindValue(":deviceId", deviceId); if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h index 1b70cb9..ff8a320 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.h +++ b/softwareDirectory/AutoVerScheme/basecommonapi.h @@ -9,7 +9,7 @@ #include "databaseconnection.h" #include "id\IdWorker.h" - +#include "QStringList" //部门任务 @@ -52,6 +52,7 @@ QDateTime require_over_time; QString deliverer; QString is_urgent; + }; //创建任务单-查看任务单 class CatTask @@ -241,9 +242,15 @@ QString belong_standard_equipment; }; +class BaseEntity: public QObject +{ + Q_OBJECT + public: + +}; //被检设备管理-检定项目及检定点-检定项多功能校准源 -class VerMultiCal +class VerMultiCal:public BaseEntity { public: QString id; @@ -365,6 +372,7 @@ class Technique_File { public: + QString id; QString file_distribute_no; QString file_name; QString version_no; @@ -444,12 +452,22 @@ public: BaseCommonApi(); + // + static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList); + //部门任务 + static QList getAllData(); + //部门任务 参数登录用户的id static QList getAllData(QString userId); + //我的任务 static QList getMyTasks(QString id); //获取创建任务首页数据 - static QListgetCreateTaskList(QString id); + + static QListgetCreateTaskList(QString userId); + + + //创建任务-查看任务单顶部 static QListgetCatTask(QString orderNo); //创建任务-查看任务列表底部 @@ -479,7 +497,10 @@ //判断 哪个 装置表 传参 设备id 返回itemId static QList getJudgeCalibrationTable(QString id); //被检设备管理-检定项目及检定点-多功能校准源 - static QList getVerMultiCal(QString itemId,QStringList *headList); + + + static QList getVerMultiCal(QString itemId,QStringList *headList); + // 获取检定数据管理 首页 static QList getVerificationData(); // 检定数据管理-检定基本信息 @@ -494,6 +515,7 @@ static QList getCheckDataManageResultManageMult(QString equipment_id); //技术文件 static QList getTechnique_File(); + //检定程序管理首页查询 static QList getVerificationProgramInfoMain(); //检定程序管理 编辑 @@ -525,7 +547,6 @@ IdWorker &idWorker = Singleton::instance(); //自动检定 - }; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp index c3b2786..70148f4 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp @@ -4,6 +4,7 @@ #include "basecommonapi.h" //#include "tested_device_manage_serve.h" +#include "QStringList" //被检设备 BeExamined_DeviceItem::BeExamined_DeviceItem(QWidget *parent) : @@ -32,19 +33,32 @@ "}"); // ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); // item->setTextAlignment(Qt::AlignCenter); //ui->tableWidget->setItem(0, 0, item); //设置数据 - + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" + headers << "ID" << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" << "生产厂家"<<"所在单位" <<"使用部门"<<"计量标识"<<"检定周期"<<"证书有效期"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); + //详情页面tableWidgetItem设置 + ui->tableWidgetItem->setStyleSheet("QHeaderView::section {" + "border: 1px solid rgba(197, 196, 196, 1);" + "border-left:none;" + "border-top:none;" + "background-color:white;" + "}"); + + // ui->tableWidget->setRowCount(10); // 设置10行 + //ui->tableWidgetItem->setColumnCount(14); // 设置11列 + ui->tableWidgetItem->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 + ui->tableWidgetItem->verticalHeader()->setParent(nullptr); //隐藏行头 + } void BeExamined_DeviceItem::ShowMessageBox(QString title,QString value) { // 创建一个QMessageBox对象 @@ -64,24 +78,19 @@ } void BeExamined_DeviceItem::Load() { - //获取主页面内容 - //进入主页面 - /* - ui->stackedWidget->setCurrentIndex(0); + // ======================================================================================== + // 主页面初始化 + // ==================================================================================== + + + ui->stackedWidget->setCurrentIndex(0); //先设置为行为0 ui->tableWidget->setRowCount(0); - - - // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BeExamined_DeviceItem dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; int row=0; - QList data = dbManager.getBizDeviceManage(); - - - for (const BizDevice& bizDevice : data) { + QList data = dbManager.getTestedDevice(); + for (const TestedDevice& bizDevice : data) { rowCount = ui->tableWidget->rowCount(); ui->tableWidget->insertRow(rowCount); @@ -89,34 +98,118 @@ ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); ui->tableWidget->setItem(row, 2, new QTableWidgetItem(bizDevice.equipment_name)); ui->tableWidget->setItem(row, 3, new QTableWidgetItem(bizDevice.model)); - ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacture_no)); - ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.help_instruction)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacture_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(bizDevice.FULL_NAME)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(bizDevice.meter_identify)); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem(bizDevice.check_cycle)); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(bizDevice.certificate_valid)); + //添加操作按钮 QPushButton *button = new QPushButton("查看"); - ui->tableWidget->setCellWidget(row, 6, button); + ui->tableWidget->setCellWidget(row, 12, button); //设置按钮简单样式 button->setStyleSheet("QPushButton {" - " border: none; /* 无边框 "*/ - // " color: green; /* 文本颜色 */" - // " text-decoration: underline; /* 文本下划线 */" - // "}"); + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); // 设置鼠标悬停时的光标样式为小手图标 - // button->setCursor(Qt::PointingHandCursor); + button->setCursor(Qt::PointingHandCursor); // 连接按钮的 clicked 信号到自定义槽函数 - // connect(button, &QPushButton::clicked, this, [this, button, row]() { - // 获取当前行第一列的 ID - // QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); - // if (idItem) { - // QString id = idItem->text(); -// - // OnButtonSelectClicked(id); - // } + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); - // }); + OnButtonSelectClicked(id); + } - // row++; - - // } + }); + row++; + } } +void BeExamined_DeviceItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + + DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +//返回按钮 +void BeExamined_DeviceItem::on_pushButton_2_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); +} +void BeExamined_DeviceItem::DeviceInfoInit(QString id) +{ + // ======================================================================================== + // 初始化详情 + // ==================================================================================== + + QList data = dbManager.getTestedCatDevice(id); + for (const TestedCatDevice& testedCatDevice : data) { + + ui->equipment_name->setText(testedCatDevice.equipment_name); + ui->model->setText(testedCatDevice.model); + ui->help_instruction->setText(testedCatDevice.help_instruction); + ui->manufacture_no->setText(testedCatDevice.manufacture_no); + ui->product_country->setText(testedCatDevice.product_country); + ui->manufacturer->setText(testedCatDevice.manufacturer); + ui->product_date->setText(testedCatDevice.product_date); + ui->purchase_date->setText(testedCatDevice.purchase_date); + ui->unit_price->setText(testedCatDevice.unit_price); + ui->usage_status->setText(testedCatDevice.usage_status); + ui->quality_condition->setText(testedCatDevice.quality_condition); + ui->dept_name->setText(testedCatDevice.FULL_NAME); + ui->category->setText(testedCatDevice.category); + ui->check_cycle->setText(testedCatDevice.check_cycle); + ui->level->setText(testedCatDevice.level); + ui->remark->setText(testedCatDevice.remark); + } + + + // ======================================================================================== + // 初始化检定项目及核查点 + // ==================================================================================== + + //获取核查点tablewight的数据 + QStringList headlist; + + QList Data=dbManager.Search_CalibrationTable(id,&headlist); + + //tableWidgetItem + ui->tableWidgetItem->setRowCount(0); + ui->tableWidgetItem->setColumnCount(headlist.count()); + ui->tableWidgetItem->setHorizontalHeaderLabels(headlist); + //循环数据 + int rowCount=0; + int row=0; + ; + for (const QStringList& item : Data) + { + //获取行号 并进行添加行 + rowCount = ui->tableWidgetItem->rowCount(); + ui->tableWidgetItem->insertRow(rowCount); + //添加 序号 + ui->tableWidgetItem->setItem(row, 0, new QTableWidgetItem(QString::number(row+1))); + //循环读取值 headlist,count是列的数量 + for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型 + } + + row++; + + } +} + + + diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h index ffdc22a..0050ee7 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h @@ -21,6 +21,11 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + + void DeviceInfoInit(QString id); + + void on_pushButton_2_clicked(); private: Ui::BeExamined_DeviceItem *ui; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui index ce63879..cdacfaf 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui @@ -215,6 +215,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -225,6 +230,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 @@ -391,7 +401,7 @@ - + ForbiddenCursor @@ -412,7 +422,7 @@ - + ForbiddenCursor @@ -428,12 +438,12 @@ - 出厂编号: + 辅助字段: - + ForbiddenCursor @@ -449,12 +459,12 @@ - 检定有效期: + 出厂编号: - + ForbiddenCursor @@ -475,7 +485,7 @@ - + ForbiddenCursor @@ -496,7 +506,7 @@ - + ForbiddenCursor @@ -517,7 +527,7 @@ - + ForbiddenCursor @@ -538,7 +548,7 @@ - + ForbiddenCursor @@ -552,14 +562,14 @@ - + - 使用年限: + 设备单价: - + ForbiddenCursor @@ -573,14 +583,14 @@ - + - 设备单价: + 使用状态: - + ForbiddenCursor @@ -594,14 +604,14 @@ - + - 使用状态: + 质量状况: - + ForbiddenCursor @@ -615,14 +625,14 @@ - + - 质量状况: + 所在单位: - + ForbiddenCursor @@ -638,12 +648,12 @@ - 所属部门: + 使用部门: - + ForbiddenCursor @@ -657,14 +667,14 @@ - + - 负责人: + 设备分类: - + ForbiddenCursor @@ -678,14 +688,14 @@ - + - 设备供方: + 检定周期: - + ForbiddenCursor @@ -699,14 +709,14 @@ - + - 位置信息: + 重要等级: - + ForbiddenCursor @@ -720,140 +730,14 @@ - - - 设备类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 标准类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 设备分类: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 重要等级: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 检定周期: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 对应开箱记录: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - 备注: - - + + ForbiddenCursor @@ -892,7 +776,7 @@ - + diff --git a/softwareDirectory/AutoVerScheme/create_task.cpp b/softwareDirectory/AutoVerScheme/create_task.cpp index 9b49a1a..ddd78ef 100644 --- a/softwareDirectory/AutoVerScheme/create_task.cpp +++ b/softwareDirectory/AutoVerScheme/create_task.cpp @@ -2,12 +2,15 @@ #include "ui_create_task.h" #include "QMessageBox" + + QString Create_Task::State=""; Create_Task::Create_Task(QWidget *parent) : InfoBase(parent), ui(new Ui::Create_Task) { ui->setupUi(this); this->initForm(); + } Create_Task::~Create_Task() @@ -25,17 +28,19 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(8); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(9); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "任务单编号" << "委托方"<< "使用部门" << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; + headers <<"ID"<< "序号" << "任务单编号" << "委托方"<< "使用部门" + << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); //ShowMessageBox("标题","初始化完成"); } @@ -57,5 +62,171 @@ } void Create_Task::Load() { - //ShowMessageBox("创建任务界面","创建任务界面初始化完成"); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + + QList data = BaseCommonApi::getCreateTaskList(""); + + int rowCount = 0; + int row=0; + QString is_urgent; + for (const CreateTaskList& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.order_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.customer_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.DEPT_FULL_NAME)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.require_over_time.toString())); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.deliverer)); + if(item.is_urgent=="1") + is_urgent="是"; + else + is_urgent="否"; + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(is_urgent)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("查看"); + QPushButton *button2 = new QPushButton("编辑"); + QPushButton *button3 = new QPushButton("删除"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + Create_Task::State="Select"; + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonUpdateClicked(id); + Create_Task::State="Update"; + } + + }); + //设置按钮3简单样式 + button3->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: red; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button3->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button3, &QPushButton::clicked, this, [this, button3, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtoDeleteClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->addWidget(button3); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 8, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void Create_Task::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + HiddenButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "查看按钮ID",id); +} +void Create_Task::OnButtonUpdateClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "编辑按钮ID",id); +} +void Create_Task::OnButtoDeleteClicked(QString id) +{ + // ======================================================================================== + // 删除按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + + QMessageBox::information(this, "删除按钮ID",id); +} + +void Create_Task::on_pushButton_2_clicked() +{ + // ======================================================================================== + // 创建任务单按钮 + // ==================================================================================== + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + Create_Task::State="Create"; +} +void Create_Task::HiddenButton() +{ + ui->SaveButton->hide(); + ui->CreateButton->hide(); + ui->ScanButton->hide(); + ui->deletebutton->hide(); +} +void Create_Task::DisplayButton() +{ + ui->SaveButton->show(); + ui->CreateButton->show(); + ui->ScanButton->show(); + ui->deletebutton->show(); +} + +void Create_Task::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/create_task.h b/softwareDirectory/AutoVerScheme/create_task.h index 7cf383f..6b67c7c 100644 --- a/softwareDirectory/AutoVerScheme/create_task.h +++ b/softwareDirectory/AutoVerScheme/create_task.h @@ -16,11 +16,22 @@ explicit Create_Task(QWidget *parent = nullptr); ~Create_Task(); + //全局静态变量 + static QString State; private slots: void initForm(); //初始化界面数据 void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonUpdateClicked(QString id); + void OnButtoDeleteClicked(QString id); + void on_pushButton_2_clicked(); + void HiddenButton(); + void DisplayButton(); + + void on_pushButton_clicked(); + private: Ui::Create_Task *ui; }; diff --git a/softwareDirectory/AutoVerScheme/create_task.ui b/softwareDirectory/AutoVerScheme/create_task.ui index d9d88ed..b45af33 100644 --- a/softwareDirectory/AutoVerScheme/create_task.ui +++ b/softwareDirectory/AutoVerScheme/create_task.ui @@ -19,278 +19,651 @@ - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 1 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 任务单编号: - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - 委托方: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 使用部门: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 要求完成时间: - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(3, 58, 132); + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 任务单编号: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 委托方: + + + + + + + + + + 使用部门: + + + + + + + + + + 要求检完时间: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); color:white; - - - 查询 - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(207, 132, 33); + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); color:white; - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - 6 + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + 3 + + + + + + 50 + 40 + + + + + 100 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 创建任务单 + + + + + + + + + + + + + + + + + + + + + color:black; - - 9 - - - 9 - - - 9 - - - - - - 0 - 0 - - - - - 120 - 40 - - - - OpenHandCursor - - - Qt::DefaultContextMenu - - - Qt::RightToLeft - - - false - - - background-color:rgb(9, 89, 179); + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 创建任务单 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 保存 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; color:white; - - - 创建任务单 - - - true - - - - - - - - - - - - - - SizeVerCursor - - - - - - - + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接人: + + + + + + + 要求检完时间: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 是否加急: + + + + + + + 电话: + + + + + + + 委托方: + + + + + + + 任务单编号: + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接时间: + + + + + + + 送检人: + + + + + + + 接收说明: + + + + + + + 使用部门: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + 任务单列表: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 扫描增加 + + + false + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 增加行 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 删除行 + + + + + + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/depar_task.ui b/softwareDirectory/AutoVerScheme/depar_task.ui index efb7561..f44829d 100644 --- a/softwareDirectory/AutoVerScheme/depar_task.ui +++ b/softwareDirectory/AutoVerScheme/depar_task.ui @@ -213,86 +213,6 @@ - - - 12 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - diff --git a/softwareDirectory/AutoVerScheme/infomanageview.ui b/softwareDirectory/AutoVerScheme/infomanageview.ui index ef0b87b..cb76a28 100644 --- a/softwareDirectory/AutoVerScheme/infomanageview.ui +++ b/softwareDirectory/AutoVerScheme/infomanageview.ui @@ -20,7 +20,7 @@ color:black; background-color:rgba(240, 240, 240, 1); - + 0 @@ -37,77 +37,124 @@ 0 - - - - 0 - 0 - - - - - 170 - 0 - - - - - 16777215 - 16777215 - - + - color:White; - font-weight: bold; - font-size: 16px; -background-color:rgba(10, 15, 92, 1); + border-image: url(:/image/Index/u15.png); - - true - - - - - 0 - 0 - 170 - 625 - - - - - 0 - 0 - - - - - 170 - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - + + + + + + 50 + 50 + + + + + 35 + 35 + + + + image: url(:/image/Index/u2158.svg); + + + + + + + + + + color:white; +font-size:18px; +font-weight:bold; + + + 信息管理 + + + + - + + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 16777215 + 16777215 + + + + color:White; + font-weight: bold; + font-size: 16px; +background-color:rgba(10, 15, 92, 1); + + + true + + + + + 0 + 0 + 170 + 570 + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp index efc00ba..eea27f0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp @@ -25,17 +25,17 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 - + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0,0); //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "出厂编号" + headers <<"ID"<< "序号" << "设备名称" << "型号规则" << "出厂编号" <<"核查件名称"<<"核查件型号"<<"核查件编号" <<"核查员" << "核查日期" <<"实验室"<<"部门"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); @@ -58,5 +58,114 @@ } void InspectDataItem::Load() { - //ShowMessageBox("核查数据","核查数据"); + // ======================================================================================== + // 主页面初始化 核查管理初始化 + // ==================================================================================== + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + // 调用数据库管理器的函数获取数据 + int rowCount=0; + int row=0; + QList data = dbManager.getCheckData(); + for (const CheckData& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.equipment_name)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.model)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.manufacture_no)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.meter_standard_name)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(item.meter_standard_id)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(item.create_user_name)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(item.check_date.toString())); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(item.dept_name)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("详情"); + QPushButton *button2 = new QPushButton("预览"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonPreViewtClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 12, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void InspectDataItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +void InspectDataItem::OnButtonPreViewtClicked(QString id) +{ + // ======================================================================================== + // 预览按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} + +void InspectDataItem::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.h b/softwareDirectory/AutoVerScheme/inspectdataitem.h index bdf7066..6644339 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.h +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.h @@ -20,6 +20,10 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonPreViewtClicked(QString id); + void on_pushButton_clicked(); + private: Ui::InspectDataItem *ui; }; diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.ui b/softwareDirectory/AutoVerScheme/inspectdataitem.ui index 86786c9..3f319c0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.ui +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.ui @@ -7,232 +7,928 @@ 0 0 1362 - 543 + 553 Form - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 0 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 设备名称: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 型号规则: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 出厂编号: - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 核查员: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 核查日期: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 实验室: - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - Qt::RightToLeft - - - 查询 - - - - - - - Qt::RightToLeft - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - - - - - - - - - - + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 设备名称: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 型号规则: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 出厂编号: + + + + + + + + 0 + 0 + + + + + + + + 核查员: + + + + + + + + + + 实验室: + + + + + + + + + + 核查日期: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + + + + + + + + + + + + + + + + + color:black; + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 核查数据详情 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; +color:white; + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + 设备基本信息: + + + + + + + 设备名称: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 型号规格: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 出厂编号: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定有效期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产国家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产厂家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 购进日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用年限: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备单价: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用状态: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 质量状况: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 所属部门: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 负责人: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备供方: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 位置信息: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 标准类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备分类: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 重要等级: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定周期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 对应开箱记录: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 备注: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + 3 + + + false + + + Qt::LogicalMoveStyle + + + + + + + + + + + + + + + + 核查项目及核查点: + + + + + + + + + + + + + + 0 + 0 + + + + + 30 + 0 + + + + + + + + + + false + + + + 6 + + + 0 + + + 0 + + + 0 + + + 6 + + + + + 检定项备注: + + + + + + + background-color: #f0f0f0; +color: grey; + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/InfoBase.h b/softwareDirectory/AutoVerScheme/InfoBase.h index 6dd59f3..bce9609 100644 --- a/softwareDirectory/AutoVerScheme/InfoBase.h +++ b/softwareDirectory/AutoVerScheme/InfoBase.h @@ -4,6 +4,7 @@ #include #include "QStandardItemModel" #include "databaseconnection.h" +#include "basecommonapi.h" ///信号管理页面的基类 所有信息管理页面都继承于InfoBase /// 便于统一管理 所有子类必须实现Load方法 /// 每次按钮点击切换都会调用Load方法 用于每次页面的数据刷新 @@ -16,7 +17,7 @@ //QStandardItemModel 的实例。这个模型将用于存储和管理数据。 QStandardItemModel *model; //信息管理页面 基类定义Conn对象 - DatabaseConnection *Conn=DatabaseConnection::getInstance(); + BaseCommonApi dbManager; }; #endif // INFOBASE_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index f62915b..6170ee7 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -15,7 +15,7 @@ " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id " " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID " " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID " - " WHERE sys_user.ID = ' :userId '"); + " WHERE sys_user.ID = :userId"); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -75,6 +75,35 @@ } return result; } + +//获取创建任务首页数据 +QList BaseCommonApi::getCreateTaskList(QString userId) +{ + userId="1640229293790650370"; + QList result; + QSqlQuery query; + query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " + " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " + " WHERE bi.create_user_id = :userId"); + // 将参数绑定到占位符 + query.bindValue(":userId", userId); + if (query.exec()) { + while (query.next()) { + CreateTaskList task; + task.id = query.value("id").toString(); + task.order_no = query.value("order_no").toString(); + task.customer_name = query.value("customer_name").toString(); + task.DEPT_FULL_NAME = query.value("FULL_NAME").toString(); + task.require_over_time = query.value("require_over_time").toDateTime(); + task.deliverer = query.value("deliverer").toString(); + task.is_urgent = query.value("is_urgent").toString(); + result.append(task); + } + } else { + qDebug() << "Query execution failed: " << query.lastError().text(); + } + return result; +} //获取创建任务首页数据 QListgetCreateTaskList(QString userId) { @@ -82,7 +111,7 @@ QSqlQuery query; query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " - " WHERE bi.create_user_id = ':userId' "); + " WHERE bi.create_user_id = :userId "); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -103,6 +132,7 @@ return result; } + //创建任务单-查看/编辑 顶部数据 传参该条数据的id QListBaseCommonApi::getCatTask(QString id) { @@ -111,7 +141,7 @@ query.prepare("SELECT bi.order_no ,bi.customer_name ,dept.FULL_NAME ,bi.require_over_time ," " bi.deliverer ,bi.deliverer_tel ,bi.undertaker_name ,bi.undertake_time , bi.is_urgent AS ," " bi.receive_illustrate FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID" - " WHERE bi.id = ' :id '"); + " WHERE bi.id = :id "); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -140,6 +170,7 @@ //获取创建任务 -任务单列表 + QListBaseCommonApi::getCatTaskList(QString orderId) { QList result; @@ -380,6 +411,7 @@ QListBaseCommonApi::getCheckDCPower(QString equipment_id,QStringList *headList) { + equipment_id="1693435753272557570"; QList result; QSqlQuery query; query.prepare("SELECT besciddp.id ,besciddp.params,besciddp.unit,resolution,besciddp.urel,besciddp.check_type,datum_point,cycle_number " @@ -407,9 +439,11 @@ } else { qDebug() << "Query execution failed: " << query.lastError().text(); } + *headList <<"序号"<<"核查项目"<<"核查点"<<"单位"<<"分辨力"<<"Urel"<<"核查类型"<<"是否为基准点(1/0)"<<"循环次数" <<"电阻值/频率"<<"电阻值单位/频率单位"<<"核查项备注"; + return result; } //根据id获取装置名称 @@ -436,9 +470,9 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " - " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id " - " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); +bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " + " JOIN sys_dept ON sys_dept.ID = eei.dept_id " + " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); if (isSuccess) { while (query.next()) { TestedDevice testedDevice; @@ -504,9 +538,10 @@ //判断 哪个 装置表 传参 设备id QList BaseCommonApi::getJudgeCalibrationTable(QString id) { + id="1716997603953311746"; QList result; QSqlQuery query; - query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = ':id')"); + query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = :id )"); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -526,12 +561,55 @@ return result; } +//标准装置字典类型 +/** + * 多功能校准源标准装置 = 1 + * 直流稳压电源检定装置 = 2 + * 多功能电气安全校准器标准装置 = 3 + * 0.02级活塞式压力计标准装置 = 4 + * 二等铂电阻温度计标准装置 = 5 + * 安全阀校验装置 = 6 + * 精密露点仪标准装置 = 7 + * E2等级砝码标准装置 = 8 + * 频谱分析仪标准装置 = 9 + * 信号发生器标准装置 = 10 + * 微波衰减标准装置 = 11 + * 频率短期稳定度标准装置 =12 + * 示波器标准装置 = 13 + * 铯原子频率标准装置 =14 + * 小功率标准装置 = 15 + * 低频信号发生器标准装置 = 16 + * S参数标准装置 = 17 + * 失真度标准装置 = 18 + */ +//根据被检设备ID获取当前设备的 核查项目及核查点 + +QList BaseCommonApi::Search_CalibrationTable(QString DeiverId,QStringList *HeadList) +{ + + QList DataList; + DataList.clear(); + QList CliTable=BaseCommonApi::getJudgeCalibrationTable(DeiverId); + if(CliTable.count()==0)return DataList; + switch (CliTable[0].belong_standard_equipment.toInt()) + { + case 1: + + //CliTable[0].item_category_id + DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList); + break; + } + + return DataList; +} //被检设备管理-检定项目及检定点-多功能校准源 -QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) +QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) { -QList result; +QList resultData; +QStringList result; +resultData.clear(); QSqlQuery query; query.prepare("SELECT bbdmidc.id ,bbdmidc.params ,bbdmidc.capacity ,bbdmidc.unit ,bbdmidc.frequency , bbdmidc.range_range , bbdmidc.standard_value , bbdmidc.resolution , bbdmidc.maximum_error , bbdmidc.error_param_a , bbdmidc.error_param_b " @@ -542,26 +620,24 @@ if (query.exec()) { while (query.next()) { - VerMultiCal calibration; - calibration.id = query.value("id").toString(); - calibration.params = query.value("params").toString(); - calibration.capacity = query.value("capacity").toString(); - calibration.unit = query.value("unit").toString(); - calibration.frequency = query.value("frequency").toString(); - calibration.range_range = query.value("range_range").toString(); - calibration.standard_value = query.value("standard_value").toString(); - calibration.resolution = query.value("resolution").toString(); - calibration.maximum_error = query.value("maximum_error").toString(); - calibration.error_param_a = query.value("error_param_a").toString(); - calibration.error_param_b = query.value("error_param_b").toString(); - - result.append(calibration); + result.clear(); + result.append(query.value("id").toString()); + result.append(query.value("params").toString()); + result.append(query.value("capacity").toString()); + result.append(query.value("unit").toString()); + result.append(query.value("frequency").toString()); + result.append(query.value("range_range").toString()); + result.append(query.value("standard_value").toString()); + result.append(query.value("resolution").toString()); + result.append(query.value("maximum_error").toString()); + result.append(query.value("error_param_a").toString()); + result.append(query.value("error_param_b").toString()); + resultData.append(result); } } else { qDebug() << "Query execution failed: " << query.lastError().text(); } - *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; - return result; + *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; } //检定数据管理 首页 @@ -757,7 +833,7 @@ " LEFT JOIN biz_equipment_standard_check_info besci ON besci.item_category_id = bescidc.item_category_id " " WHERE bescidc.equipment_id = :equipment_id "); - // 将参数绑定到占位符 '1692796512381222914' + // 将参数绑定到占位符 1692796512381222914 query.bindValue(":equipment_id", equipment_id); if (query.exec()) { while (query.next()) { @@ -788,12 +864,13 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " + bool isSuccess = query.exec("SELECT brtf.id,brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " " FROM biz_resource_technique_file brtf"); if (isSuccess) { while (query.next()) { Technique_File file; + file.id=query.value("id").toString(); file.file_distribute_no = query.value("file_distribute_no").toString(); file.file_name = query.value("file_name").toString(); file.version_no = query.value("version_no").toString(); @@ -876,7 +953,7 @@ QList result; QSqlQuery query; query.prepare("SELECT id,device_id ,communication_type ,serial_port ,visa ,create_time ,update_time " - "FROM zd_communication_setting WHERE device_id = ' :deviceId '"); + "FROM zd_communication_setting WHERE device_id = :deviceId "); query.bindValue(":deviceId", deviceId); if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h index 1b70cb9..ff8a320 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.h +++ b/softwareDirectory/AutoVerScheme/basecommonapi.h @@ -9,7 +9,7 @@ #include "databaseconnection.h" #include "id\IdWorker.h" - +#include "QStringList" //部门任务 @@ -52,6 +52,7 @@ QDateTime require_over_time; QString deliverer; QString is_urgent; + }; //创建任务单-查看任务单 class CatTask @@ -241,9 +242,15 @@ QString belong_standard_equipment; }; +class BaseEntity: public QObject +{ + Q_OBJECT + public: + +}; //被检设备管理-检定项目及检定点-检定项多功能校准源 -class VerMultiCal +class VerMultiCal:public BaseEntity { public: QString id; @@ -365,6 +372,7 @@ class Technique_File { public: + QString id; QString file_distribute_no; QString file_name; QString version_no; @@ -444,12 +452,22 @@ public: BaseCommonApi(); + // + static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList); + //部门任务 + static QList getAllData(); + //部门任务 参数登录用户的id static QList getAllData(QString userId); + //我的任务 static QList getMyTasks(QString id); //获取创建任务首页数据 - static QListgetCreateTaskList(QString id); + + static QListgetCreateTaskList(QString userId); + + + //创建任务-查看任务单顶部 static QListgetCatTask(QString orderNo); //创建任务-查看任务列表底部 @@ -479,7 +497,10 @@ //判断 哪个 装置表 传参 设备id 返回itemId static QList getJudgeCalibrationTable(QString id); //被检设备管理-检定项目及检定点-多功能校准源 - static QList getVerMultiCal(QString itemId,QStringList *headList); + + + static QList getVerMultiCal(QString itemId,QStringList *headList); + // 获取检定数据管理 首页 static QList getVerificationData(); // 检定数据管理-检定基本信息 @@ -494,6 +515,7 @@ static QList getCheckDataManageResultManageMult(QString equipment_id); //技术文件 static QList getTechnique_File(); + //检定程序管理首页查询 static QList getVerificationProgramInfoMain(); //检定程序管理 编辑 @@ -525,7 +547,6 @@ IdWorker &idWorker = Singleton::instance(); //自动检定 - }; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp index c3b2786..70148f4 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp @@ -4,6 +4,7 @@ #include "basecommonapi.h" //#include "tested_device_manage_serve.h" +#include "QStringList" //被检设备 BeExamined_DeviceItem::BeExamined_DeviceItem(QWidget *parent) : @@ -32,19 +33,32 @@ "}"); // ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); // item->setTextAlignment(Qt::AlignCenter); //ui->tableWidget->setItem(0, 0, item); //设置数据 - + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" + headers << "ID" << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" << "生产厂家"<<"所在单位" <<"使用部门"<<"计量标识"<<"检定周期"<<"证书有效期"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); + //详情页面tableWidgetItem设置 + ui->tableWidgetItem->setStyleSheet("QHeaderView::section {" + "border: 1px solid rgba(197, 196, 196, 1);" + "border-left:none;" + "border-top:none;" + "background-color:white;" + "}"); + + // ui->tableWidget->setRowCount(10); // 设置10行 + //ui->tableWidgetItem->setColumnCount(14); // 设置11列 + ui->tableWidgetItem->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 + ui->tableWidgetItem->verticalHeader()->setParent(nullptr); //隐藏行头 + } void BeExamined_DeviceItem::ShowMessageBox(QString title,QString value) { // 创建一个QMessageBox对象 @@ -64,24 +78,19 @@ } void BeExamined_DeviceItem::Load() { - //获取主页面内容 - //进入主页面 - /* - ui->stackedWidget->setCurrentIndex(0); + // ======================================================================================== + // 主页面初始化 + // ==================================================================================== + + + ui->stackedWidget->setCurrentIndex(0); //先设置为行为0 ui->tableWidget->setRowCount(0); - - - // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BeExamined_DeviceItem dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; int row=0; - QList data = dbManager.getBizDeviceManage(); - - - for (const BizDevice& bizDevice : data) { + QList data = dbManager.getTestedDevice(); + for (const TestedDevice& bizDevice : data) { rowCount = ui->tableWidget->rowCount(); ui->tableWidget->insertRow(rowCount); @@ -89,34 +98,118 @@ ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); ui->tableWidget->setItem(row, 2, new QTableWidgetItem(bizDevice.equipment_name)); ui->tableWidget->setItem(row, 3, new QTableWidgetItem(bizDevice.model)); - ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacture_no)); - ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.help_instruction)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacture_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(bizDevice.FULL_NAME)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(bizDevice.meter_identify)); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem(bizDevice.check_cycle)); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(bizDevice.certificate_valid)); + //添加操作按钮 QPushButton *button = new QPushButton("查看"); - ui->tableWidget->setCellWidget(row, 6, button); + ui->tableWidget->setCellWidget(row, 12, button); //设置按钮简单样式 button->setStyleSheet("QPushButton {" - " border: none; /* 无边框 "*/ - // " color: green; /* 文本颜色 */" - // " text-decoration: underline; /* 文本下划线 */" - // "}"); + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); // 设置鼠标悬停时的光标样式为小手图标 - // button->setCursor(Qt::PointingHandCursor); + button->setCursor(Qt::PointingHandCursor); // 连接按钮的 clicked 信号到自定义槽函数 - // connect(button, &QPushButton::clicked, this, [this, button, row]() { - // 获取当前行第一列的 ID - // QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); - // if (idItem) { - // QString id = idItem->text(); -// - // OnButtonSelectClicked(id); - // } + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); - // }); + OnButtonSelectClicked(id); + } - // row++; - - // } + }); + row++; + } } +void BeExamined_DeviceItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + + DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +//返回按钮 +void BeExamined_DeviceItem::on_pushButton_2_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); +} +void BeExamined_DeviceItem::DeviceInfoInit(QString id) +{ + // ======================================================================================== + // 初始化详情 + // ==================================================================================== + + QList data = dbManager.getTestedCatDevice(id); + for (const TestedCatDevice& testedCatDevice : data) { + + ui->equipment_name->setText(testedCatDevice.equipment_name); + ui->model->setText(testedCatDevice.model); + ui->help_instruction->setText(testedCatDevice.help_instruction); + ui->manufacture_no->setText(testedCatDevice.manufacture_no); + ui->product_country->setText(testedCatDevice.product_country); + ui->manufacturer->setText(testedCatDevice.manufacturer); + ui->product_date->setText(testedCatDevice.product_date); + ui->purchase_date->setText(testedCatDevice.purchase_date); + ui->unit_price->setText(testedCatDevice.unit_price); + ui->usage_status->setText(testedCatDevice.usage_status); + ui->quality_condition->setText(testedCatDevice.quality_condition); + ui->dept_name->setText(testedCatDevice.FULL_NAME); + ui->category->setText(testedCatDevice.category); + ui->check_cycle->setText(testedCatDevice.check_cycle); + ui->level->setText(testedCatDevice.level); + ui->remark->setText(testedCatDevice.remark); + } + + + // ======================================================================================== + // 初始化检定项目及核查点 + // ==================================================================================== + + //获取核查点tablewight的数据 + QStringList headlist; + + QList Data=dbManager.Search_CalibrationTable(id,&headlist); + + //tableWidgetItem + ui->tableWidgetItem->setRowCount(0); + ui->tableWidgetItem->setColumnCount(headlist.count()); + ui->tableWidgetItem->setHorizontalHeaderLabels(headlist); + //循环数据 + int rowCount=0; + int row=0; + ; + for (const QStringList& item : Data) + { + //获取行号 并进行添加行 + rowCount = ui->tableWidgetItem->rowCount(); + ui->tableWidgetItem->insertRow(rowCount); + //添加 序号 + ui->tableWidgetItem->setItem(row, 0, new QTableWidgetItem(QString::number(row+1))); + //循环读取值 headlist,count是列的数量 + for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型 + } + + row++; + + } +} + + + diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h index ffdc22a..0050ee7 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h @@ -21,6 +21,11 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + + void DeviceInfoInit(QString id); + + void on_pushButton_2_clicked(); private: Ui::BeExamined_DeviceItem *ui; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui index ce63879..cdacfaf 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui @@ -215,6 +215,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -225,6 +230,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 @@ -391,7 +401,7 @@ - + ForbiddenCursor @@ -412,7 +422,7 @@ - + ForbiddenCursor @@ -428,12 +438,12 @@ - 出厂编号: + 辅助字段: - + ForbiddenCursor @@ -449,12 +459,12 @@ - 检定有效期: + 出厂编号: - + ForbiddenCursor @@ -475,7 +485,7 @@ - + ForbiddenCursor @@ -496,7 +506,7 @@ - + ForbiddenCursor @@ -517,7 +527,7 @@ - + ForbiddenCursor @@ -538,7 +548,7 @@ - + ForbiddenCursor @@ -552,14 +562,14 @@ - + - 使用年限: + 设备单价: - + ForbiddenCursor @@ -573,14 +583,14 @@ - + - 设备单价: + 使用状态: - + ForbiddenCursor @@ -594,14 +604,14 @@ - + - 使用状态: + 质量状况: - + ForbiddenCursor @@ -615,14 +625,14 @@ - + - 质量状况: + 所在单位: - + ForbiddenCursor @@ -638,12 +648,12 @@ - 所属部门: + 使用部门: - + ForbiddenCursor @@ -657,14 +667,14 @@ - + - 负责人: + 设备分类: - + ForbiddenCursor @@ -678,14 +688,14 @@ - + - 设备供方: + 检定周期: - + ForbiddenCursor @@ -699,14 +709,14 @@ - + - 位置信息: + 重要等级: - + ForbiddenCursor @@ -720,140 +730,14 @@ - - - 设备类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 标准类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 设备分类: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 重要等级: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 检定周期: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 对应开箱记录: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - 备注: - - + + ForbiddenCursor @@ -892,7 +776,7 @@ - + diff --git a/softwareDirectory/AutoVerScheme/create_task.cpp b/softwareDirectory/AutoVerScheme/create_task.cpp index 9b49a1a..ddd78ef 100644 --- a/softwareDirectory/AutoVerScheme/create_task.cpp +++ b/softwareDirectory/AutoVerScheme/create_task.cpp @@ -2,12 +2,15 @@ #include "ui_create_task.h" #include "QMessageBox" + + QString Create_Task::State=""; Create_Task::Create_Task(QWidget *parent) : InfoBase(parent), ui(new Ui::Create_Task) { ui->setupUi(this); this->initForm(); + } Create_Task::~Create_Task() @@ -25,17 +28,19 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(8); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(9); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "任务单编号" << "委托方"<< "使用部门" << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; + headers <<"ID"<< "序号" << "任务单编号" << "委托方"<< "使用部门" + << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); //ShowMessageBox("标题","初始化完成"); } @@ -57,5 +62,171 @@ } void Create_Task::Load() { - //ShowMessageBox("创建任务界面","创建任务界面初始化完成"); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + + QList data = BaseCommonApi::getCreateTaskList(""); + + int rowCount = 0; + int row=0; + QString is_urgent; + for (const CreateTaskList& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.order_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.customer_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.DEPT_FULL_NAME)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.require_over_time.toString())); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.deliverer)); + if(item.is_urgent=="1") + is_urgent="是"; + else + is_urgent="否"; + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(is_urgent)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("查看"); + QPushButton *button2 = new QPushButton("编辑"); + QPushButton *button3 = new QPushButton("删除"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + Create_Task::State="Select"; + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonUpdateClicked(id); + Create_Task::State="Update"; + } + + }); + //设置按钮3简单样式 + button3->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: red; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button3->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button3, &QPushButton::clicked, this, [this, button3, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtoDeleteClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->addWidget(button3); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 8, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void Create_Task::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + HiddenButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "查看按钮ID",id); +} +void Create_Task::OnButtonUpdateClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "编辑按钮ID",id); +} +void Create_Task::OnButtoDeleteClicked(QString id) +{ + // ======================================================================================== + // 删除按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + + QMessageBox::information(this, "删除按钮ID",id); +} + +void Create_Task::on_pushButton_2_clicked() +{ + // ======================================================================================== + // 创建任务单按钮 + // ==================================================================================== + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + Create_Task::State="Create"; +} +void Create_Task::HiddenButton() +{ + ui->SaveButton->hide(); + ui->CreateButton->hide(); + ui->ScanButton->hide(); + ui->deletebutton->hide(); +} +void Create_Task::DisplayButton() +{ + ui->SaveButton->show(); + ui->CreateButton->show(); + ui->ScanButton->show(); + ui->deletebutton->show(); +} + +void Create_Task::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/create_task.h b/softwareDirectory/AutoVerScheme/create_task.h index 7cf383f..6b67c7c 100644 --- a/softwareDirectory/AutoVerScheme/create_task.h +++ b/softwareDirectory/AutoVerScheme/create_task.h @@ -16,11 +16,22 @@ explicit Create_Task(QWidget *parent = nullptr); ~Create_Task(); + //全局静态变量 + static QString State; private slots: void initForm(); //初始化界面数据 void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonUpdateClicked(QString id); + void OnButtoDeleteClicked(QString id); + void on_pushButton_2_clicked(); + void HiddenButton(); + void DisplayButton(); + + void on_pushButton_clicked(); + private: Ui::Create_Task *ui; }; diff --git a/softwareDirectory/AutoVerScheme/create_task.ui b/softwareDirectory/AutoVerScheme/create_task.ui index d9d88ed..b45af33 100644 --- a/softwareDirectory/AutoVerScheme/create_task.ui +++ b/softwareDirectory/AutoVerScheme/create_task.ui @@ -19,278 +19,651 @@ - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 1 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 任务单编号: - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - 委托方: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 使用部门: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 要求完成时间: - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(3, 58, 132); + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 任务单编号: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 委托方: + + + + + + + + + + 使用部门: + + + + + + + + + + 要求检完时间: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); color:white; - - - 查询 - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(207, 132, 33); + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); color:white; - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - 6 + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + 3 + + + + + + 50 + 40 + + + + + 100 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 创建任务单 + + + + + + + + + + + + + + + + + + + + + color:black; - - 9 - - - 9 - - - 9 - - - - - - 0 - 0 - - - - - 120 - 40 - - - - OpenHandCursor - - - Qt::DefaultContextMenu - - - Qt::RightToLeft - - - false - - - background-color:rgb(9, 89, 179); + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 创建任务单 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 保存 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; color:white; - - - 创建任务单 - - - true - - - - - - - - - - - - - - SizeVerCursor - - - - - - - + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接人: + + + + + + + 要求检完时间: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 是否加急: + + + + + + + 电话: + + + + + + + 委托方: + + + + + + + 任务单编号: + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接时间: + + + + + + + 送检人: + + + + + + + 接收说明: + + + + + + + 使用部门: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + 任务单列表: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 扫描增加 + + + false + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 增加行 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 删除行 + + + + + + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/depar_task.ui b/softwareDirectory/AutoVerScheme/depar_task.ui index efb7561..f44829d 100644 --- a/softwareDirectory/AutoVerScheme/depar_task.ui +++ b/softwareDirectory/AutoVerScheme/depar_task.ui @@ -213,86 +213,6 @@ - - - 12 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - diff --git a/softwareDirectory/AutoVerScheme/infomanageview.ui b/softwareDirectory/AutoVerScheme/infomanageview.ui index ef0b87b..cb76a28 100644 --- a/softwareDirectory/AutoVerScheme/infomanageview.ui +++ b/softwareDirectory/AutoVerScheme/infomanageview.ui @@ -20,7 +20,7 @@ color:black; background-color:rgba(240, 240, 240, 1); - + 0 @@ -37,77 +37,124 @@ 0 - - - - 0 - 0 - - - - - 170 - 0 - - - - - 16777215 - 16777215 - - + - color:White; - font-weight: bold; - font-size: 16px; -background-color:rgba(10, 15, 92, 1); + border-image: url(:/image/Index/u15.png); - - true - - - - - 0 - 0 - 170 - 625 - - - - - 0 - 0 - - - - - 170 - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - + + + + + + 50 + 50 + + + + + 35 + 35 + + + + image: url(:/image/Index/u2158.svg); + + + + + + + + + + color:white; +font-size:18px; +font-weight:bold; + + + 信息管理 + + + + - + + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 16777215 + 16777215 + + + + color:White; + font-weight: bold; + font-size: 16px; +background-color:rgba(10, 15, 92, 1); + + + true + + + + + 0 + 0 + 170 + 570 + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp index efc00ba..eea27f0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp @@ -25,17 +25,17 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 - + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0,0); //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "出厂编号" + headers <<"ID"<< "序号" << "设备名称" << "型号规则" << "出厂编号" <<"核查件名称"<<"核查件型号"<<"核查件编号" <<"核查员" << "核查日期" <<"实验室"<<"部门"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); @@ -58,5 +58,114 @@ } void InspectDataItem::Load() { - //ShowMessageBox("核查数据","核查数据"); + // ======================================================================================== + // 主页面初始化 核查管理初始化 + // ==================================================================================== + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + // 调用数据库管理器的函数获取数据 + int rowCount=0; + int row=0; + QList data = dbManager.getCheckData(); + for (const CheckData& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.equipment_name)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.model)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.manufacture_no)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.meter_standard_name)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(item.meter_standard_id)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(item.create_user_name)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(item.check_date.toString())); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(item.dept_name)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("详情"); + QPushButton *button2 = new QPushButton("预览"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonPreViewtClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 12, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void InspectDataItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +void InspectDataItem::OnButtonPreViewtClicked(QString id) +{ + // ======================================================================================== + // 预览按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} + +void InspectDataItem::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.h b/softwareDirectory/AutoVerScheme/inspectdataitem.h index bdf7066..6644339 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.h +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.h @@ -20,6 +20,10 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonPreViewtClicked(QString id); + void on_pushButton_clicked(); + private: Ui::InspectDataItem *ui; }; diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.ui b/softwareDirectory/AutoVerScheme/inspectdataitem.ui index 86786c9..3f319c0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.ui +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.ui @@ -7,232 +7,928 @@ 0 0 1362 - 543 + 553 Form - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 0 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 设备名称: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 型号规则: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 出厂编号: - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 核查员: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 核查日期: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 实验室: - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - Qt::RightToLeft - - - 查询 - - - - - - - Qt::RightToLeft - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - - - - - - - - - - + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 设备名称: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 型号规则: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 出厂编号: + + + + + + + + 0 + 0 + + + + + + + + 核查员: + + + + + + + + + + 实验室: + + + + + + + + + + 核查日期: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + + + + + + + + + + + + + + + + + color:black; + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 核查数据详情 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; +color:white; + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + 设备基本信息: + + + + + + + 设备名称: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 型号规格: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 出厂编号: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定有效期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产国家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产厂家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 购进日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用年限: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备单价: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用状态: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 质量状况: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 所属部门: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 负责人: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备供方: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 位置信息: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 标准类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备分类: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 重要等级: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定周期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 对应开箱记录: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 备注: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + 3 + + + false + + + Qt::LogicalMoveStyle + + + + + + + + + + + + + + + + 核查项目及核查点: + + + + + + + + + + + + + + 0 + 0 + + + + + 30 + 0 + + + + + + + + + + false + + + + 6 + + + 0 + + + 0 + + + 0 + + + 6 + + + + + 检定项备注: + + + + + + + background-color: #f0f0f0; +color: grey; + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/my_task.ui b/softwareDirectory/AutoVerScheme/my_task.ui index a078840..e04a336 100644 --- a/softwareDirectory/AutoVerScheme/my_task.ui +++ b/softwareDirectory/AutoVerScheme/my_task.ui @@ -157,6 +157,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -167,6 +172,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/InfoBase.h b/softwareDirectory/AutoVerScheme/InfoBase.h index 6dd59f3..bce9609 100644 --- a/softwareDirectory/AutoVerScheme/InfoBase.h +++ b/softwareDirectory/AutoVerScheme/InfoBase.h @@ -4,6 +4,7 @@ #include #include "QStandardItemModel" #include "databaseconnection.h" +#include "basecommonapi.h" ///信号管理页面的基类 所有信息管理页面都继承于InfoBase /// 便于统一管理 所有子类必须实现Load方法 /// 每次按钮点击切换都会调用Load方法 用于每次页面的数据刷新 @@ -16,7 +17,7 @@ //QStandardItemModel 的实例。这个模型将用于存储和管理数据。 QStandardItemModel *model; //信息管理页面 基类定义Conn对象 - DatabaseConnection *Conn=DatabaseConnection::getInstance(); + BaseCommonApi dbManager; }; #endif // INFOBASE_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index f62915b..6170ee7 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -15,7 +15,7 @@ " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id " " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID " " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID " - " WHERE sys_user.ID = ' :userId '"); + " WHERE sys_user.ID = :userId"); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -75,6 +75,35 @@ } return result; } + +//获取创建任务首页数据 +QList BaseCommonApi::getCreateTaskList(QString userId) +{ + userId="1640229293790650370"; + QList result; + QSqlQuery query; + query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " + " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " + " WHERE bi.create_user_id = :userId"); + // 将参数绑定到占位符 + query.bindValue(":userId", userId); + if (query.exec()) { + while (query.next()) { + CreateTaskList task; + task.id = query.value("id").toString(); + task.order_no = query.value("order_no").toString(); + task.customer_name = query.value("customer_name").toString(); + task.DEPT_FULL_NAME = query.value("FULL_NAME").toString(); + task.require_over_time = query.value("require_over_time").toDateTime(); + task.deliverer = query.value("deliverer").toString(); + task.is_urgent = query.value("is_urgent").toString(); + result.append(task); + } + } else { + qDebug() << "Query execution failed: " << query.lastError().text(); + } + return result; +} //获取创建任务首页数据 QListgetCreateTaskList(QString userId) { @@ -82,7 +111,7 @@ QSqlQuery query; query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " - " WHERE bi.create_user_id = ':userId' "); + " WHERE bi.create_user_id = :userId "); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -103,6 +132,7 @@ return result; } + //创建任务单-查看/编辑 顶部数据 传参该条数据的id QListBaseCommonApi::getCatTask(QString id) { @@ -111,7 +141,7 @@ query.prepare("SELECT bi.order_no ,bi.customer_name ,dept.FULL_NAME ,bi.require_over_time ," " bi.deliverer ,bi.deliverer_tel ,bi.undertaker_name ,bi.undertake_time , bi.is_urgent AS ," " bi.receive_illustrate FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID" - " WHERE bi.id = ' :id '"); + " WHERE bi.id = :id "); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -140,6 +170,7 @@ //获取创建任务 -任务单列表 + QListBaseCommonApi::getCatTaskList(QString orderId) { QList result; @@ -380,6 +411,7 @@ QListBaseCommonApi::getCheckDCPower(QString equipment_id,QStringList *headList) { + equipment_id="1693435753272557570"; QList result; QSqlQuery query; query.prepare("SELECT besciddp.id ,besciddp.params,besciddp.unit,resolution,besciddp.urel,besciddp.check_type,datum_point,cycle_number " @@ -407,9 +439,11 @@ } else { qDebug() << "Query execution failed: " << query.lastError().text(); } + *headList <<"序号"<<"核查项目"<<"核查点"<<"单位"<<"分辨力"<<"Urel"<<"核查类型"<<"是否为基准点(1/0)"<<"循环次数" <<"电阻值/频率"<<"电阻值单位/频率单位"<<"核查项备注"; + return result; } //根据id获取装置名称 @@ -436,9 +470,9 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " - " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id " - " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); +bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " + " JOIN sys_dept ON sys_dept.ID = eei.dept_id " + " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); if (isSuccess) { while (query.next()) { TestedDevice testedDevice; @@ -504,9 +538,10 @@ //判断 哪个 装置表 传参 设备id QList BaseCommonApi::getJudgeCalibrationTable(QString id) { + id="1716997603953311746"; QList result; QSqlQuery query; - query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = ':id')"); + query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = :id )"); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -526,12 +561,55 @@ return result; } +//标准装置字典类型 +/** + * 多功能校准源标准装置 = 1 + * 直流稳压电源检定装置 = 2 + * 多功能电气安全校准器标准装置 = 3 + * 0.02级活塞式压力计标准装置 = 4 + * 二等铂电阻温度计标准装置 = 5 + * 安全阀校验装置 = 6 + * 精密露点仪标准装置 = 7 + * E2等级砝码标准装置 = 8 + * 频谱分析仪标准装置 = 9 + * 信号发生器标准装置 = 10 + * 微波衰减标准装置 = 11 + * 频率短期稳定度标准装置 =12 + * 示波器标准装置 = 13 + * 铯原子频率标准装置 =14 + * 小功率标准装置 = 15 + * 低频信号发生器标准装置 = 16 + * S参数标准装置 = 17 + * 失真度标准装置 = 18 + */ +//根据被检设备ID获取当前设备的 核查项目及核查点 + +QList BaseCommonApi::Search_CalibrationTable(QString DeiverId,QStringList *HeadList) +{ + + QList DataList; + DataList.clear(); + QList CliTable=BaseCommonApi::getJudgeCalibrationTable(DeiverId); + if(CliTable.count()==0)return DataList; + switch (CliTable[0].belong_standard_equipment.toInt()) + { + case 1: + + //CliTable[0].item_category_id + DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList); + break; + } + + return DataList; +} //被检设备管理-检定项目及检定点-多功能校准源 -QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) +QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) { -QList result; +QList resultData; +QStringList result; +resultData.clear(); QSqlQuery query; query.prepare("SELECT bbdmidc.id ,bbdmidc.params ,bbdmidc.capacity ,bbdmidc.unit ,bbdmidc.frequency , bbdmidc.range_range , bbdmidc.standard_value , bbdmidc.resolution , bbdmidc.maximum_error , bbdmidc.error_param_a , bbdmidc.error_param_b " @@ -542,26 +620,24 @@ if (query.exec()) { while (query.next()) { - VerMultiCal calibration; - calibration.id = query.value("id").toString(); - calibration.params = query.value("params").toString(); - calibration.capacity = query.value("capacity").toString(); - calibration.unit = query.value("unit").toString(); - calibration.frequency = query.value("frequency").toString(); - calibration.range_range = query.value("range_range").toString(); - calibration.standard_value = query.value("standard_value").toString(); - calibration.resolution = query.value("resolution").toString(); - calibration.maximum_error = query.value("maximum_error").toString(); - calibration.error_param_a = query.value("error_param_a").toString(); - calibration.error_param_b = query.value("error_param_b").toString(); - - result.append(calibration); + result.clear(); + result.append(query.value("id").toString()); + result.append(query.value("params").toString()); + result.append(query.value("capacity").toString()); + result.append(query.value("unit").toString()); + result.append(query.value("frequency").toString()); + result.append(query.value("range_range").toString()); + result.append(query.value("standard_value").toString()); + result.append(query.value("resolution").toString()); + result.append(query.value("maximum_error").toString()); + result.append(query.value("error_param_a").toString()); + result.append(query.value("error_param_b").toString()); + resultData.append(result); } } else { qDebug() << "Query execution failed: " << query.lastError().text(); } - *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; - return result; + *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; } //检定数据管理 首页 @@ -757,7 +833,7 @@ " LEFT JOIN biz_equipment_standard_check_info besci ON besci.item_category_id = bescidc.item_category_id " " WHERE bescidc.equipment_id = :equipment_id "); - // 将参数绑定到占位符 '1692796512381222914' + // 将参数绑定到占位符 1692796512381222914 query.bindValue(":equipment_id", equipment_id); if (query.exec()) { while (query.next()) { @@ -788,12 +864,13 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " + bool isSuccess = query.exec("SELECT brtf.id,brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " " FROM biz_resource_technique_file brtf"); if (isSuccess) { while (query.next()) { Technique_File file; + file.id=query.value("id").toString(); file.file_distribute_no = query.value("file_distribute_no").toString(); file.file_name = query.value("file_name").toString(); file.version_no = query.value("version_no").toString(); @@ -876,7 +953,7 @@ QList result; QSqlQuery query; query.prepare("SELECT id,device_id ,communication_type ,serial_port ,visa ,create_time ,update_time " - "FROM zd_communication_setting WHERE device_id = ' :deviceId '"); + "FROM zd_communication_setting WHERE device_id = :deviceId "); query.bindValue(":deviceId", deviceId); if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h index 1b70cb9..ff8a320 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.h +++ b/softwareDirectory/AutoVerScheme/basecommonapi.h @@ -9,7 +9,7 @@ #include "databaseconnection.h" #include "id\IdWorker.h" - +#include "QStringList" //部门任务 @@ -52,6 +52,7 @@ QDateTime require_over_time; QString deliverer; QString is_urgent; + }; //创建任务单-查看任务单 class CatTask @@ -241,9 +242,15 @@ QString belong_standard_equipment; }; +class BaseEntity: public QObject +{ + Q_OBJECT + public: + +}; //被检设备管理-检定项目及检定点-检定项多功能校准源 -class VerMultiCal +class VerMultiCal:public BaseEntity { public: QString id; @@ -365,6 +372,7 @@ class Technique_File { public: + QString id; QString file_distribute_no; QString file_name; QString version_no; @@ -444,12 +452,22 @@ public: BaseCommonApi(); + // + static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList); + //部门任务 + static QList getAllData(); + //部门任务 参数登录用户的id static QList getAllData(QString userId); + //我的任务 static QList getMyTasks(QString id); //获取创建任务首页数据 - static QListgetCreateTaskList(QString id); + + static QListgetCreateTaskList(QString userId); + + + //创建任务-查看任务单顶部 static QListgetCatTask(QString orderNo); //创建任务-查看任务列表底部 @@ -479,7 +497,10 @@ //判断 哪个 装置表 传参 设备id 返回itemId static QList getJudgeCalibrationTable(QString id); //被检设备管理-检定项目及检定点-多功能校准源 - static QList getVerMultiCal(QString itemId,QStringList *headList); + + + static QList getVerMultiCal(QString itemId,QStringList *headList); + // 获取检定数据管理 首页 static QList getVerificationData(); // 检定数据管理-检定基本信息 @@ -494,6 +515,7 @@ static QList getCheckDataManageResultManageMult(QString equipment_id); //技术文件 static QList getTechnique_File(); + //检定程序管理首页查询 static QList getVerificationProgramInfoMain(); //检定程序管理 编辑 @@ -525,7 +547,6 @@ IdWorker &idWorker = Singleton::instance(); //自动检定 - }; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp index c3b2786..70148f4 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp @@ -4,6 +4,7 @@ #include "basecommonapi.h" //#include "tested_device_manage_serve.h" +#include "QStringList" //被检设备 BeExamined_DeviceItem::BeExamined_DeviceItem(QWidget *parent) : @@ -32,19 +33,32 @@ "}"); // ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); // item->setTextAlignment(Qt::AlignCenter); //ui->tableWidget->setItem(0, 0, item); //设置数据 - + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" + headers << "ID" << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" << "生产厂家"<<"所在单位" <<"使用部门"<<"计量标识"<<"检定周期"<<"证书有效期"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); + //详情页面tableWidgetItem设置 + ui->tableWidgetItem->setStyleSheet("QHeaderView::section {" + "border: 1px solid rgba(197, 196, 196, 1);" + "border-left:none;" + "border-top:none;" + "background-color:white;" + "}"); + + // ui->tableWidget->setRowCount(10); // 设置10行 + //ui->tableWidgetItem->setColumnCount(14); // 设置11列 + ui->tableWidgetItem->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 + ui->tableWidgetItem->verticalHeader()->setParent(nullptr); //隐藏行头 + } void BeExamined_DeviceItem::ShowMessageBox(QString title,QString value) { // 创建一个QMessageBox对象 @@ -64,24 +78,19 @@ } void BeExamined_DeviceItem::Load() { - //获取主页面内容 - //进入主页面 - /* - ui->stackedWidget->setCurrentIndex(0); + // ======================================================================================== + // 主页面初始化 + // ==================================================================================== + + + ui->stackedWidget->setCurrentIndex(0); //先设置为行为0 ui->tableWidget->setRowCount(0); - - - // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BeExamined_DeviceItem dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; int row=0; - QList data = dbManager.getBizDeviceManage(); - - - for (const BizDevice& bizDevice : data) { + QList data = dbManager.getTestedDevice(); + for (const TestedDevice& bizDevice : data) { rowCount = ui->tableWidget->rowCount(); ui->tableWidget->insertRow(rowCount); @@ -89,34 +98,118 @@ ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); ui->tableWidget->setItem(row, 2, new QTableWidgetItem(bizDevice.equipment_name)); ui->tableWidget->setItem(row, 3, new QTableWidgetItem(bizDevice.model)); - ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacture_no)); - ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.help_instruction)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacture_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(bizDevice.FULL_NAME)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(bizDevice.meter_identify)); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem(bizDevice.check_cycle)); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(bizDevice.certificate_valid)); + //添加操作按钮 QPushButton *button = new QPushButton("查看"); - ui->tableWidget->setCellWidget(row, 6, button); + ui->tableWidget->setCellWidget(row, 12, button); //设置按钮简单样式 button->setStyleSheet("QPushButton {" - " border: none; /* 无边框 "*/ - // " color: green; /* 文本颜色 */" - // " text-decoration: underline; /* 文本下划线 */" - // "}"); + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); // 设置鼠标悬停时的光标样式为小手图标 - // button->setCursor(Qt::PointingHandCursor); + button->setCursor(Qt::PointingHandCursor); // 连接按钮的 clicked 信号到自定义槽函数 - // connect(button, &QPushButton::clicked, this, [this, button, row]() { - // 获取当前行第一列的 ID - // QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); - // if (idItem) { - // QString id = idItem->text(); -// - // OnButtonSelectClicked(id); - // } + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); - // }); + OnButtonSelectClicked(id); + } - // row++; - - // } + }); + row++; + } } +void BeExamined_DeviceItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + + DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +//返回按钮 +void BeExamined_DeviceItem::on_pushButton_2_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); +} +void BeExamined_DeviceItem::DeviceInfoInit(QString id) +{ + // ======================================================================================== + // 初始化详情 + // ==================================================================================== + + QList data = dbManager.getTestedCatDevice(id); + for (const TestedCatDevice& testedCatDevice : data) { + + ui->equipment_name->setText(testedCatDevice.equipment_name); + ui->model->setText(testedCatDevice.model); + ui->help_instruction->setText(testedCatDevice.help_instruction); + ui->manufacture_no->setText(testedCatDevice.manufacture_no); + ui->product_country->setText(testedCatDevice.product_country); + ui->manufacturer->setText(testedCatDevice.manufacturer); + ui->product_date->setText(testedCatDevice.product_date); + ui->purchase_date->setText(testedCatDevice.purchase_date); + ui->unit_price->setText(testedCatDevice.unit_price); + ui->usage_status->setText(testedCatDevice.usage_status); + ui->quality_condition->setText(testedCatDevice.quality_condition); + ui->dept_name->setText(testedCatDevice.FULL_NAME); + ui->category->setText(testedCatDevice.category); + ui->check_cycle->setText(testedCatDevice.check_cycle); + ui->level->setText(testedCatDevice.level); + ui->remark->setText(testedCatDevice.remark); + } + + + // ======================================================================================== + // 初始化检定项目及核查点 + // ==================================================================================== + + //获取核查点tablewight的数据 + QStringList headlist; + + QList Data=dbManager.Search_CalibrationTable(id,&headlist); + + //tableWidgetItem + ui->tableWidgetItem->setRowCount(0); + ui->tableWidgetItem->setColumnCount(headlist.count()); + ui->tableWidgetItem->setHorizontalHeaderLabels(headlist); + //循环数据 + int rowCount=0; + int row=0; + ; + for (const QStringList& item : Data) + { + //获取行号 并进行添加行 + rowCount = ui->tableWidgetItem->rowCount(); + ui->tableWidgetItem->insertRow(rowCount); + //添加 序号 + ui->tableWidgetItem->setItem(row, 0, new QTableWidgetItem(QString::number(row+1))); + //循环读取值 headlist,count是列的数量 + for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型 + } + + row++; + + } +} + + + diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h index ffdc22a..0050ee7 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h @@ -21,6 +21,11 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + + void DeviceInfoInit(QString id); + + void on_pushButton_2_clicked(); private: Ui::BeExamined_DeviceItem *ui; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui index ce63879..cdacfaf 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui @@ -215,6 +215,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -225,6 +230,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 @@ -391,7 +401,7 @@ - + ForbiddenCursor @@ -412,7 +422,7 @@ - + ForbiddenCursor @@ -428,12 +438,12 @@ - 出厂编号: + 辅助字段: - + ForbiddenCursor @@ -449,12 +459,12 @@ - 检定有效期: + 出厂编号: - + ForbiddenCursor @@ -475,7 +485,7 @@ - + ForbiddenCursor @@ -496,7 +506,7 @@ - + ForbiddenCursor @@ -517,7 +527,7 @@ - + ForbiddenCursor @@ -538,7 +548,7 @@ - + ForbiddenCursor @@ -552,14 +562,14 @@ - + - 使用年限: + 设备单价: - + ForbiddenCursor @@ -573,14 +583,14 @@ - + - 设备单价: + 使用状态: - + ForbiddenCursor @@ -594,14 +604,14 @@ - + - 使用状态: + 质量状况: - + ForbiddenCursor @@ -615,14 +625,14 @@ - + - 质量状况: + 所在单位: - + ForbiddenCursor @@ -638,12 +648,12 @@ - 所属部门: + 使用部门: - + ForbiddenCursor @@ -657,14 +667,14 @@ - + - 负责人: + 设备分类: - + ForbiddenCursor @@ -678,14 +688,14 @@ - + - 设备供方: + 检定周期: - + ForbiddenCursor @@ -699,14 +709,14 @@ - + - 位置信息: + 重要等级: - + ForbiddenCursor @@ -720,140 +730,14 @@ - - - 设备类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 标准类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 设备分类: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 重要等级: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 检定周期: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 对应开箱记录: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - 备注: - - + + ForbiddenCursor @@ -892,7 +776,7 @@ - + diff --git a/softwareDirectory/AutoVerScheme/create_task.cpp b/softwareDirectory/AutoVerScheme/create_task.cpp index 9b49a1a..ddd78ef 100644 --- a/softwareDirectory/AutoVerScheme/create_task.cpp +++ b/softwareDirectory/AutoVerScheme/create_task.cpp @@ -2,12 +2,15 @@ #include "ui_create_task.h" #include "QMessageBox" + + QString Create_Task::State=""; Create_Task::Create_Task(QWidget *parent) : InfoBase(parent), ui(new Ui::Create_Task) { ui->setupUi(this); this->initForm(); + } Create_Task::~Create_Task() @@ -25,17 +28,19 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(8); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(9); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "任务单编号" << "委托方"<< "使用部门" << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; + headers <<"ID"<< "序号" << "任务单编号" << "委托方"<< "使用部门" + << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); //ShowMessageBox("标题","初始化完成"); } @@ -57,5 +62,171 @@ } void Create_Task::Load() { - //ShowMessageBox("创建任务界面","创建任务界面初始化完成"); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + + QList data = BaseCommonApi::getCreateTaskList(""); + + int rowCount = 0; + int row=0; + QString is_urgent; + for (const CreateTaskList& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.order_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.customer_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.DEPT_FULL_NAME)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.require_over_time.toString())); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.deliverer)); + if(item.is_urgent=="1") + is_urgent="是"; + else + is_urgent="否"; + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(is_urgent)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("查看"); + QPushButton *button2 = new QPushButton("编辑"); + QPushButton *button3 = new QPushButton("删除"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + Create_Task::State="Select"; + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonUpdateClicked(id); + Create_Task::State="Update"; + } + + }); + //设置按钮3简单样式 + button3->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: red; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button3->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button3, &QPushButton::clicked, this, [this, button3, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtoDeleteClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->addWidget(button3); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 8, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void Create_Task::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + HiddenButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "查看按钮ID",id); +} +void Create_Task::OnButtonUpdateClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "编辑按钮ID",id); +} +void Create_Task::OnButtoDeleteClicked(QString id) +{ + // ======================================================================================== + // 删除按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + + QMessageBox::information(this, "删除按钮ID",id); +} + +void Create_Task::on_pushButton_2_clicked() +{ + // ======================================================================================== + // 创建任务单按钮 + // ==================================================================================== + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + Create_Task::State="Create"; +} +void Create_Task::HiddenButton() +{ + ui->SaveButton->hide(); + ui->CreateButton->hide(); + ui->ScanButton->hide(); + ui->deletebutton->hide(); +} +void Create_Task::DisplayButton() +{ + ui->SaveButton->show(); + ui->CreateButton->show(); + ui->ScanButton->show(); + ui->deletebutton->show(); +} + +void Create_Task::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/create_task.h b/softwareDirectory/AutoVerScheme/create_task.h index 7cf383f..6b67c7c 100644 --- a/softwareDirectory/AutoVerScheme/create_task.h +++ b/softwareDirectory/AutoVerScheme/create_task.h @@ -16,11 +16,22 @@ explicit Create_Task(QWidget *parent = nullptr); ~Create_Task(); + //全局静态变量 + static QString State; private slots: void initForm(); //初始化界面数据 void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonUpdateClicked(QString id); + void OnButtoDeleteClicked(QString id); + void on_pushButton_2_clicked(); + void HiddenButton(); + void DisplayButton(); + + void on_pushButton_clicked(); + private: Ui::Create_Task *ui; }; diff --git a/softwareDirectory/AutoVerScheme/create_task.ui b/softwareDirectory/AutoVerScheme/create_task.ui index d9d88ed..b45af33 100644 --- a/softwareDirectory/AutoVerScheme/create_task.ui +++ b/softwareDirectory/AutoVerScheme/create_task.ui @@ -19,278 +19,651 @@ - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 1 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 任务单编号: - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - 委托方: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 使用部门: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 要求完成时间: - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(3, 58, 132); + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 任务单编号: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 委托方: + + + + + + + + + + 使用部门: + + + + + + + + + + 要求检完时间: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); color:white; - - - 查询 - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(207, 132, 33); + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); color:white; - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - 6 + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + 3 + + + + + + 50 + 40 + + + + + 100 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 创建任务单 + + + + + + + + + + + + + + + + + + + + + color:black; - - 9 - - - 9 - - - 9 - - - - - - 0 - 0 - - - - - 120 - 40 - - - - OpenHandCursor - - - Qt::DefaultContextMenu - - - Qt::RightToLeft - - - false - - - background-color:rgb(9, 89, 179); + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 创建任务单 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 保存 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; color:white; - - - 创建任务单 - - - true - - - - - - - - - - - - - - SizeVerCursor - - - - - - - + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接人: + + + + + + + 要求检完时间: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 是否加急: + + + + + + + 电话: + + + + + + + 委托方: + + + + + + + 任务单编号: + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接时间: + + + + + + + 送检人: + + + + + + + 接收说明: + + + + + + + 使用部门: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + 任务单列表: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 扫描增加 + + + false + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 增加行 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 删除行 + + + + + + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/depar_task.ui b/softwareDirectory/AutoVerScheme/depar_task.ui index efb7561..f44829d 100644 --- a/softwareDirectory/AutoVerScheme/depar_task.ui +++ b/softwareDirectory/AutoVerScheme/depar_task.ui @@ -213,86 +213,6 @@ - - - 12 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - diff --git a/softwareDirectory/AutoVerScheme/infomanageview.ui b/softwareDirectory/AutoVerScheme/infomanageview.ui index ef0b87b..cb76a28 100644 --- a/softwareDirectory/AutoVerScheme/infomanageview.ui +++ b/softwareDirectory/AutoVerScheme/infomanageview.ui @@ -20,7 +20,7 @@ color:black; background-color:rgba(240, 240, 240, 1); - + 0 @@ -37,77 +37,124 @@ 0 - - - - 0 - 0 - - - - - 170 - 0 - - - - - 16777215 - 16777215 - - + - color:White; - font-weight: bold; - font-size: 16px; -background-color:rgba(10, 15, 92, 1); + border-image: url(:/image/Index/u15.png); - - true - - - - - 0 - 0 - 170 - 625 - - - - - 0 - 0 - - - - - 170 - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - + + + + + + 50 + 50 + + + + + 35 + 35 + + + + image: url(:/image/Index/u2158.svg); + + + + + + + + + + color:white; +font-size:18px; +font-weight:bold; + + + 信息管理 + + + + - + + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 16777215 + 16777215 + + + + color:White; + font-weight: bold; + font-size: 16px; +background-color:rgba(10, 15, 92, 1); + + + true + + + + + 0 + 0 + 170 + 570 + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp index efc00ba..eea27f0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp @@ -25,17 +25,17 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 - + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0,0); //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "出厂编号" + headers <<"ID"<< "序号" << "设备名称" << "型号规则" << "出厂编号" <<"核查件名称"<<"核查件型号"<<"核查件编号" <<"核查员" << "核查日期" <<"实验室"<<"部门"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); @@ -58,5 +58,114 @@ } void InspectDataItem::Load() { - //ShowMessageBox("核查数据","核查数据"); + // ======================================================================================== + // 主页面初始化 核查管理初始化 + // ==================================================================================== + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + // 调用数据库管理器的函数获取数据 + int rowCount=0; + int row=0; + QList data = dbManager.getCheckData(); + for (const CheckData& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.equipment_name)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.model)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.manufacture_no)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.meter_standard_name)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(item.meter_standard_id)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(item.create_user_name)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(item.check_date.toString())); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(item.dept_name)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("详情"); + QPushButton *button2 = new QPushButton("预览"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonPreViewtClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 12, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void InspectDataItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +void InspectDataItem::OnButtonPreViewtClicked(QString id) +{ + // ======================================================================================== + // 预览按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} + +void InspectDataItem::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.h b/softwareDirectory/AutoVerScheme/inspectdataitem.h index bdf7066..6644339 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.h +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.h @@ -20,6 +20,10 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonPreViewtClicked(QString id); + void on_pushButton_clicked(); + private: Ui::InspectDataItem *ui; }; diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.ui b/softwareDirectory/AutoVerScheme/inspectdataitem.ui index 86786c9..3f319c0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.ui +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.ui @@ -7,232 +7,928 @@ 0 0 1362 - 543 + 553 Form - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 0 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 设备名称: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 型号规则: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 出厂编号: - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 核查员: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 核查日期: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 实验室: - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - Qt::RightToLeft - - - 查询 - - - - - - - Qt::RightToLeft - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - - - - - - - - - - + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 设备名称: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 型号规则: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 出厂编号: + + + + + + + + 0 + 0 + + + + + + + + 核查员: + + + + + + + + + + 实验室: + + + + + + + + + + 核查日期: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + + + + + + + + + + + + + + + + + color:black; + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 核查数据详情 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; +color:white; + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + 设备基本信息: + + + + + + + 设备名称: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 型号规格: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 出厂编号: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定有效期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产国家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产厂家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 购进日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用年限: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备单价: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用状态: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 质量状况: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 所属部门: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 负责人: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备供方: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 位置信息: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 标准类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备分类: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 重要等级: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定周期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 对应开箱记录: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 备注: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + 3 + + + false + + + Qt::LogicalMoveStyle + + + + + + + + + + + + + + + + 核查项目及核查点: + + + + + + + + + + + + + + 0 + 0 + + + + + 30 + 0 + + + + + + + + + + false + + + + 6 + + + 0 + + + 0 + + + 0 + + + 6 + + + + + 检定项备注: + + + + + + + background-color: #f0f0f0; +color: grey; + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/my_task.ui b/softwareDirectory/AutoVerScheme/my_task.ui index a078840..e04a336 100644 --- a/softwareDirectory/AutoVerScheme/my_task.ui +++ b/softwareDirectory/AutoVerScheme/my_task.ui @@ -157,6 +157,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -167,6 +172,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 diff --git a/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg b/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg new file mode 100644 index 0000000..fd249e0 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/InfoBase.h b/softwareDirectory/AutoVerScheme/InfoBase.h index 6dd59f3..bce9609 100644 --- a/softwareDirectory/AutoVerScheme/InfoBase.h +++ b/softwareDirectory/AutoVerScheme/InfoBase.h @@ -4,6 +4,7 @@ #include #include "QStandardItemModel" #include "databaseconnection.h" +#include "basecommonapi.h" ///信号管理页面的基类 所有信息管理页面都继承于InfoBase /// 便于统一管理 所有子类必须实现Load方法 /// 每次按钮点击切换都会调用Load方法 用于每次页面的数据刷新 @@ -16,7 +17,7 @@ //QStandardItemModel 的实例。这个模型将用于存储和管理数据。 QStandardItemModel *model; //信息管理页面 基类定义Conn对象 - DatabaseConnection *Conn=DatabaseConnection::getInstance(); + BaseCommonApi dbManager; }; #endif // INFOBASE_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index f62915b..6170ee7 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -15,7 +15,7 @@ " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id " " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID " " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID " - " WHERE sys_user.ID = ' :userId '"); + " WHERE sys_user.ID = :userId"); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -75,6 +75,35 @@ } return result; } + +//获取创建任务首页数据 +QList BaseCommonApi::getCreateTaskList(QString userId) +{ + userId="1640229293790650370"; + QList result; + QSqlQuery query; + query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " + " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " + " WHERE bi.create_user_id = :userId"); + // 将参数绑定到占位符 + query.bindValue(":userId", userId); + if (query.exec()) { + while (query.next()) { + CreateTaskList task; + task.id = query.value("id").toString(); + task.order_no = query.value("order_no").toString(); + task.customer_name = query.value("customer_name").toString(); + task.DEPT_FULL_NAME = query.value("FULL_NAME").toString(); + task.require_over_time = query.value("require_over_time").toDateTime(); + task.deliverer = query.value("deliverer").toString(); + task.is_urgent = query.value("is_urgent").toString(); + result.append(task); + } + } else { + qDebug() << "Query execution failed: " << query.lastError().text(); + } + return result; +} //获取创建任务首页数据 QListgetCreateTaskList(QString userId) { @@ -82,7 +111,7 @@ QSqlQuery query; query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " - " WHERE bi.create_user_id = ':userId' "); + " WHERE bi.create_user_id = :userId "); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -103,6 +132,7 @@ return result; } + //创建任务单-查看/编辑 顶部数据 传参该条数据的id QListBaseCommonApi::getCatTask(QString id) { @@ -111,7 +141,7 @@ query.prepare("SELECT bi.order_no ,bi.customer_name ,dept.FULL_NAME ,bi.require_over_time ," " bi.deliverer ,bi.deliverer_tel ,bi.undertaker_name ,bi.undertake_time , bi.is_urgent AS ," " bi.receive_illustrate FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID" - " WHERE bi.id = ' :id '"); + " WHERE bi.id = :id "); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -140,6 +170,7 @@ //获取创建任务 -任务单列表 + QListBaseCommonApi::getCatTaskList(QString orderId) { QList result; @@ -380,6 +411,7 @@ QListBaseCommonApi::getCheckDCPower(QString equipment_id,QStringList *headList) { + equipment_id="1693435753272557570"; QList result; QSqlQuery query; query.prepare("SELECT besciddp.id ,besciddp.params,besciddp.unit,resolution,besciddp.urel,besciddp.check_type,datum_point,cycle_number " @@ -407,9 +439,11 @@ } else { qDebug() << "Query execution failed: " << query.lastError().text(); } + *headList <<"序号"<<"核查项目"<<"核查点"<<"单位"<<"分辨力"<<"Urel"<<"核查类型"<<"是否为基准点(1/0)"<<"循环次数" <<"电阻值/频率"<<"电阻值单位/频率单位"<<"核查项备注"; + return result; } //根据id获取装置名称 @@ -436,9 +470,9 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " - " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id " - " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); +bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " + " JOIN sys_dept ON sys_dept.ID = eei.dept_id " + " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); if (isSuccess) { while (query.next()) { TestedDevice testedDevice; @@ -504,9 +538,10 @@ //判断 哪个 装置表 传参 设备id QList BaseCommonApi::getJudgeCalibrationTable(QString id) { + id="1716997603953311746"; QList result; QSqlQuery query; - query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = ':id')"); + query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = :id )"); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -526,12 +561,55 @@ return result; } +//标准装置字典类型 +/** + * 多功能校准源标准装置 = 1 + * 直流稳压电源检定装置 = 2 + * 多功能电气安全校准器标准装置 = 3 + * 0.02级活塞式压力计标准装置 = 4 + * 二等铂电阻温度计标准装置 = 5 + * 安全阀校验装置 = 6 + * 精密露点仪标准装置 = 7 + * E2等级砝码标准装置 = 8 + * 频谱分析仪标准装置 = 9 + * 信号发生器标准装置 = 10 + * 微波衰减标准装置 = 11 + * 频率短期稳定度标准装置 =12 + * 示波器标准装置 = 13 + * 铯原子频率标准装置 =14 + * 小功率标准装置 = 15 + * 低频信号发生器标准装置 = 16 + * S参数标准装置 = 17 + * 失真度标准装置 = 18 + */ +//根据被检设备ID获取当前设备的 核查项目及核查点 + +QList BaseCommonApi::Search_CalibrationTable(QString DeiverId,QStringList *HeadList) +{ + + QList DataList; + DataList.clear(); + QList CliTable=BaseCommonApi::getJudgeCalibrationTable(DeiverId); + if(CliTable.count()==0)return DataList; + switch (CliTable[0].belong_standard_equipment.toInt()) + { + case 1: + + //CliTable[0].item_category_id + DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList); + break; + } + + return DataList; +} //被检设备管理-检定项目及检定点-多功能校准源 -QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) +QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) { -QList result; +QList resultData; +QStringList result; +resultData.clear(); QSqlQuery query; query.prepare("SELECT bbdmidc.id ,bbdmidc.params ,bbdmidc.capacity ,bbdmidc.unit ,bbdmidc.frequency , bbdmidc.range_range , bbdmidc.standard_value , bbdmidc.resolution , bbdmidc.maximum_error , bbdmidc.error_param_a , bbdmidc.error_param_b " @@ -542,26 +620,24 @@ if (query.exec()) { while (query.next()) { - VerMultiCal calibration; - calibration.id = query.value("id").toString(); - calibration.params = query.value("params").toString(); - calibration.capacity = query.value("capacity").toString(); - calibration.unit = query.value("unit").toString(); - calibration.frequency = query.value("frequency").toString(); - calibration.range_range = query.value("range_range").toString(); - calibration.standard_value = query.value("standard_value").toString(); - calibration.resolution = query.value("resolution").toString(); - calibration.maximum_error = query.value("maximum_error").toString(); - calibration.error_param_a = query.value("error_param_a").toString(); - calibration.error_param_b = query.value("error_param_b").toString(); - - result.append(calibration); + result.clear(); + result.append(query.value("id").toString()); + result.append(query.value("params").toString()); + result.append(query.value("capacity").toString()); + result.append(query.value("unit").toString()); + result.append(query.value("frequency").toString()); + result.append(query.value("range_range").toString()); + result.append(query.value("standard_value").toString()); + result.append(query.value("resolution").toString()); + result.append(query.value("maximum_error").toString()); + result.append(query.value("error_param_a").toString()); + result.append(query.value("error_param_b").toString()); + resultData.append(result); } } else { qDebug() << "Query execution failed: " << query.lastError().text(); } - *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; - return result; + *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; } //检定数据管理 首页 @@ -757,7 +833,7 @@ " LEFT JOIN biz_equipment_standard_check_info besci ON besci.item_category_id = bescidc.item_category_id " " WHERE bescidc.equipment_id = :equipment_id "); - // 将参数绑定到占位符 '1692796512381222914' + // 将参数绑定到占位符 1692796512381222914 query.bindValue(":equipment_id", equipment_id); if (query.exec()) { while (query.next()) { @@ -788,12 +864,13 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " + bool isSuccess = query.exec("SELECT brtf.id,brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " " FROM biz_resource_technique_file brtf"); if (isSuccess) { while (query.next()) { Technique_File file; + file.id=query.value("id").toString(); file.file_distribute_no = query.value("file_distribute_no").toString(); file.file_name = query.value("file_name").toString(); file.version_no = query.value("version_no").toString(); @@ -876,7 +953,7 @@ QList result; QSqlQuery query; query.prepare("SELECT id,device_id ,communication_type ,serial_port ,visa ,create_time ,update_time " - "FROM zd_communication_setting WHERE device_id = ' :deviceId '"); + "FROM zd_communication_setting WHERE device_id = :deviceId "); query.bindValue(":deviceId", deviceId); if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h index 1b70cb9..ff8a320 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.h +++ b/softwareDirectory/AutoVerScheme/basecommonapi.h @@ -9,7 +9,7 @@ #include "databaseconnection.h" #include "id\IdWorker.h" - +#include "QStringList" //部门任务 @@ -52,6 +52,7 @@ QDateTime require_over_time; QString deliverer; QString is_urgent; + }; //创建任务单-查看任务单 class CatTask @@ -241,9 +242,15 @@ QString belong_standard_equipment; }; +class BaseEntity: public QObject +{ + Q_OBJECT + public: + +}; //被检设备管理-检定项目及检定点-检定项多功能校准源 -class VerMultiCal +class VerMultiCal:public BaseEntity { public: QString id; @@ -365,6 +372,7 @@ class Technique_File { public: + QString id; QString file_distribute_no; QString file_name; QString version_no; @@ -444,12 +452,22 @@ public: BaseCommonApi(); + // + static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList); + //部门任务 + static QList getAllData(); + //部门任务 参数登录用户的id static QList getAllData(QString userId); + //我的任务 static QList getMyTasks(QString id); //获取创建任务首页数据 - static QListgetCreateTaskList(QString id); + + static QListgetCreateTaskList(QString userId); + + + //创建任务-查看任务单顶部 static QListgetCatTask(QString orderNo); //创建任务-查看任务列表底部 @@ -479,7 +497,10 @@ //判断 哪个 装置表 传参 设备id 返回itemId static QList getJudgeCalibrationTable(QString id); //被检设备管理-检定项目及检定点-多功能校准源 - static QList getVerMultiCal(QString itemId,QStringList *headList); + + + static QList getVerMultiCal(QString itemId,QStringList *headList); + // 获取检定数据管理 首页 static QList getVerificationData(); // 检定数据管理-检定基本信息 @@ -494,6 +515,7 @@ static QList getCheckDataManageResultManageMult(QString equipment_id); //技术文件 static QList getTechnique_File(); + //检定程序管理首页查询 static QList getVerificationProgramInfoMain(); //检定程序管理 编辑 @@ -525,7 +547,6 @@ IdWorker &idWorker = Singleton::instance(); //自动检定 - }; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp index c3b2786..70148f4 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp @@ -4,6 +4,7 @@ #include "basecommonapi.h" //#include "tested_device_manage_serve.h" +#include "QStringList" //被检设备 BeExamined_DeviceItem::BeExamined_DeviceItem(QWidget *parent) : @@ -32,19 +33,32 @@ "}"); // ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); // item->setTextAlignment(Qt::AlignCenter); //ui->tableWidget->setItem(0, 0, item); //设置数据 - + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" + headers << "ID" << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" << "生产厂家"<<"所在单位" <<"使用部门"<<"计量标识"<<"检定周期"<<"证书有效期"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); + //详情页面tableWidgetItem设置 + ui->tableWidgetItem->setStyleSheet("QHeaderView::section {" + "border: 1px solid rgba(197, 196, 196, 1);" + "border-left:none;" + "border-top:none;" + "background-color:white;" + "}"); + + // ui->tableWidget->setRowCount(10); // 设置10行 + //ui->tableWidgetItem->setColumnCount(14); // 设置11列 + ui->tableWidgetItem->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 + ui->tableWidgetItem->verticalHeader()->setParent(nullptr); //隐藏行头 + } void BeExamined_DeviceItem::ShowMessageBox(QString title,QString value) { // 创建一个QMessageBox对象 @@ -64,24 +78,19 @@ } void BeExamined_DeviceItem::Load() { - //获取主页面内容 - //进入主页面 - /* - ui->stackedWidget->setCurrentIndex(0); + // ======================================================================================== + // 主页面初始化 + // ==================================================================================== + + + ui->stackedWidget->setCurrentIndex(0); //先设置为行为0 ui->tableWidget->setRowCount(0); - - - // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BeExamined_DeviceItem dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; int row=0; - QList data = dbManager.getBizDeviceManage(); - - - for (const BizDevice& bizDevice : data) { + QList data = dbManager.getTestedDevice(); + for (const TestedDevice& bizDevice : data) { rowCount = ui->tableWidget->rowCount(); ui->tableWidget->insertRow(rowCount); @@ -89,34 +98,118 @@ ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); ui->tableWidget->setItem(row, 2, new QTableWidgetItem(bizDevice.equipment_name)); ui->tableWidget->setItem(row, 3, new QTableWidgetItem(bizDevice.model)); - ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacture_no)); - ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.help_instruction)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacture_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(bizDevice.FULL_NAME)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(bizDevice.meter_identify)); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem(bizDevice.check_cycle)); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(bizDevice.certificate_valid)); + //添加操作按钮 QPushButton *button = new QPushButton("查看"); - ui->tableWidget->setCellWidget(row, 6, button); + ui->tableWidget->setCellWidget(row, 12, button); //设置按钮简单样式 button->setStyleSheet("QPushButton {" - " border: none; /* 无边框 "*/ - // " color: green; /* 文本颜色 */" - // " text-decoration: underline; /* 文本下划线 */" - // "}"); + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); // 设置鼠标悬停时的光标样式为小手图标 - // button->setCursor(Qt::PointingHandCursor); + button->setCursor(Qt::PointingHandCursor); // 连接按钮的 clicked 信号到自定义槽函数 - // connect(button, &QPushButton::clicked, this, [this, button, row]() { - // 获取当前行第一列的 ID - // QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); - // if (idItem) { - // QString id = idItem->text(); -// - // OnButtonSelectClicked(id); - // } + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); - // }); + OnButtonSelectClicked(id); + } - // row++; - - // } + }); + row++; + } } +void BeExamined_DeviceItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + + DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +//返回按钮 +void BeExamined_DeviceItem::on_pushButton_2_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); +} +void BeExamined_DeviceItem::DeviceInfoInit(QString id) +{ + // ======================================================================================== + // 初始化详情 + // ==================================================================================== + + QList data = dbManager.getTestedCatDevice(id); + for (const TestedCatDevice& testedCatDevice : data) { + + ui->equipment_name->setText(testedCatDevice.equipment_name); + ui->model->setText(testedCatDevice.model); + ui->help_instruction->setText(testedCatDevice.help_instruction); + ui->manufacture_no->setText(testedCatDevice.manufacture_no); + ui->product_country->setText(testedCatDevice.product_country); + ui->manufacturer->setText(testedCatDevice.manufacturer); + ui->product_date->setText(testedCatDevice.product_date); + ui->purchase_date->setText(testedCatDevice.purchase_date); + ui->unit_price->setText(testedCatDevice.unit_price); + ui->usage_status->setText(testedCatDevice.usage_status); + ui->quality_condition->setText(testedCatDevice.quality_condition); + ui->dept_name->setText(testedCatDevice.FULL_NAME); + ui->category->setText(testedCatDevice.category); + ui->check_cycle->setText(testedCatDevice.check_cycle); + ui->level->setText(testedCatDevice.level); + ui->remark->setText(testedCatDevice.remark); + } + + + // ======================================================================================== + // 初始化检定项目及核查点 + // ==================================================================================== + + //获取核查点tablewight的数据 + QStringList headlist; + + QList Data=dbManager.Search_CalibrationTable(id,&headlist); + + //tableWidgetItem + ui->tableWidgetItem->setRowCount(0); + ui->tableWidgetItem->setColumnCount(headlist.count()); + ui->tableWidgetItem->setHorizontalHeaderLabels(headlist); + //循环数据 + int rowCount=0; + int row=0; + ; + for (const QStringList& item : Data) + { + //获取行号 并进行添加行 + rowCount = ui->tableWidgetItem->rowCount(); + ui->tableWidgetItem->insertRow(rowCount); + //添加 序号 + ui->tableWidgetItem->setItem(row, 0, new QTableWidgetItem(QString::number(row+1))); + //循环读取值 headlist,count是列的数量 + for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型 + } + + row++; + + } +} + + + diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h index ffdc22a..0050ee7 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h @@ -21,6 +21,11 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + + void DeviceInfoInit(QString id); + + void on_pushButton_2_clicked(); private: Ui::BeExamined_DeviceItem *ui; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui index ce63879..cdacfaf 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui @@ -215,6 +215,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -225,6 +230,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 @@ -391,7 +401,7 @@ - + ForbiddenCursor @@ -412,7 +422,7 @@ - + ForbiddenCursor @@ -428,12 +438,12 @@ - 出厂编号: + 辅助字段: - + ForbiddenCursor @@ -449,12 +459,12 @@ - 检定有效期: + 出厂编号: - + ForbiddenCursor @@ -475,7 +485,7 @@ - + ForbiddenCursor @@ -496,7 +506,7 @@ - + ForbiddenCursor @@ -517,7 +527,7 @@ - + ForbiddenCursor @@ -538,7 +548,7 @@ - + ForbiddenCursor @@ -552,14 +562,14 @@ - + - 使用年限: + 设备单价: - + ForbiddenCursor @@ -573,14 +583,14 @@ - + - 设备单价: + 使用状态: - + ForbiddenCursor @@ -594,14 +604,14 @@ - + - 使用状态: + 质量状况: - + ForbiddenCursor @@ -615,14 +625,14 @@ - + - 质量状况: + 所在单位: - + ForbiddenCursor @@ -638,12 +648,12 @@ - 所属部门: + 使用部门: - + ForbiddenCursor @@ -657,14 +667,14 @@ - + - 负责人: + 设备分类: - + ForbiddenCursor @@ -678,14 +688,14 @@ - + - 设备供方: + 检定周期: - + ForbiddenCursor @@ -699,14 +709,14 @@ - + - 位置信息: + 重要等级: - + ForbiddenCursor @@ -720,140 +730,14 @@ - - - 设备类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 标准类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 设备分类: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 重要等级: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 检定周期: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 对应开箱记录: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - 备注: - - + + ForbiddenCursor @@ -892,7 +776,7 @@ - + diff --git a/softwareDirectory/AutoVerScheme/create_task.cpp b/softwareDirectory/AutoVerScheme/create_task.cpp index 9b49a1a..ddd78ef 100644 --- a/softwareDirectory/AutoVerScheme/create_task.cpp +++ b/softwareDirectory/AutoVerScheme/create_task.cpp @@ -2,12 +2,15 @@ #include "ui_create_task.h" #include "QMessageBox" + + QString Create_Task::State=""; Create_Task::Create_Task(QWidget *parent) : InfoBase(parent), ui(new Ui::Create_Task) { ui->setupUi(this); this->initForm(); + } Create_Task::~Create_Task() @@ -25,17 +28,19 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(8); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(9); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "任务单编号" << "委托方"<< "使用部门" << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; + headers <<"ID"<< "序号" << "任务单编号" << "委托方"<< "使用部门" + << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); //ShowMessageBox("标题","初始化完成"); } @@ -57,5 +62,171 @@ } void Create_Task::Load() { - //ShowMessageBox("创建任务界面","创建任务界面初始化完成"); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + + QList data = BaseCommonApi::getCreateTaskList(""); + + int rowCount = 0; + int row=0; + QString is_urgent; + for (const CreateTaskList& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.order_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.customer_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.DEPT_FULL_NAME)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.require_over_time.toString())); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.deliverer)); + if(item.is_urgent=="1") + is_urgent="是"; + else + is_urgent="否"; + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(is_urgent)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("查看"); + QPushButton *button2 = new QPushButton("编辑"); + QPushButton *button3 = new QPushButton("删除"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + Create_Task::State="Select"; + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonUpdateClicked(id); + Create_Task::State="Update"; + } + + }); + //设置按钮3简单样式 + button3->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: red; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button3->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button3, &QPushButton::clicked, this, [this, button3, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtoDeleteClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->addWidget(button3); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 8, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void Create_Task::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + HiddenButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "查看按钮ID",id); +} +void Create_Task::OnButtonUpdateClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "编辑按钮ID",id); +} +void Create_Task::OnButtoDeleteClicked(QString id) +{ + // ======================================================================================== + // 删除按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + + QMessageBox::information(this, "删除按钮ID",id); +} + +void Create_Task::on_pushButton_2_clicked() +{ + // ======================================================================================== + // 创建任务单按钮 + // ==================================================================================== + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + Create_Task::State="Create"; +} +void Create_Task::HiddenButton() +{ + ui->SaveButton->hide(); + ui->CreateButton->hide(); + ui->ScanButton->hide(); + ui->deletebutton->hide(); +} +void Create_Task::DisplayButton() +{ + ui->SaveButton->show(); + ui->CreateButton->show(); + ui->ScanButton->show(); + ui->deletebutton->show(); +} + +void Create_Task::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/create_task.h b/softwareDirectory/AutoVerScheme/create_task.h index 7cf383f..6b67c7c 100644 --- a/softwareDirectory/AutoVerScheme/create_task.h +++ b/softwareDirectory/AutoVerScheme/create_task.h @@ -16,11 +16,22 @@ explicit Create_Task(QWidget *parent = nullptr); ~Create_Task(); + //全局静态变量 + static QString State; private slots: void initForm(); //初始化界面数据 void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonUpdateClicked(QString id); + void OnButtoDeleteClicked(QString id); + void on_pushButton_2_clicked(); + void HiddenButton(); + void DisplayButton(); + + void on_pushButton_clicked(); + private: Ui::Create_Task *ui; }; diff --git a/softwareDirectory/AutoVerScheme/create_task.ui b/softwareDirectory/AutoVerScheme/create_task.ui index d9d88ed..b45af33 100644 --- a/softwareDirectory/AutoVerScheme/create_task.ui +++ b/softwareDirectory/AutoVerScheme/create_task.ui @@ -19,278 +19,651 @@ - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 1 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 任务单编号: - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - 委托方: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 使用部门: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 要求完成时间: - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(3, 58, 132); + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 任务单编号: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 委托方: + + + + + + + + + + 使用部门: + + + + + + + + + + 要求检完时间: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); color:white; - - - 查询 - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(207, 132, 33); + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); color:white; - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - 6 + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + 3 + + + + + + 50 + 40 + + + + + 100 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 创建任务单 + + + + + + + + + + + + + + + + + + + + + color:black; - - 9 - - - 9 - - - 9 - - - - - - 0 - 0 - - - - - 120 - 40 - - - - OpenHandCursor - - - Qt::DefaultContextMenu - - - Qt::RightToLeft - - - false - - - background-color:rgb(9, 89, 179); + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 创建任务单 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 保存 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; color:white; - - - 创建任务单 - - - true - - - - - - - - - - - - - - SizeVerCursor - - - - - - - + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接人: + + + + + + + 要求检完时间: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 是否加急: + + + + + + + 电话: + + + + + + + 委托方: + + + + + + + 任务单编号: + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接时间: + + + + + + + 送检人: + + + + + + + 接收说明: + + + + + + + 使用部门: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + 任务单列表: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 扫描增加 + + + false + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 增加行 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 删除行 + + + + + + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/depar_task.ui b/softwareDirectory/AutoVerScheme/depar_task.ui index efb7561..f44829d 100644 --- a/softwareDirectory/AutoVerScheme/depar_task.ui +++ b/softwareDirectory/AutoVerScheme/depar_task.ui @@ -213,86 +213,6 @@ - - - 12 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - diff --git a/softwareDirectory/AutoVerScheme/infomanageview.ui b/softwareDirectory/AutoVerScheme/infomanageview.ui index ef0b87b..cb76a28 100644 --- a/softwareDirectory/AutoVerScheme/infomanageview.ui +++ b/softwareDirectory/AutoVerScheme/infomanageview.ui @@ -20,7 +20,7 @@ color:black; background-color:rgba(240, 240, 240, 1); - + 0 @@ -37,77 +37,124 @@ 0 - - - - 0 - 0 - - - - - 170 - 0 - - - - - 16777215 - 16777215 - - + - color:White; - font-weight: bold; - font-size: 16px; -background-color:rgba(10, 15, 92, 1); + border-image: url(:/image/Index/u15.png); - - true - - - - - 0 - 0 - 170 - 625 - - - - - 0 - 0 - - - - - 170 - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - + + + + + + 50 + 50 + + + + + 35 + 35 + + + + image: url(:/image/Index/u2158.svg); + + + + + + + + + + color:white; +font-size:18px; +font-weight:bold; + + + 信息管理 + + + + - + + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 16777215 + 16777215 + + + + color:White; + font-weight: bold; + font-size: 16px; +background-color:rgba(10, 15, 92, 1); + + + true + + + + + 0 + 0 + 170 + 570 + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp index efc00ba..eea27f0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp @@ -25,17 +25,17 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 - + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0,0); //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "出厂编号" + headers <<"ID"<< "序号" << "设备名称" << "型号规则" << "出厂编号" <<"核查件名称"<<"核查件型号"<<"核查件编号" <<"核查员" << "核查日期" <<"实验室"<<"部门"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); @@ -58,5 +58,114 @@ } void InspectDataItem::Load() { - //ShowMessageBox("核查数据","核查数据"); + // ======================================================================================== + // 主页面初始化 核查管理初始化 + // ==================================================================================== + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + // 调用数据库管理器的函数获取数据 + int rowCount=0; + int row=0; + QList data = dbManager.getCheckData(); + for (const CheckData& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.equipment_name)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.model)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.manufacture_no)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.meter_standard_name)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(item.meter_standard_id)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(item.create_user_name)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(item.check_date.toString())); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(item.dept_name)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("详情"); + QPushButton *button2 = new QPushButton("预览"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonPreViewtClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 12, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void InspectDataItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +void InspectDataItem::OnButtonPreViewtClicked(QString id) +{ + // ======================================================================================== + // 预览按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} + +void InspectDataItem::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.h b/softwareDirectory/AutoVerScheme/inspectdataitem.h index bdf7066..6644339 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.h +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.h @@ -20,6 +20,10 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonPreViewtClicked(QString id); + void on_pushButton_clicked(); + private: Ui::InspectDataItem *ui; }; diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.ui b/softwareDirectory/AutoVerScheme/inspectdataitem.ui index 86786c9..3f319c0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.ui +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.ui @@ -7,232 +7,928 @@ 0 0 1362 - 543 + 553 Form - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 0 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 设备名称: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 型号规则: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 出厂编号: - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 核查员: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 核查日期: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 实验室: - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - Qt::RightToLeft - - - 查询 - - - - - - - Qt::RightToLeft - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - - - - - - - - - - + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 设备名称: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 型号规则: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 出厂编号: + + + + + + + + 0 + 0 + + + + + + + + 核查员: + + + + + + + + + + 实验室: + + + + + + + + + + 核查日期: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + + + + + + + + + + + + + + + + + color:black; + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 核查数据详情 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; +color:white; + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + 设备基本信息: + + + + + + + 设备名称: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 型号规格: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 出厂编号: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定有效期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产国家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产厂家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 购进日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用年限: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备单价: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用状态: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 质量状况: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 所属部门: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 负责人: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备供方: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 位置信息: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 标准类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备分类: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 重要等级: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定周期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 对应开箱记录: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 备注: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + 3 + + + false + + + Qt::LogicalMoveStyle + + + + + + + + + + + + + + + + 核查项目及核查点: + + + + + + + + + + + + + + 0 + 0 + + + + + 30 + 0 + + + + + + + + + + false + + + + 6 + + + 0 + + + 0 + + + 0 + + + 6 + + + + + 检定项备注: + + + + + + + background-color: #f0f0f0; +color: grey; + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/my_task.ui b/softwareDirectory/AutoVerScheme/my_task.ui index a078840..e04a336 100644 --- a/softwareDirectory/AutoVerScheme/my_task.ui +++ b/softwareDirectory/AutoVerScheme/my_task.ui @@ -157,6 +157,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -167,6 +172,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 diff --git a/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg b/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg new file mode 100644 index 0000000..fd249e0 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/softwareDirectory/AutoVerScheme/res/res.qrc b/softwareDirectory/AutoVerScheme/res/res.qrc index a0eac47..05edcdc 100644 --- a/softwareDirectory/AutoVerScheme/res/res.qrc +++ b/softwareDirectory/AutoVerScheme/res/res.qrc @@ -44,7 +44,11 @@ image/Index/u7488.svg image/Index/u7491.svg image/Index/u7538.svg +<<<<<<< HEAD image/Index/u2324.svg image/Index/u2325.svg +======= + image/Index/u2158.svg +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/InfoBase.h b/softwareDirectory/AutoVerScheme/InfoBase.h index 6dd59f3..bce9609 100644 --- a/softwareDirectory/AutoVerScheme/InfoBase.h +++ b/softwareDirectory/AutoVerScheme/InfoBase.h @@ -4,6 +4,7 @@ #include #include "QStandardItemModel" #include "databaseconnection.h" +#include "basecommonapi.h" ///信号管理页面的基类 所有信息管理页面都继承于InfoBase /// 便于统一管理 所有子类必须实现Load方法 /// 每次按钮点击切换都会调用Load方法 用于每次页面的数据刷新 @@ -16,7 +17,7 @@ //QStandardItemModel 的实例。这个模型将用于存储和管理数据。 QStandardItemModel *model; //信息管理页面 基类定义Conn对象 - DatabaseConnection *Conn=DatabaseConnection::getInstance(); + BaseCommonApi dbManager; }; #endif // INFOBASE_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index f62915b..6170ee7 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -15,7 +15,7 @@ " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id " " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID " " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID " - " WHERE sys_user.ID = ' :userId '"); + " WHERE sys_user.ID = :userId"); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -75,6 +75,35 @@ } return result; } + +//获取创建任务首页数据 +QList BaseCommonApi::getCreateTaskList(QString userId) +{ + userId="1640229293790650370"; + QList result; + QSqlQuery query; + query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " + " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " + " WHERE bi.create_user_id = :userId"); + // 将参数绑定到占位符 + query.bindValue(":userId", userId); + if (query.exec()) { + while (query.next()) { + CreateTaskList task; + task.id = query.value("id").toString(); + task.order_no = query.value("order_no").toString(); + task.customer_name = query.value("customer_name").toString(); + task.DEPT_FULL_NAME = query.value("FULL_NAME").toString(); + task.require_over_time = query.value("require_over_time").toDateTime(); + task.deliverer = query.value("deliverer").toString(); + task.is_urgent = query.value("is_urgent").toString(); + result.append(task); + } + } else { + qDebug() << "Query execution failed: " << query.lastError().text(); + } + return result; +} //获取创建任务首页数据 QListgetCreateTaskList(QString userId) { @@ -82,7 +111,7 @@ QSqlQuery query; query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " - " WHERE bi.create_user_id = ':userId' "); + " WHERE bi.create_user_id = :userId "); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -103,6 +132,7 @@ return result; } + //创建任务单-查看/编辑 顶部数据 传参该条数据的id QListBaseCommonApi::getCatTask(QString id) { @@ -111,7 +141,7 @@ query.prepare("SELECT bi.order_no ,bi.customer_name ,dept.FULL_NAME ,bi.require_over_time ," " bi.deliverer ,bi.deliverer_tel ,bi.undertaker_name ,bi.undertake_time , bi.is_urgent AS ," " bi.receive_illustrate FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID" - " WHERE bi.id = ' :id '"); + " WHERE bi.id = :id "); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -140,6 +170,7 @@ //获取创建任务 -任务单列表 + QListBaseCommonApi::getCatTaskList(QString orderId) { QList result; @@ -380,6 +411,7 @@ QListBaseCommonApi::getCheckDCPower(QString equipment_id,QStringList *headList) { + equipment_id="1693435753272557570"; QList result; QSqlQuery query; query.prepare("SELECT besciddp.id ,besciddp.params,besciddp.unit,resolution,besciddp.urel,besciddp.check_type,datum_point,cycle_number " @@ -407,9 +439,11 @@ } else { qDebug() << "Query execution failed: " << query.lastError().text(); } + *headList <<"序号"<<"核查项目"<<"核查点"<<"单位"<<"分辨力"<<"Urel"<<"核查类型"<<"是否为基准点(1/0)"<<"循环次数" <<"电阻值/频率"<<"电阻值单位/频率单位"<<"核查项备注"; + return result; } //根据id获取装置名称 @@ -436,9 +470,9 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " - " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id " - " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); +bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " + " JOIN sys_dept ON sys_dept.ID = eei.dept_id " + " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); if (isSuccess) { while (query.next()) { TestedDevice testedDevice; @@ -504,9 +538,10 @@ //判断 哪个 装置表 传参 设备id QList BaseCommonApi::getJudgeCalibrationTable(QString id) { + id="1716997603953311746"; QList result; QSqlQuery query; - query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = ':id')"); + query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = :id )"); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -526,12 +561,55 @@ return result; } +//标准装置字典类型 +/** + * 多功能校准源标准装置 = 1 + * 直流稳压电源检定装置 = 2 + * 多功能电气安全校准器标准装置 = 3 + * 0.02级活塞式压力计标准装置 = 4 + * 二等铂电阻温度计标准装置 = 5 + * 安全阀校验装置 = 6 + * 精密露点仪标准装置 = 7 + * E2等级砝码标准装置 = 8 + * 频谱分析仪标准装置 = 9 + * 信号发生器标准装置 = 10 + * 微波衰减标准装置 = 11 + * 频率短期稳定度标准装置 =12 + * 示波器标准装置 = 13 + * 铯原子频率标准装置 =14 + * 小功率标准装置 = 15 + * 低频信号发生器标准装置 = 16 + * S参数标准装置 = 17 + * 失真度标准装置 = 18 + */ +//根据被检设备ID获取当前设备的 核查项目及核查点 + +QList BaseCommonApi::Search_CalibrationTable(QString DeiverId,QStringList *HeadList) +{ + + QList DataList; + DataList.clear(); + QList CliTable=BaseCommonApi::getJudgeCalibrationTable(DeiverId); + if(CliTable.count()==0)return DataList; + switch (CliTable[0].belong_standard_equipment.toInt()) + { + case 1: + + //CliTable[0].item_category_id + DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList); + break; + } + + return DataList; +} //被检设备管理-检定项目及检定点-多功能校准源 -QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) +QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) { -QList result; +QList resultData; +QStringList result; +resultData.clear(); QSqlQuery query; query.prepare("SELECT bbdmidc.id ,bbdmidc.params ,bbdmidc.capacity ,bbdmidc.unit ,bbdmidc.frequency , bbdmidc.range_range , bbdmidc.standard_value , bbdmidc.resolution , bbdmidc.maximum_error , bbdmidc.error_param_a , bbdmidc.error_param_b " @@ -542,26 +620,24 @@ if (query.exec()) { while (query.next()) { - VerMultiCal calibration; - calibration.id = query.value("id").toString(); - calibration.params = query.value("params").toString(); - calibration.capacity = query.value("capacity").toString(); - calibration.unit = query.value("unit").toString(); - calibration.frequency = query.value("frequency").toString(); - calibration.range_range = query.value("range_range").toString(); - calibration.standard_value = query.value("standard_value").toString(); - calibration.resolution = query.value("resolution").toString(); - calibration.maximum_error = query.value("maximum_error").toString(); - calibration.error_param_a = query.value("error_param_a").toString(); - calibration.error_param_b = query.value("error_param_b").toString(); - - result.append(calibration); + result.clear(); + result.append(query.value("id").toString()); + result.append(query.value("params").toString()); + result.append(query.value("capacity").toString()); + result.append(query.value("unit").toString()); + result.append(query.value("frequency").toString()); + result.append(query.value("range_range").toString()); + result.append(query.value("standard_value").toString()); + result.append(query.value("resolution").toString()); + result.append(query.value("maximum_error").toString()); + result.append(query.value("error_param_a").toString()); + result.append(query.value("error_param_b").toString()); + resultData.append(result); } } else { qDebug() << "Query execution failed: " << query.lastError().text(); } - *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; - return result; + *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; } //检定数据管理 首页 @@ -757,7 +833,7 @@ " LEFT JOIN biz_equipment_standard_check_info besci ON besci.item_category_id = bescidc.item_category_id " " WHERE bescidc.equipment_id = :equipment_id "); - // 将参数绑定到占位符 '1692796512381222914' + // 将参数绑定到占位符 1692796512381222914 query.bindValue(":equipment_id", equipment_id); if (query.exec()) { while (query.next()) { @@ -788,12 +864,13 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " + bool isSuccess = query.exec("SELECT brtf.id,brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " " FROM biz_resource_technique_file brtf"); if (isSuccess) { while (query.next()) { Technique_File file; + file.id=query.value("id").toString(); file.file_distribute_no = query.value("file_distribute_no").toString(); file.file_name = query.value("file_name").toString(); file.version_no = query.value("version_no").toString(); @@ -876,7 +953,7 @@ QList result; QSqlQuery query; query.prepare("SELECT id,device_id ,communication_type ,serial_port ,visa ,create_time ,update_time " - "FROM zd_communication_setting WHERE device_id = ' :deviceId '"); + "FROM zd_communication_setting WHERE device_id = :deviceId "); query.bindValue(":deviceId", deviceId); if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h index 1b70cb9..ff8a320 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.h +++ b/softwareDirectory/AutoVerScheme/basecommonapi.h @@ -9,7 +9,7 @@ #include "databaseconnection.h" #include "id\IdWorker.h" - +#include "QStringList" //部门任务 @@ -52,6 +52,7 @@ QDateTime require_over_time; QString deliverer; QString is_urgent; + }; //创建任务单-查看任务单 class CatTask @@ -241,9 +242,15 @@ QString belong_standard_equipment; }; +class BaseEntity: public QObject +{ + Q_OBJECT + public: + +}; //被检设备管理-检定项目及检定点-检定项多功能校准源 -class VerMultiCal +class VerMultiCal:public BaseEntity { public: QString id; @@ -365,6 +372,7 @@ class Technique_File { public: + QString id; QString file_distribute_no; QString file_name; QString version_no; @@ -444,12 +452,22 @@ public: BaseCommonApi(); + // + static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList); + //部门任务 + static QList getAllData(); + //部门任务 参数登录用户的id static QList getAllData(QString userId); + //我的任务 static QList getMyTasks(QString id); //获取创建任务首页数据 - static QListgetCreateTaskList(QString id); + + static QListgetCreateTaskList(QString userId); + + + //创建任务-查看任务单顶部 static QListgetCatTask(QString orderNo); //创建任务-查看任务列表底部 @@ -479,7 +497,10 @@ //判断 哪个 装置表 传参 设备id 返回itemId static QList getJudgeCalibrationTable(QString id); //被检设备管理-检定项目及检定点-多功能校准源 - static QList getVerMultiCal(QString itemId,QStringList *headList); + + + static QList getVerMultiCal(QString itemId,QStringList *headList); + // 获取检定数据管理 首页 static QList getVerificationData(); // 检定数据管理-检定基本信息 @@ -494,6 +515,7 @@ static QList getCheckDataManageResultManageMult(QString equipment_id); //技术文件 static QList getTechnique_File(); + //检定程序管理首页查询 static QList getVerificationProgramInfoMain(); //检定程序管理 编辑 @@ -525,7 +547,6 @@ IdWorker &idWorker = Singleton::instance(); //自动检定 - }; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp index c3b2786..70148f4 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp @@ -4,6 +4,7 @@ #include "basecommonapi.h" //#include "tested_device_manage_serve.h" +#include "QStringList" //被检设备 BeExamined_DeviceItem::BeExamined_DeviceItem(QWidget *parent) : @@ -32,19 +33,32 @@ "}"); // ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); // item->setTextAlignment(Qt::AlignCenter); //ui->tableWidget->setItem(0, 0, item); //设置数据 - + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" + headers << "ID" << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" << "生产厂家"<<"所在单位" <<"使用部门"<<"计量标识"<<"检定周期"<<"证书有效期"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); + //详情页面tableWidgetItem设置 + ui->tableWidgetItem->setStyleSheet("QHeaderView::section {" + "border: 1px solid rgba(197, 196, 196, 1);" + "border-left:none;" + "border-top:none;" + "background-color:white;" + "}"); + + // ui->tableWidget->setRowCount(10); // 设置10行 + //ui->tableWidgetItem->setColumnCount(14); // 设置11列 + ui->tableWidgetItem->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 + ui->tableWidgetItem->verticalHeader()->setParent(nullptr); //隐藏行头 + } void BeExamined_DeviceItem::ShowMessageBox(QString title,QString value) { // 创建一个QMessageBox对象 @@ -64,24 +78,19 @@ } void BeExamined_DeviceItem::Load() { - //获取主页面内容 - //进入主页面 - /* - ui->stackedWidget->setCurrentIndex(0); + // ======================================================================================== + // 主页面初始化 + // ==================================================================================== + + + ui->stackedWidget->setCurrentIndex(0); //先设置为行为0 ui->tableWidget->setRowCount(0); - - - // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BeExamined_DeviceItem dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; int row=0; - QList data = dbManager.getBizDeviceManage(); - - - for (const BizDevice& bizDevice : data) { + QList data = dbManager.getTestedDevice(); + for (const TestedDevice& bizDevice : data) { rowCount = ui->tableWidget->rowCount(); ui->tableWidget->insertRow(rowCount); @@ -89,34 +98,118 @@ ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); ui->tableWidget->setItem(row, 2, new QTableWidgetItem(bizDevice.equipment_name)); ui->tableWidget->setItem(row, 3, new QTableWidgetItem(bizDevice.model)); - ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacture_no)); - ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.help_instruction)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacture_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(bizDevice.FULL_NAME)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(bizDevice.meter_identify)); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem(bizDevice.check_cycle)); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(bizDevice.certificate_valid)); + //添加操作按钮 QPushButton *button = new QPushButton("查看"); - ui->tableWidget->setCellWidget(row, 6, button); + ui->tableWidget->setCellWidget(row, 12, button); //设置按钮简单样式 button->setStyleSheet("QPushButton {" - " border: none; /* 无边框 "*/ - // " color: green; /* 文本颜色 */" - // " text-decoration: underline; /* 文本下划线 */" - // "}"); + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); // 设置鼠标悬停时的光标样式为小手图标 - // button->setCursor(Qt::PointingHandCursor); + button->setCursor(Qt::PointingHandCursor); // 连接按钮的 clicked 信号到自定义槽函数 - // connect(button, &QPushButton::clicked, this, [this, button, row]() { - // 获取当前行第一列的 ID - // QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); - // if (idItem) { - // QString id = idItem->text(); -// - // OnButtonSelectClicked(id); - // } + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); - // }); + OnButtonSelectClicked(id); + } - // row++; - - // } + }); + row++; + } } +void BeExamined_DeviceItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + + DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +//返回按钮 +void BeExamined_DeviceItem::on_pushButton_2_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); +} +void BeExamined_DeviceItem::DeviceInfoInit(QString id) +{ + // ======================================================================================== + // 初始化详情 + // ==================================================================================== + + QList data = dbManager.getTestedCatDevice(id); + for (const TestedCatDevice& testedCatDevice : data) { + + ui->equipment_name->setText(testedCatDevice.equipment_name); + ui->model->setText(testedCatDevice.model); + ui->help_instruction->setText(testedCatDevice.help_instruction); + ui->manufacture_no->setText(testedCatDevice.manufacture_no); + ui->product_country->setText(testedCatDevice.product_country); + ui->manufacturer->setText(testedCatDevice.manufacturer); + ui->product_date->setText(testedCatDevice.product_date); + ui->purchase_date->setText(testedCatDevice.purchase_date); + ui->unit_price->setText(testedCatDevice.unit_price); + ui->usage_status->setText(testedCatDevice.usage_status); + ui->quality_condition->setText(testedCatDevice.quality_condition); + ui->dept_name->setText(testedCatDevice.FULL_NAME); + ui->category->setText(testedCatDevice.category); + ui->check_cycle->setText(testedCatDevice.check_cycle); + ui->level->setText(testedCatDevice.level); + ui->remark->setText(testedCatDevice.remark); + } + + + // ======================================================================================== + // 初始化检定项目及核查点 + // ==================================================================================== + + //获取核查点tablewight的数据 + QStringList headlist; + + QList Data=dbManager.Search_CalibrationTable(id,&headlist); + + //tableWidgetItem + ui->tableWidgetItem->setRowCount(0); + ui->tableWidgetItem->setColumnCount(headlist.count()); + ui->tableWidgetItem->setHorizontalHeaderLabels(headlist); + //循环数据 + int rowCount=0; + int row=0; + ; + for (const QStringList& item : Data) + { + //获取行号 并进行添加行 + rowCount = ui->tableWidgetItem->rowCount(); + ui->tableWidgetItem->insertRow(rowCount); + //添加 序号 + ui->tableWidgetItem->setItem(row, 0, new QTableWidgetItem(QString::number(row+1))); + //循环读取值 headlist,count是列的数量 + for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型 + } + + row++; + + } +} + + + diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h index ffdc22a..0050ee7 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h @@ -21,6 +21,11 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + + void DeviceInfoInit(QString id); + + void on_pushButton_2_clicked(); private: Ui::BeExamined_DeviceItem *ui; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui index ce63879..cdacfaf 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui @@ -215,6 +215,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -225,6 +230,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 @@ -391,7 +401,7 @@ - + ForbiddenCursor @@ -412,7 +422,7 @@ - + ForbiddenCursor @@ -428,12 +438,12 @@ - 出厂编号: + 辅助字段: - + ForbiddenCursor @@ -449,12 +459,12 @@ - 检定有效期: + 出厂编号: - + ForbiddenCursor @@ -475,7 +485,7 @@ - + ForbiddenCursor @@ -496,7 +506,7 @@ - + ForbiddenCursor @@ -517,7 +527,7 @@ - + ForbiddenCursor @@ -538,7 +548,7 @@ - + ForbiddenCursor @@ -552,14 +562,14 @@ - + - 使用年限: + 设备单价: - + ForbiddenCursor @@ -573,14 +583,14 @@ - + - 设备单价: + 使用状态: - + ForbiddenCursor @@ -594,14 +604,14 @@ - + - 使用状态: + 质量状况: - + ForbiddenCursor @@ -615,14 +625,14 @@ - + - 质量状况: + 所在单位: - + ForbiddenCursor @@ -638,12 +648,12 @@ - 所属部门: + 使用部门: - + ForbiddenCursor @@ -657,14 +667,14 @@ - + - 负责人: + 设备分类: - + ForbiddenCursor @@ -678,14 +688,14 @@ - + - 设备供方: + 检定周期: - + ForbiddenCursor @@ -699,14 +709,14 @@ - + - 位置信息: + 重要等级: - + ForbiddenCursor @@ -720,140 +730,14 @@ - - - 设备类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 标准类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 设备分类: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 重要等级: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 检定周期: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 对应开箱记录: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - 备注: - - + + ForbiddenCursor @@ -892,7 +776,7 @@ - + diff --git a/softwareDirectory/AutoVerScheme/create_task.cpp b/softwareDirectory/AutoVerScheme/create_task.cpp index 9b49a1a..ddd78ef 100644 --- a/softwareDirectory/AutoVerScheme/create_task.cpp +++ b/softwareDirectory/AutoVerScheme/create_task.cpp @@ -2,12 +2,15 @@ #include "ui_create_task.h" #include "QMessageBox" + + QString Create_Task::State=""; Create_Task::Create_Task(QWidget *parent) : InfoBase(parent), ui(new Ui::Create_Task) { ui->setupUi(this); this->initForm(); + } Create_Task::~Create_Task() @@ -25,17 +28,19 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(8); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(9); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "任务单编号" << "委托方"<< "使用部门" << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; + headers <<"ID"<< "序号" << "任务单编号" << "委托方"<< "使用部门" + << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); //ShowMessageBox("标题","初始化完成"); } @@ -57,5 +62,171 @@ } void Create_Task::Load() { - //ShowMessageBox("创建任务界面","创建任务界面初始化完成"); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + + QList data = BaseCommonApi::getCreateTaskList(""); + + int rowCount = 0; + int row=0; + QString is_urgent; + for (const CreateTaskList& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.order_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.customer_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.DEPT_FULL_NAME)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.require_over_time.toString())); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.deliverer)); + if(item.is_urgent=="1") + is_urgent="是"; + else + is_urgent="否"; + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(is_urgent)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("查看"); + QPushButton *button2 = new QPushButton("编辑"); + QPushButton *button3 = new QPushButton("删除"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + Create_Task::State="Select"; + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonUpdateClicked(id); + Create_Task::State="Update"; + } + + }); + //设置按钮3简单样式 + button3->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: red; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button3->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button3, &QPushButton::clicked, this, [this, button3, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtoDeleteClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->addWidget(button3); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 8, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void Create_Task::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + HiddenButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "查看按钮ID",id); +} +void Create_Task::OnButtonUpdateClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "编辑按钮ID",id); +} +void Create_Task::OnButtoDeleteClicked(QString id) +{ + // ======================================================================================== + // 删除按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + + QMessageBox::information(this, "删除按钮ID",id); +} + +void Create_Task::on_pushButton_2_clicked() +{ + // ======================================================================================== + // 创建任务单按钮 + // ==================================================================================== + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + Create_Task::State="Create"; +} +void Create_Task::HiddenButton() +{ + ui->SaveButton->hide(); + ui->CreateButton->hide(); + ui->ScanButton->hide(); + ui->deletebutton->hide(); +} +void Create_Task::DisplayButton() +{ + ui->SaveButton->show(); + ui->CreateButton->show(); + ui->ScanButton->show(); + ui->deletebutton->show(); +} + +void Create_Task::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/create_task.h b/softwareDirectory/AutoVerScheme/create_task.h index 7cf383f..6b67c7c 100644 --- a/softwareDirectory/AutoVerScheme/create_task.h +++ b/softwareDirectory/AutoVerScheme/create_task.h @@ -16,11 +16,22 @@ explicit Create_Task(QWidget *parent = nullptr); ~Create_Task(); + //全局静态变量 + static QString State; private slots: void initForm(); //初始化界面数据 void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonUpdateClicked(QString id); + void OnButtoDeleteClicked(QString id); + void on_pushButton_2_clicked(); + void HiddenButton(); + void DisplayButton(); + + void on_pushButton_clicked(); + private: Ui::Create_Task *ui; }; diff --git a/softwareDirectory/AutoVerScheme/create_task.ui b/softwareDirectory/AutoVerScheme/create_task.ui index d9d88ed..b45af33 100644 --- a/softwareDirectory/AutoVerScheme/create_task.ui +++ b/softwareDirectory/AutoVerScheme/create_task.ui @@ -19,278 +19,651 @@ - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 1 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 任务单编号: - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - 委托方: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 使用部门: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 要求完成时间: - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(3, 58, 132); + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 任务单编号: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 委托方: + + + + + + + + + + 使用部门: + + + + + + + + + + 要求检完时间: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); color:white; - - - 查询 - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(207, 132, 33); + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); color:white; - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - 6 + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + 3 + + + + + + 50 + 40 + + + + + 100 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 创建任务单 + + + + + + + + + + + + + + + + + + + + + color:black; - - 9 - - - 9 - - - 9 - - - - - - 0 - 0 - - - - - 120 - 40 - - - - OpenHandCursor - - - Qt::DefaultContextMenu - - - Qt::RightToLeft - - - false - - - background-color:rgb(9, 89, 179); + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 创建任务单 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 保存 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; color:white; - - - 创建任务单 - - - true - - - - - - - - - - - - - - SizeVerCursor - - - - - - - + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接人: + + + + + + + 要求检完时间: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 是否加急: + + + + + + + 电话: + + + + + + + 委托方: + + + + + + + 任务单编号: + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接时间: + + + + + + + 送检人: + + + + + + + 接收说明: + + + + + + + 使用部门: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + 任务单列表: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 扫描增加 + + + false + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 增加行 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 删除行 + + + + + + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/depar_task.ui b/softwareDirectory/AutoVerScheme/depar_task.ui index efb7561..f44829d 100644 --- a/softwareDirectory/AutoVerScheme/depar_task.ui +++ b/softwareDirectory/AutoVerScheme/depar_task.ui @@ -213,86 +213,6 @@ - - - 12 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - diff --git a/softwareDirectory/AutoVerScheme/infomanageview.ui b/softwareDirectory/AutoVerScheme/infomanageview.ui index ef0b87b..cb76a28 100644 --- a/softwareDirectory/AutoVerScheme/infomanageview.ui +++ b/softwareDirectory/AutoVerScheme/infomanageview.ui @@ -20,7 +20,7 @@ color:black; background-color:rgba(240, 240, 240, 1); - + 0 @@ -37,77 +37,124 @@ 0 - - - - 0 - 0 - - - - - 170 - 0 - - - - - 16777215 - 16777215 - - + - color:White; - font-weight: bold; - font-size: 16px; -background-color:rgba(10, 15, 92, 1); + border-image: url(:/image/Index/u15.png); - - true - - - - - 0 - 0 - 170 - 625 - - - - - 0 - 0 - - - - - 170 - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - + + + + + + 50 + 50 + + + + + 35 + 35 + + + + image: url(:/image/Index/u2158.svg); + + + + + + + + + + color:white; +font-size:18px; +font-weight:bold; + + + 信息管理 + + + + - + + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 16777215 + 16777215 + + + + color:White; + font-weight: bold; + font-size: 16px; +background-color:rgba(10, 15, 92, 1); + + + true + + + + + 0 + 0 + 170 + 570 + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp index efc00ba..eea27f0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp @@ -25,17 +25,17 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 - + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0,0); //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "出厂编号" + headers <<"ID"<< "序号" << "设备名称" << "型号规则" << "出厂编号" <<"核查件名称"<<"核查件型号"<<"核查件编号" <<"核查员" << "核查日期" <<"实验室"<<"部门"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); @@ -58,5 +58,114 @@ } void InspectDataItem::Load() { - //ShowMessageBox("核查数据","核查数据"); + // ======================================================================================== + // 主页面初始化 核查管理初始化 + // ==================================================================================== + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + // 调用数据库管理器的函数获取数据 + int rowCount=0; + int row=0; + QList data = dbManager.getCheckData(); + for (const CheckData& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.equipment_name)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.model)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.manufacture_no)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.meter_standard_name)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(item.meter_standard_id)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(item.create_user_name)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(item.check_date.toString())); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(item.dept_name)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("详情"); + QPushButton *button2 = new QPushButton("预览"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonPreViewtClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 12, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void InspectDataItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +void InspectDataItem::OnButtonPreViewtClicked(QString id) +{ + // ======================================================================================== + // 预览按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} + +void InspectDataItem::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.h b/softwareDirectory/AutoVerScheme/inspectdataitem.h index bdf7066..6644339 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.h +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.h @@ -20,6 +20,10 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonPreViewtClicked(QString id); + void on_pushButton_clicked(); + private: Ui::InspectDataItem *ui; }; diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.ui b/softwareDirectory/AutoVerScheme/inspectdataitem.ui index 86786c9..3f319c0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.ui +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.ui @@ -7,232 +7,928 @@ 0 0 1362 - 543 + 553 Form - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 0 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 设备名称: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 型号规则: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 出厂编号: - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 核查员: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 核查日期: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 实验室: - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - Qt::RightToLeft - - - 查询 - - - - - - - Qt::RightToLeft - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - - - - - - - - - - + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 设备名称: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 型号规则: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 出厂编号: + + + + + + + + 0 + 0 + + + + + + + + 核查员: + + + + + + + + + + 实验室: + + + + + + + + + + 核查日期: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + + + + + + + + + + + + + + + + + color:black; + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 核查数据详情 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; +color:white; + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + 设备基本信息: + + + + + + + 设备名称: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 型号规格: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 出厂编号: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定有效期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产国家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产厂家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 购进日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用年限: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备单价: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用状态: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 质量状况: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 所属部门: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 负责人: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备供方: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 位置信息: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 标准类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备分类: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 重要等级: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定周期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 对应开箱记录: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 备注: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + 3 + + + false + + + Qt::LogicalMoveStyle + + + + + + + + + + + + + + + + 核查项目及核查点: + + + + + + + + + + + + + + 0 + 0 + + + + + 30 + 0 + + + + + + + + + + false + + + + 6 + + + 0 + + + 0 + + + 0 + + + 6 + + + + + 检定项备注: + + + + + + + background-color: #f0f0f0; +color: grey; + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/my_task.ui b/softwareDirectory/AutoVerScheme/my_task.ui index a078840..e04a336 100644 --- a/softwareDirectory/AutoVerScheme/my_task.ui +++ b/softwareDirectory/AutoVerScheme/my_task.ui @@ -157,6 +157,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -167,6 +172,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 diff --git a/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg b/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg new file mode 100644 index 0000000..fd249e0 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/softwareDirectory/AutoVerScheme/res/res.qrc b/softwareDirectory/AutoVerScheme/res/res.qrc index a0eac47..05edcdc 100644 --- a/softwareDirectory/AutoVerScheme/res/res.qrc +++ b/softwareDirectory/AutoVerScheme/res/res.qrc @@ -44,7 +44,11 @@ image/Index/u7488.svg image/Index/u7491.svg image/Index/u7538.svg +<<<<<<< HEAD image/Index/u2324.svg image/Index/u2325.svg +======= + image/Index/u2158.svg +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c diff --git a/softwareDirectory/AutoVerScheme/rulefileitem.cpp b/softwareDirectory/AutoVerScheme/rulefileitem.cpp index 095165e..9361752 100644 --- a/softwareDirectory/AutoVerScheme/rulefileitem.cpp +++ b/softwareDirectory/AutoVerScheme/rulefileitem.cpp @@ -27,17 +27,17 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(9); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(10); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + ui->tableWidget->setColumnWidth(0, 0); //设置数据 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "文件号" << "文件名称" << "版本号" << "文件类型"<< "颁布时间" + headers <<"ID"<< "序号" << "文件号" << "文件名称" << "版本号" << "文件类型"<< "颁布时间" << "实施时间" <<"备注"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); } @@ -58,6 +58,106 @@ msgBox.exec(); } void RuleFileItem::Load() +{// ======================================================================================== + // 主页面初始化 技术文件初始化 + // ==================================================================================== + ui->tableWidget->setRowCount(0); + + //先设置为行为0 + ui->tableWidget->setRowCount(0); + // 调用数据库管理器的函数获取数据 + int rowCount=0; + int row=0; + QList data = dbManager.getTechnique_File(); + for (const Technique_File& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.file_distribute_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.file_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.version_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.active_date.toString())); + ui->tableWidget->setItem(row, 7, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(item.remark)); + + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("详情"); + QPushButton *button2 = new QPushButton("预览"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonPreViewtClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 9, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void RuleFileItem::OnButtonSelectClicked(QString id) { - //ShowMessageBox("技术文件","技术文件初始化完成"); + // ======================================================================================== + // 详情按钮 点击事件 进入详情页面 + // ==================================================================================== + + QMessageBox::information(this, "详情按钮ID",id); +} +void RuleFileItem::OnButtonPreViewtClicked(QString id) +{ + // ======================================================================================== + // 下载按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "下载按钮ID",id); } diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/InfoBase.h b/softwareDirectory/AutoVerScheme/InfoBase.h index 6dd59f3..bce9609 100644 --- a/softwareDirectory/AutoVerScheme/InfoBase.h +++ b/softwareDirectory/AutoVerScheme/InfoBase.h @@ -4,6 +4,7 @@ #include #include "QStandardItemModel" #include "databaseconnection.h" +#include "basecommonapi.h" ///信号管理页面的基类 所有信息管理页面都继承于InfoBase /// 便于统一管理 所有子类必须实现Load方法 /// 每次按钮点击切换都会调用Load方法 用于每次页面的数据刷新 @@ -16,7 +17,7 @@ //QStandardItemModel 的实例。这个模型将用于存储和管理数据。 QStandardItemModel *model; //信息管理页面 基类定义Conn对象 - DatabaseConnection *Conn=DatabaseConnection::getInstance(); + BaseCommonApi dbManager; }; #endif // INFOBASE_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index f62915b..6170ee7 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -15,7 +15,7 @@ " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id " " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID " " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID " - " WHERE sys_user.ID = ' :userId '"); + " WHERE sys_user.ID = :userId"); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -75,6 +75,35 @@ } return result; } + +//获取创建任务首页数据 +QList BaseCommonApi::getCreateTaskList(QString userId) +{ + userId="1640229293790650370"; + QList result; + QSqlQuery query; + query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " + " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " + " WHERE bi.create_user_id = :userId"); + // 将参数绑定到占位符 + query.bindValue(":userId", userId); + if (query.exec()) { + while (query.next()) { + CreateTaskList task; + task.id = query.value("id").toString(); + task.order_no = query.value("order_no").toString(); + task.customer_name = query.value("customer_name").toString(); + task.DEPT_FULL_NAME = query.value("FULL_NAME").toString(); + task.require_over_time = query.value("require_over_time").toDateTime(); + task.deliverer = query.value("deliverer").toString(); + task.is_urgent = query.value("is_urgent").toString(); + result.append(task); + } + } else { + qDebug() << "Query execution failed: " << query.lastError().text(); + } + return result; +} //获取创建任务首页数据 QListgetCreateTaskList(QString userId) { @@ -82,7 +111,7 @@ QSqlQuery query; query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " - " WHERE bi.create_user_id = ':userId' "); + " WHERE bi.create_user_id = :userId "); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -103,6 +132,7 @@ return result; } + //创建任务单-查看/编辑 顶部数据 传参该条数据的id QListBaseCommonApi::getCatTask(QString id) { @@ -111,7 +141,7 @@ query.prepare("SELECT bi.order_no ,bi.customer_name ,dept.FULL_NAME ,bi.require_over_time ," " bi.deliverer ,bi.deliverer_tel ,bi.undertaker_name ,bi.undertake_time , bi.is_urgent AS ," " bi.receive_illustrate FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID" - " WHERE bi.id = ' :id '"); + " WHERE bi.id = :id "); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -140,6 +170,7 @@ //获取创建任务 -任务单列表 + QListBaseCommonApi::getCatTaskList(QString orderId) { QList result; @@ -380,6 +411,7 @@ QListBaseCommonApi::getCheckDCPower(QString equipment_id,QStringList *headList) { + equipment_id="1693435753272557570"; QList result; QSqlQuery query; query.prepare("SELECT besciddp.id ,besciddp.params,besciddp.unit,resolution,besciddp.urel,besciddp.check_type,datum_point,cycle_number " @@ -407,9 +439,11 @@ } else { qDebug() << "Query execution failed: " << query.lastError().text(); } + *headList <<"序号"<<"核查项目"<<"核查点"<<"单位"<<"分辨力"<<"Urel"<<"核查类型"<<"是否为基准点(1/0)"<<"循环次数" <<"电阻值/频率"<<"电阻值单位/频率单位"<<"核查项备注"; + return result; } //根据id获取装置名称 @@ -436,9 +470,9 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " - " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id " - " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); +bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " + " JOIN sys_dept ON sys_dept.ID = eei.dept_id " + " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); if (isSuccess) { while (query.next()) { TestedDevice testedDevice; @@ -504,9 +538,10 @@ //判断 哪个 装置表 传参 设备id QList BaseCommonApi::getJudgeCalibrationTable(QString id) { + id="1716997603953311746"; QList result; QSqlQuery query; - query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = ':id')"); + query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = :id )"); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -526,12 +561,55 @@ return result; } +//标准装置字典类型 +/** + * 多功能校准源标准装置 = 1 + * 直流稳压电源检定装置 = 2 + * 多功能电气安全校准器标准装置 = 3 + * 0.02级活塞式压力计标准装置 = 4 + * 二等铂电阻温度计标准装置 = 5 + * 安全阀校验装置 = 6 + * 精密露点仪标准装置 = 7 + * E2等级砝码标准装置 = 8 + * 频谱分析仪标准装置 = 9 + * 信号发生器标准装置 = 10 + * 微波衰减标准装置 = 11 + * 频率短期稳定度标准装置 =12 + * 示波器标准装置 = 13 + * 铯原子频率标准装置 =14 + * 小功率标准装置 = 15 + * 低频信号发生器标准装置 = 16 + * S参数标准装置 = 17 + * 失真度标准装置 = 18 + */ +//根据被检设备ID获取当前设备的 核查项目及核查点 + +QList BaseCommonApi::Search_CalibrationTable(QString DeiverId,QStringList *HeadList) +{ + + QList DataList; + DataList.clear(); + QList CliTable=BaseCommonApi::getJudgeCalibrationTable(DeiverId); + if(CliTable.count()==0)return DataList; + switch (CliTable[0].belong_standard_equipment.toInt()) + { + case 1: + + //CliTable[0].item_category_id + DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList); + break; + } + + return DataList; +} //被检设备管理-检定项目及检定点-多功能校准源 -QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) +QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) { -QList result; +QList resultData; +QStringList result; +resultData.clear(); QSqlQuery query; query.prepare("SELECT bbdmidc.id ,bbdmidc.params ,bbdmidc.capacity ,bbdmidc.unit ,bbdmidc.frequency , bbdmidc.range_range , bbdmidc.standard_value , bbdmidc.resolution , bbdmidc.maximum_error , bbdmidc.error_param_a , bbdmidc.error_param_b " @@ -542,26 +620,24 @@ if (query.exec()) { while (query.next()) { - VerMultiCal calibration; - calibration.id = query.value("id").toString(); - calibration.params = query.value("params").toString(); - calibration.capacity = query.value("capacity").toString(); - calibration.unit = query.value("unit").toString(); - calibration.frequency = query.value("frequency").toString(); - calibration.range_range = query.value("range_range").toString(); - calibration.standard_value = query.value("standard_value").toString(); - calibration.resolution = query.value("resolution").toString(); - calibration.maximum_error = query.value("maximum_error").toString(); - calibration.error_param_a = query.value("error_param_a").toString(); - calibration.error_param_b = query.value("error_param_b").toString(); - - result.append(calibration); + result.clear(); + result.append(query.value("id").toString()); + result.append(query.value("params").toString()); + result.append(query.value("capacity").toString()); + result.append(query.value("unit").toString()); + result.append(query.value("frequency").toString()); + result.append(query.value("range_range").toString()); + result.append(query.value("standard_value").toString()); + result.append(query.value("resolution").toString()); + result.append(query.value("maximum_error").toString()); + result.append(query.value("error_param_a").toString()); + result.append(query.value("error_param_b").toString()); + resultData.append(result); } } else { qDebug() << "Query execution failed: " << query.lastError().text(); } - *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; - return result; + *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; } //检定数据管理 首页 @@ -757,7 +833,7 @@ " LEFT JOIN biz_equipment_standard_check_info besci ON besci.item_category_id = bescidc.item_category_id " " WHERE bescidc.equipment_id = :equipment_id "); - // 将参数绑定到占位符 '1692796512381222914' + // 将参数绑定到占位符 1692796512381222914 query.bindValue(":equipment_id", equipment_id); if (query.exec()) { while (query.next()) { @@ -788,12 +864,13 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " + bool isSuccess = query.exec("SELECT brtf.id,brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " " FROM biz_resource_technique_file brtf"); if (isSuccess) { while (query.next()) { Technique_File file; + file.id=query.value("id").toString(); file.file_distribute_no = query.value("file_distribute_no").toString(); file.file_name = query.value("file_name").toString(); file.version_no = query.value("version_no").toString(); @@ -876,7 +953,7 @@ QList result; QSqlQuery query; query.prepare("SELECT id,device_id ,communication_type ,serial_port ,visa ,create_time ,update_time " - "FROM zd_communication_setting WHERE device_id = ' :deviceId '"); + "FROM zd_communication_setting WHERE device_id = :deviceId "); query.bindValue(":deviceId", deviceId); if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h index 1b70cb9..ff8a320 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.h +++ b/softwareDirectory/AutoVerScheme/basecommonapi.h @@ -9,7 +9,7 @@ #include "databaseconnection.h" #include "id\IdWorker.h" - +#include "QStringList" //部门任务 @@ -52,6 +52,7 @@ QDateTime require_over_time; QString deliverer; QString is_urgent; + }; //创建任务单-查看任务单 class CatTask @@ -241,9 +242,15 @@ QString belong_standard_equipment; }; +class BaseEntity: public QObject +{ + Q_OBJECT + public: + +}; //被检设备管理-检定项目及检定点-检定项多功能校准源 -class VerMultiCal +class VerMultiCal:public BaseEntity { public: QString id; @@ -365,6 +372,7 @@ class Technique_File { public: + QString id; QString file_distribute_no; QString file_name; QString version_no; @@ -444,12 +452,22 @@ public: BaseCommonApi(); + // + static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList); + //部门任务 + static QList getAllData(); + //部门任务 参数登录用户的id static QList getAllData(QString userId); + //我的任务 static QList getMyTasks(QString id); //获取创建任务首页数据 - static QListgetCreateTaskList(QString id); + + static QListgetCreateTaskList(QString userId); + + + //创建任务-查看任务单顶部 static QListgetCatTask(QString orderNo); //创建任务-查看任务列表底部 @@ -479,7 +497,10 @@ //判断 哪个 装置表 传参 设备id 返回itemId static QList getJudgeCalibrationTable(QString id); //被检设备管理-检定项目及检定点-多功能校准源 - static QList getVerMultiCal(QString itemId,QStringList *headList); + + + static QList getVerMultiCal(QString itemId,QStringList *headList); + // 获取检定数据管理 首页 static QList getVerificationData(); // 检定数据管理-检定基本信息 @@ -494,6 +515,7 @@ static QList getCheckDataManageResultManageMult(QString equipment_id); //技术文件 static QList getTechnique_File(); + //检定程序管理首页查询 static QList getVerificationProgramInfoMain(); //检定程序管理 编辑 @@ -525,7 +547,6 @@ IdWorker &idWorker = Singleton::instance(); //自动检定 - }; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp index c3b2786..70148f4 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp @@ -4,6 +4,7 @@ #include "basecommonapi.h" //#include "tested_device_manage_serve.h" +#include "QStringList" //被检设备 BeExamined_DeviceItem::BeExamined_DeviceItem(QWidget *parent) : @@ -32,19 +33,32 @@ "}"); // ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); // item->setTextAlignment(Qt::AlignCenter); //ui->tableWidget->setItem(0, 0, item); //设置数据 - + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" + headers << "ID" << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" << "生产厂家"<<"所在单位" <<"使用部门"<<"计量标识"<<"检定周期"<<"证书有效期"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); + //详情页面tableWidgetItem设置 + ui->tableWidgetItem->setStyleSheet("QHeaderView::section {" + "border: 1px solid rgba(197, 196, 196, 1);" + "border-left:none;" + "border-top:none;" + "background-color:white;" + "}"); + + // ui->tableWidget->setRowCount(10); // 设置10行 + //ui->tableWidgetItem->setColumnCount(14); // 设置11列 + ui->tableWidgetItem->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 + ui->tableWidgetItem->verticalHeader()->setParent(nullptr); //隐藏行头 + } void BeExamined_DeviceItem::ShowMessageBox(QString title,QString value) { // 创建一个QMessageBox对象 @@ -64,24 +78,19 @@ } void BeExamined_DeviceItem::Load() { - //获取主页面内容 - //进入主页面 - /* - ui->stackedWidget->setCurrentIndex(0); + // ======================================================================================== + // 主页面初始化 + // ==================================================================================== + + + ui->stackedWidget->setCurrentIndex(0); //先设置为行为0 ui->tableWidget->setRowCount(0); - - - // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BeExamined_DeviceItem dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; int row=0; - QList data = dbManager.getBizDeviceManage(); - - - for (const BizDevice& bizDevice : data) { + QList data = dbManager.getTestedDevice(); + for (const TestedDevice& bizDevice : data) { rowCount = ui->tableWidget->rowCount(); ui->tableWidget->insertRow(rowCount); @@ -89,34 +98,118 @@ ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); ui->tableWidget->setItem(row, 2, new QTableWidgetItem(bizDevice.equipment_name)); ui->tableWidget->setItem(row, 3, new QTableWidgetItem(bizDevice.model)); - ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacture_no)); - ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.help_instruction)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacture_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(bizDevice.FULL_NAME)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(bizDevice.meter_identify)); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem(bizDevice.check_cycle)); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(bizDevice.certificate_valid)); + //添加操作按钮 QPushButton *button = new QPushButton("查看"); - ui->tableWidget->setCellWidget(row, 6, button); + ui->tableWidget->setCellWidget(row, 12, button); //设置按钮简单样式 button->setStyleSheet("QPushButton {" - " border: none; /* 无边框 "*/ - // " color: green; /* 文本颜色 */" - // " text-decoration: underline; /* 文本下划线 */" - // "}"); + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); // 设置鼠标悬停时的光标样式为小手图标 - // button->setCursor(Qt::PointingHandCursor); + button->setCursor(Qt::PointingHandCursor); // 连接按钮的 clicked 信号到自定义槽函数 - // connect(button, &QPushButton::clicked, this, [this, button, row]() { - // 获取当前行第一列的 ID - // QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); - // if (idItem) { - // QString id = idItem->text(); -// - // OnButtonSelectClicked(id); - // } + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); - // }); + OnButtonSelectClicked(id); + } - // row++; - - // } + }); + row++; + } } +void BeExamined_DeviceItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + + DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +//返回按钮 +void BeExamined_DeviceItem::on_pushButton_2_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); +} +void BeExamined_DeviceItem::DeviceInfoInit(QString id) +{ + // ======================================================================================== + // 初始化详情 + // ==================================================================================== + + QList data = dbManager.getTestedCatDevice(id); + for (const TestedCatDevice& testedCatDevice : data) { + + ui->equipment_name->setText(testedCatDevice.equipment_name); + ui->model->setText(testedCatDevice.model); + ui->help_instruction->setText(testedCatDevice.help_instruction); + ui->manufacture_no->setText(testedCatDevice.manufacture_no); + ui->product_country->setText(testedCatDevice.product_country); + ui->manufacturer->setText(testedCatDevice.manufacturer); + ui->product_date->setText(testedCatDevice.product_date); + ui->purchase_date->setText(testedCatDevice.purchase_date); + ui->unit_price->setText(testedCatDevice.unit_price); + ui->usage_status->setText(testedCatDevice.usage_status); + ui->quality_condition->setText(testedCatDevice.quality_condition); + ui->dept_name->setText(testedCatDevice.FULL_NAME); + ui->category->setText(testedCatDevice.category); + ui->check_cycle->setText(testedCatDevice.check_cycle); + ui->level->setText(testedCatDevice.level); + ui->remark->setText(testedCatDevice.remark); + } + + + // ======================================================================================== + // 初始化检定项目及核查点 + // ==================================================================================== + + //获取核查点tablewight的数据 + QStringList headlist; + + QList Data=dbManager.Search_CalibrationTable(id,&headlist); + + //tableWidgetItem + ui->tableWidgetItem->setRowCount(0); + ui->tableWidgetItem->setColumnCount(headlist.count()); + ui->tableWidgetItem->setHorizontalHeaderLabels(headlist); + //循环数据 + int rowCount=0; + int row=0; + ; + for (const QStringList& item : Data) + { + //获取行号 并进行添加行 + rowCount = ui->tableWidgetItem->rowCount(); + ui->tableWidgetItem->insertRow(rowCount); + //添加 序号 + ui->tableWidgetItem->setItem(row, 0, new QTableWidgetItem(QString::number(row+1))); + //循环读取值 headlist,count是列的数量 + for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型 + } + + row++; + + } +} + + + diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h index ffdc22a..0050ee7 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h @@ -21,6 +21,11 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + + void DeviceInfoInit(QString id); + + void on_pushButton_2_clicked(); private: Ui::BeExamined_DeviceItem *ui; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui index ce63879..cdacfaf 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui @@ -215,6 +215,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -225,6 +230,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 @@ -391,7 +401,7 @@ - + ForbiddenCursor @@ -412,7 +422,7 @@ - + ForbiddenCursor @@ -428,12 +438,12 @@ - 出厂编号: + 辅助字段: - + ForbiddenCursor @@ -449,12 +459,12 @@ - 检定有效期: + 出厂编号: - + ForbiddenCursor @@ -475,7 +485,7 @@ - + ForbiddenCursor @@ -496,7 +506,7 @@ - + ForbiddenCursor @@ -517,7 +527,7 @@ - + ForbiddenCursor @@ -538,7 +548,7 @@ - + ForbiddenCursor @@ -552,14 +562,14 @@ - + - 使用年限: + 设备单价: - + ForbiddenCursor @@ -573,14 +583,14 @@ - + - 设备单价: + 使用状态: - + ForbiddenCursor @@ -594,14 +604,14 @@ - + - 使用状态: + 质量状况: - + ForbiddenCursor @@ -615,14 +625,14 @@ - + - 质量状况: + 所在单位: - + ForbiddenCursor @@ -638,12 +648,12 @@ - 所属部门: + 使用部门: - + ForbiddenCursor @@ -657,14 +667,14 @@ - + - 负责人: + 设备分类: - + ForbiddenCursor @@ -678,14 +688,14 @@ - + - 设备供方: + 检定周期: - + ForbiddenCursor @@ -699,14 +709,14 @@ - + - 位置信息: + 重要等级: - + ForbiddenCursor @@ -720,140 +730,14 @@ - - - 设备类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 标准类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 设备分类: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 重要等级: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 检定周期: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 对应开箱记录: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - 备注: - - + + ForbiddenCursor @@ -892,7 +776,7 @@ - + diff --git a/softwareDirectory/AutoVerScheme/create_task.cpp b/softwareDirectory/AutoVerScheme/create_task.cpp index 9b49a1a..ddd78ef 100644 --- a/softwareDirectory/AutoVerScheme/create_task.cpp +++ b/softwareDirectory/AutoVerScheme/create_task.cpp @@ -2,12 +2,15 @@ #include "ui_create_task.h" #include "QMessageBox" + + QString Create_Task::State=""; Create_Task::Create_Task(QWidget *parent) : InfoBase(parent), ui(new Ui::Create_Task) { ui->setupUi(this); this->initForm(); + } Create_Task::~Create_Task() @@ -25,17 +28,19 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(8); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(9); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "任务单编号" << "委托方"<< "使用部门" << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; + headers <<"ID"<< "序号" << "任务单编号" << "委托方"<< "使用部门" + << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); //ShowMessageBox("标题","初始化完成"); } @@ -57,5 +62,171 @@ } void Create_Task::Load() { - //ShowMessageBox("创建任务界面","创建任务界面初始化完成"); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + + QList data = BaseCommonApi::getCreateTaskList(""); + + int rowCount = 0; + int row=0; + QString is_urgent; + for (const CreateTaskList& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.order_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.customer_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.DEPT_FULL_NAME)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.require_over_time.toString())); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.deliverer)); + if(item.is_urgent=="1") + is_urgent="是"; + else + is_urgent="否"; + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(is_urgent)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("查看"); + QPushButton *button2 = new QPushButton("编辑"); + QPushButton *button3 = new QPushButton("删除"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + Create_Task::State="Select"; + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonUpdateClicked(id); + Create_Task::State="Update"; + } + + }); + //设置按钮3简单样式 + button3->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: red; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button3->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button3, &QPushButton::clicked, this, [this, button3, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtoDeleteClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->addWidget(button3); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 8, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void Create_Task::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + HiddenButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "查看按钮ID",id); +} +void Create_Task::OnButtonUpdateClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "编辑按钮ID",id); +} +void Create_Task::OnButtoDeleteClicked(QString id) +{ + // ======================================================================================== + // 删除按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + + QMessageBox::information(this, "删除按钮ID",id); +} + +void Create_Task::on_pushButton_2_clicked() +{ + // ======================================================================================== + // 创建任务单按钮 + // ==================================================================================== + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + Create_Task::State="Create"; +} +void Create_Task::HiddenButton() +{ + ui->SaveButton->hide(); + ui->CreateButton->hide(); + ui->ScanButton->hide(); + ui->deletebutton->hide(); +} +void Create_Task::DisplayButton() +{ + ui->SaveButton->show(); + ui->CreateButton->show(); + ui->ScanButton->show(); + ui->deletebutton->show(); +} + +void Create_Task::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/create_task.h b/softwareDirectory/AutoVerScheme/create_task.h index 7cf383f..6b67c7c 100644 --- a/softwareDirectory/AutoVerScheme/create_task.h +++ b/softwareDirectory/AutoVerScheme/create_task.h @@ -16,11 +16,22 @@ explicit Create_Task(QWidget *parent = nullptr); ~Create_Task(); + //全局静态变量 + static QString State; private slots: void initForm(); //初始化界面数据 void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonUpdateClicked(QString id); + void OnButtoDeleteClicked(QString id); + void on_pushButton_2_clicked(); + void HiddenButton(); + void DisplayButton(); + + void on_pushButton_clicked(); + private: Ui::Create_Task *ui; }; diff --git a/softwareDirectory/AutoVerScheme/create_task.ui b/softwareDirectory/AutoVerScheme/create_task.ui index d9d88ed..b45af33 100644 --- a/softwareDirectory/AutoVerScheme/create_task.ui +++ b/softwareDirectory/AutoVerScheme/create_task.ui @@ -19,278 +19,651 @@ - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 1 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 任务单编号: - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - 委托方: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 使用部门: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 要求完成时间: - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(3, 58, 132); + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 任务单编号: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 委托方: + + + + + + + + + + 使用部门: + + + + + + + + + + 要求检完时间: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); color:white; - - - 查询 - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(207, 132, 33); + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); color:white; - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - 6 + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + 3 + + + + + + 50 + 40 + + + + + 100 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 创建任务单 + + + + + + + + + + + + + + + + + + + + + color:black; - - 9 - - - 9 - - - 9 - - - - - - 0 - 0 - - - - - 120 - 40 - - - - OpenHandCursor - - - Qt::DefaultContextMenu - - - Qt::RightToLeft - - - false - - - background-color:rgb(9, 89, 179); + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 创建任务单 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 保存 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; color:white; - - - 创建任务单 - - - true - - - - - - - - - - - - - - SizeVerCursor - - - - - - - + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接人: + + + + + + + 要求检完时间: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 是否加急: + + + + + + + 电话: + + + + + + + 委托方: + + + + + + + 任务单编号: + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接时间: + + + + + + + 送检人: + + + + + + + 接收说明: + + + + + + + 使用部门: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + 任务单列表: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 扫描增加 + + + false + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 增加行 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 删除行 + + + + + + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/depar_task.ui b/softwareDirectory/AutoVerScheme/depar_task.ui index efb7561..f44829d 100644 --- a/softwareDirectory/AutoVerScheme/depar_task.ui +++ b/softwareDirectory/AutoVerScheme/depar_task.ui @@ -213,86 +213,6 @@ - - - 12 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - diff --git a/softwareDirectory/AutoVerScheme/infomanageview.ui b/softwareDirectory/AutoVerScheme/infomanageview.ui index ef0b87b..cb76a28 100644 --- a/softwareDirectory/AutoVerScheme/infomanageview.ui +++ b/softwareDirectory/AutoVerScheme/infomanageview.ui @@ -20,7 +20,7 @@ color:black; background-color:rgba(240, 240, 240, 1); - + 0 @@ -37,77 +37,124 @@ 0 - - - - 0 - 0 - - - - - 170 - 0 - - - - - 16777215 - 16777215 - - + - color:White; - font-weight: bold; - font-size: 16px; -background-color:rgba(10, 15, 92, 1); + border-image: url(:/image/Index/u15.png); - - true - - - - - 0 - 0 - 170 - 625 - - - - - 0 - 0 - - - - - 170 - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - + + + + + + 50 + 50 + + + + + 35 + 35 + + + + image: url(:/image/Index/u2158.svg); + + + + + + + + + + color:white; +font-size:18px; +font-weight:bold; + + + 信息管理 + + + + - + + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 16777215 + 16777215 + + + + color:White; + font-weight: bold; + font-size: 16px; +background-color:rgba(10, 15, 92, 1); + + + true + + + + + 0 + 0 + 170 + 570 + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp index efc00ba..eea27f0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp @@ -25,17 +25,17 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 - + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0,0); //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "出厂编号" + headers <<"ID"<< "序号" << "设备名称" << "型号规则" << "出厂编号" <<"核查件名称"<<"核查件型号"<<"核查件编号" <<"核查员" << "核查日期" <<"实验室"<<"部门"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); @@ -58,5 +58,114 @@ } void InspectDataItem::Load() { - //ShowMessageBox("核查数据","核查数据"); + // ======================================================================================== + // 主页面初始化 核查管理初始化 + // ==================================================================================== + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + // 调用数据库管理器的函数获取数据 + int rowCount=0; + int row=0; + QList data = dbManager.getCheckData(); + for (const CheckData& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.equipment_name)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.model)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.manufacture_no)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.meter_standard_name)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(item.meter_standard_id)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(item.create_user_name)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(item.check_date.toString())); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(item.dept_name)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("详情"); + QPushButton *button2 = new QPushButton("预览"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonPreViewtClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 12, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void InspectDataItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +void InspectDataItem::OnButtonPreViewtClicked(QString id) +{ + // ======================================================================================== + // 预览按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} + +void InspectDataItem::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.h b/softwareDirectory/AutoVerScheme/inspectdataitem.h index bdf7066..6644339 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.h +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.h @@ -20,6 +20,10 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonPreViewtClicked(QString id); + void on_pushButton_clicked(); + private: Ui::InspectDataItem *ui; }; diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.ui b/softwareDirectory/AutoVerScheme/inspectdataitem.ui index 86786c9..3f319c0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.ui +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.ui @@ -7,232 +7,928 @@ 0 0 1362 - 543 + 553 Form - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 0 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 设备名称: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 型号规则: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 出厂编号: - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 核查员: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 核查日期: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 实验室: - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - Qt::RightToLeft - - - 查询 - - - - - - - Qt::RightToLeft - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - - - - - - - - - - + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 设备名称: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 型号规则: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 出厂编号: + + + + + + + + 0 + 0 + + + + + + + + 核查员: + + + + + + + + + + 实验室: + + + + + + + + + + 核查日期: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + + + + + + + + + + + + + + + + + color:black; + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 核查数据详情 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; +color:white; + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + 设备基本信息: + + + + + + + 设备名称: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 型号规格: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 出厂编号: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定有效期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产国家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产厂家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 购进日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用年限: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备单价: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用状态: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 质量状况: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 所属部门: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 负责人: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备供方: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 位置信息: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 标准类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备分类: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 重要等级: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定周期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 对应开箱记录: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 备注: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + 3 + + + false + + + Qt::LogicalMoveStyle + + + + + + + + + + + + + + + + 核查项目及核查点: + + + + + + + + + + + + + + 0 + 0 + + + + + 30 + 0 + + + + + + + + + + false + + + + 6 + + + 0 + + + 0 + + + 0 + + + 6 + + + + + 检定项备注: + + + + + + + background-color: #f0f0f0; +color: grey; + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/my_task.ui b/softwareDirectory/AutoVerScheme/my_task.ui index a078840..e04a336 100644 --- a/softwareDirectory/AutoVerScheme/my_task.ui +++ b/softwareDirectory/AutoVerScheme/my_task.ui @@ -157,6 +157,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -167,6 +172,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 diff --git a/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg b/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg new file mode 100644 index 0000000..fd249e0 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/softwareDirectory/AutoVerScheme/res/res.qrc b/softwareDirectory/AutoVerScheme/res/res.qrc index a0eac47..05edcdc 100644 --- a/softwareDirectory/AutoVerScheme/res/res.qrc +++ b/softwareDirectory/AutoVerScheme/res/res.qrc @@ -44,7 +44,11 @@ image/Index/u7488.svg image/Index/u7491.svg image/Index/u7538.svg +<<<<<<< HEAD image/Index/u2324.svg image/Index/u2325.svg +======= + image/Index/u2158.svg +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c diff --git a/softwareDirectory/AutoVerScheme/rulefileitem.cpp b/softwareDirectory/AutoVerScheme/rulefileitem.cpp index 095165e..9361752 100644 --- a/softwareDirectory/AutoVerScheme/rulefileitem.cpp +++ b/softwareDirectory/AutoVerScheme/rulefileitem.cpp @@ -27,17 +27,17 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(9); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(10); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + ui->tableWidget->setColumnWidth(0, 0); //设置数据 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "文件号" << "文件名称" << "版本号" << "文件类型"<< "颁布时间" + headers <<"ID"<< "序号" << "文件号" << "文件名称" << "版本号" << "文件类型"<< "颁布时间" << "实施时间" <<"备注"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); } @@ -58,6 +58,106 @@ msgBox.exec(); } void RuleFileItem::Load() +{// ======================================================================================== + // 主页面初始化 技术文件初始化 + // ==================================================================================== + ui->tableWidget->setRowCount(0); + + //先设置为行为0 + ui->tableWidget->setRowCount(0); + // 调用数据库管理器的函数获取数据 + int rowCount=0; + int row=0; + QList data = dbManager.getTechnique_File(); + for (const Technique_File& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.file_distribute_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.file_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.version_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.active_date.toString())); + ui->tableWidget->setItem(row, 7, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(item.remark)); + + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("详情"); + QPushButton *button2 = new QPushButton("预览"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonPreViewtClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 9, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void RuleFileItem::OnButtonSelectClicked(QString id) { - //ShowMessageBox("技术文件","技术文件初始化完成"); + // ======================================================================================== + // 详情按钮 点击事件 进入详情页面 + // ==================================================================================== + + QMessageBox::information(this, "详情按钮ID",id); +} +void RuleFileItem::OnButtonPreViewtClicked(QString id) +{ + // ======================================================================================== + // 下载按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "下载按钮ID",id); } diff --git a/softwareDirectory/AutoVerScheme/rulefileitem.h b/softwareDirectory/AutoVerScheme/rulefileitem.h index d892a71..b544722 100644 --- a/softwareDirectory/AutoVerScheme/rulefileitem.h +++ b/softwareDirectory/AutoVerScheme/rulefileitem.h @@ -20,6 +20,8 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonPreViewtClicked(QString id); private: Ui::RuleFileItem *ui; }; diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/InfoBase.h b/softwareDirectory/AutoVerScheme/InfoBase.h index 6dd59f3..bce9609 100644 --- a/softwareDirectory/AutoVerScheme/InfoBase.h +++ b/softwareDirectory/AutoVerScheme/InfoBase.h @@ -4,6 +4,7 @@ #include #include "QStandardItemModel" #include "databaseconnection.h" +#include "basecommonapi.h" ///信号管理页面的基类 所有信息管理页面都继承于InfoBase /// 便于统一管理 所有子类必须实现Load方法 /// 每次按钮点击切换都会调用Load方法 用于每次页面的数据刷新 @@ -16,7 +17,7 @@ //QStandardItemModel 的实例。这个模型将用于存储和管理数据。 QStandardItemModel *model; //信息管理页面 基类定义Conn对象 - DatabaseConnection *Conn=DatabaseConnection::getInstance(); + BaseCommonApi dbManager; }; #endif // INFOBASE_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index f62915b..6170ee7 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -15,7 +15,7 @@ " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id " " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID " " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID " - " WHERE sys_user.ID = ' :userId '"); + " WHERE sys_user.ID = :userId"); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -75,6 +75,35 @@ } return result; } + +//获取创建任务首页数据 +QList BaseCommonApi::getCreateTaskList(QString userId) +{ + userId="1640229293790650370"; + QList result; + QSqlQuery query; + query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " + " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " + " WHERE bi.create_user_id = :userId"); + // 将参数绑定到占位符 + query.bindValue(":userId", userId); + if (query.exec()) { + while (query.next()) { + CreateTaskList task; + task.id = query.value("id").toString(); + task.order_no = query.value("order_no").toString(); + task.customer_name = query.value("customer_name").toString(); + task.DEPT_FULL_NAME = query.value("FULL_NAME").toString(); + task.require_over_time = query.value("require_over_time").toDateTime(); + task.deliverer = query.value("deliverer").toString(); + task.is_urgent = query.value("is_urgent").toString(); + result.append(task); + } + } else { + qDebug() << "Query execution failed: " << query.lastError().text(); + } + return result; +} //获取创建任务首页数据 QListgetCreateTaskList(QString userId) { @@ -82,7 +111,7 @@ QSqlQuery query; query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " - " WHERE bi.create_user_id = ':userId' "); + " WHERE bi.create_user_id = :userId "); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -103,6 +132,7 @@ return result; } + //创建任务单-查看/编辑 顶部数据 传参该条数据的id QListBaseCommonApi::getCatTask(QString id) { @@ -111,7 +141,7 @@ query.prepare("SELECT bi.order_no ,bi.customer_name ,dept.FULL_NAME ,bi.require_over_time ," " bi.deliverer ,bi.deliverer_tel ,bi.undertaker_name ,bi.undertake_time , bi.is_urgent AS ," " bi.receive_illustrate FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID" - " WHERE bi.id = ' :id '"); + " WHERE bi.id = :id "); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -140,6 +170,7 @@ //获取创建任务 -任务单列表 + QListBaseCommonApi::getCatTaskList(QString orderId) { QList result; @@ -380,6 +411,7 @@ QListBaseCommonApi::getCheckDCPower(QString equipment_id,QStringList *headList) { + equipment_id="1693435753272557570"; QList result; QSqlQuery query; query.prepare("SELECT besciddp.id ,besciddp.params,besciddp.unit,resolution,besciddp.urel,besciddp.check_type,datum_point,cycle_number " @@ -407,9 +439,11 @@ } else { qDebug() << "Query execution failed: " << query.lastError().text(); } + *headList <<"序号"<<"核查项目"<<"核查点"<<"单位"<<"分辨力"<<"Urel"<<"核查类型"<<"是否为基准点(1/0)"<<"循环次数" <<"电阻值/频率"<<"电阻值单位/频率单位"<<"核查项备注"; + return result; } //根据id获取装置名称 @@ -436,9 +470,9 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " - " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id " - " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); +bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " + " JOIN sys_dept ON sys_dept.ID = eei.dept_id " + " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); if (isSuccess) { while (query.next()) { TestedDevice testedDevice; @@ -504,9 +538,10 @@ //判断 哪个 装置表 传参 设备id QList BaseCommonApi::getJudgeCalibrationTable(QString id) { + id="1716997603953311746"; QList result; QSqlQuery query; - query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = ':id')"); + query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = :id )"); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -526,12 +561,55 @@ return result; } +//标准装置字典类型 +/** + * 多功能校准源标准装置 = 1 + * 直流稳压电源检定装置 = 2 + * 多功能电气安全校准器标准装置 = 3 + * 0.02级活塞式压力计标准装置 = 4 + * 二等铂电阻温度计标准装置 = 5 + * 安全阀校验装置 = 6 + * 精密露点仪标准装置 = 7 + * E2等级砝码标准装置 = 8 + * 频谱分析仪标准装置 = 9 + * 信号发生器标准装置 = 10 + * 微波衰减标准装置 = 11 + * 频率短期稳定度标准装置 =12 + * 示波器标准装置 = 13 + * 铯原子频率标准装置 =14 + * 小功率标准装置 = 15 + * 低频信号发生器标准装置 = 16 + * S参数标准装置 = 17 + * 失真度标准装置 = 18 + */ +//根据被检设备ID获取当前设备的 核查项目及核查点 + +QList BaseCommonApi::Search_CalibrationTable(QString DeiverId,QStringList *HeadList) +{ + + QList DataList; + DataList.clear(); + QList CliTable=BaseCommonApi::getJudgeCalibrationTable(DeiverId); + if(CliTable.count()==0)return DataList; + switch (CliTable[0].belong_standard_equipment.toInt()) + { + case 1: + + //CliTable[0].item_category_id + DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList); + break; + } + + return DataList; +} //被检设备管理-检定项目及检定点-多功能校准源 -QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) +QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) { -QList result; +QList resultData; +QStringList result; +resultData.clear(); QSqlQuery query; query.prepare("SELECT bbdmidc.id ,bbdmidc.params ,bbdmidc.capacity ,bbdmidc.unit ,bbdmidc.frequency , bbdmidc.range_range , bbdmidc.standard_value , bbdmidc.resolution , bbdmidc.maximum_error , bbdmidc.error_param_a , bbdmidc.error_param_b " @@ -542,26 +620,24 @@ if (query.exec()) { while (query.next()) { - VerMultiCal calibration; - calibration.id = query.value("id").toString(); - calibration.params = query.value("params").toString(); - calibration.capacity = query.value("capacity").toString(); - calibration.unit = query.value("unit").toString(); - calibration.frequency = query.value("frequency").toString(); - calibration.range_range = query.value("range_range").toString(); - calibration.standard_value = query.value("standard_value").toString(); - calibration.resolution = query.value("resolution").toString(); - calibration.maximum_error = query.value("maximum_error").toString(); - calibration.error_param_a = query.value("error_param_a").toString(); - calibration.error_param_b = query.value("error_param_b").toString(); - - result.append(calibration); + result.clear(); + result.append(query.value("id").toString()); + result.append(query.value("params").toString()); + result.append(query.value("capacity").toString()); + result.append(query.value("unit").toString()); + result.append(query.value("frequency").toString()); + result.append(query.value("range_range").toString()); + result.append(query.value("standard_value").toString()); + result.append(query.value("resolution").toString()); + result.append(query.value("maximum_error").toString()); + result.append(query.value("error_param_a").toString()); + result.append(query.value("error_param_b").toString()); + resultData.append(result); } } else { qDebug() << "Query execution failed: " << query.lastError().text(); } - *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; - return result; + *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; } //检定数据管理 首页 @@ -757,7 +833,7 @@ " LEFT JOIN biz_equipment_standard_check_info besci ON besci.item_category_id = bescidc.item_category_id " " WHERE bescidc.equipment_id = :equipment_id "); - // 将参数绑定到占位符 '1692796512381222914' + // 将参数绑定到占位符 1692796512381222914 query.bindValue(":equipment_id", equipment_id); if (query.exec()) { while (query.next()) { @@ -788,12 +864,13 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " + bool isSuccess = query.exec("SELECT brtf.id,brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " " FROM biz_resource_technique_file brtf"); if (isSuccess) { while (query.next()) { Technique_File file; + file.id=query.value("id").toString(); file.file_distribute_no = query.value("file_distribute_no").toString(); file.file_name = query.value("file_name").toString(); file.version_no = query.value("version_no").toString(); @@ -876,7 +953,7 @@ QList result; QSqlQuery query; query.prepare("SELECT id,device_id ,communication_type ,serial_port ,visa ,create_time ,update_time " - "FROM zd_communication_setting WHERE device_id = ' :deviceId '"); + "FROM zd_communication_setting WHERE device_id = :deviceId "); query.bindValue(":deviceId", deviceId); if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h index 1b70cb9..ff8a320 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.h +++ b/softwareDirectory/AutoVerScheme/basecommonapi.h @@ -9,7 +9,7 @@ #include "databaseconnection.h" #include "id\IdWorker.h" - +#include "QStringList" //部门任务 @@ -52,6 +52,7 @@ QDateTime require_over_time; QString deliverer; QString is_urgent; + }; //创建任务单-查看任务单 class CatTask @@ -241,9 +242,15 @@ QString belong_standard_equipment; }; +class BaseEntity: public QObject +{ + Q_OBJECT + public: + +}; //被检设备管理-检定项目及检定点-检定项多功能校准源 -class VerMultiCal +class VerMultiCal:public BaseEntity { public: QString id; @@ -365,6 +372,7 @@ class Technique_File { public: + QString id; QString file_distribute_no; QString file_name; QString version_no; @@ -444,12 +452,22 @@ public: BaseCommonApi(); + // + static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList); + //部门任务 + static QList getAllData(); + //部门任务 参数登录用户的id static QList getAllData(QString userId); + //我的任务 static QList getMyTasks(QString id); //获取创建任务首页数据 - static QListgetCreateTaskList(QString id); + + static QListgetCreateTaskList(QString userId); + + + //创建任务-查看任务单顶部 static QListgetCatTask(QString orderNo); //创建任务-查看任务列表底部 @@ -479,7 +497,10 @@ //判断 哪个 装置表 传参 设备id 返回itemId static QList getJudgeCalibrationTable(QString id); //被检设备管理-检定项目及检定点-多功能校准源 - static QList getVerMultiCal(QString itemId,QStringList *headList); + + + static QList getVerMultiCal(QString itemId,QStringList *headList); + // 获取检定数据管理 首页 static QList getVerificationData(); // 检定数据管理-检定基本信息 @@ -494,6 +515,7 @@ static QList getCheckDataManageResultManageMult(QString equipment_id); //技术文件 static QList getTechnique_File(); + //检定程序管理首页查询 static QList getVerificationProgramInfoMain(); //检定程序管理 编辑 @@ -525,7 +547,6 @@ IdWorker &idWorker = Singleton::instance(); //自动检定 - }; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp index c3b2786..70148f4 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp @@ -4,6 +4,7 @@ #include "basecommonapi.h" //#include "tested_device_manage_serve.h" +#include "QStringList" //被检设备 BeExamined_DeviceItem::BeExamined_DeviceItem(QWidget *parent) : @@ -32,19 +33,32 @@ "}"); // ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); // item->setTextAlignment(Qt::AlignCenter); //ui->tableWidget->setItem(0, 0, item); //设置数据 - + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" + headers << "ID" << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" << "生产厂家"<<"所在单位" <<"使用部门"<<"计量标识"<<"检定周期"<<"证书有效期"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); + //详情页面tableWidgetItem设置 + ui->tableWidgetItem->setStyleSheet("QHeaderView::section {" + "border: 1px solid rgba(197, 196, 196, 1);" + "border-left:none;" + "border-top:none;" + "background-color:white;" + "}"); + + // ui->tableWidget->setRowCount(10); // 设置10行 + //ui->tableWidgetItem->setColumnCount(14); // 设置11列 + ui->tableWidgetItem->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 + ui->tableWidgetItem->verticalHeader()->setParent(nullptr); //隐藏行头 + } void BeExamined_DeviceItem::ShowMessageBox(QString title,QString value) { // 创建一个QMessageBox对象 @@ -64,24 +78,19 @@ } void BeExamined_DeviceItem::Load() { - //获取主页面内容 - //进入主页面 - /* - ui->stackedWidget->setCurrentIndex(0); + // ======================================================================================== + // 主页面初始化 + // ==================================================================================== + + + ui->stackedWidget->setCurrentIndex(0); //先设置为行为0 ui->tableWidget->setRowCount(0); - - - // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BeExamined_DeviceItem dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; int row=0; - QList data = dbManager.getBizDeviceManage(); - - - for (const BizDevice& bizDevice : data) { + QList data = dbManager.getTestedDevice(); + for (const TestedDevice& bizDevice : data) { rowCount = ui->tableWidget->rowCount(); ui->tableWidget->insertRow(rowCount); @@ -89,34 +98,118 @@ ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); ui->tableWidget->setItem(row, 2, new QTableWidgetItem(bizDevice.equipment_name)); ui->tableWidget->setItem(row, 3, new QTableWidgetItem(bizDevice.model)); - ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacture_no)); - ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.help_instruction)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacture_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(bizDevice.FULL_NAME)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(bizDevice.meter_identify)); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem(bizDevice.check_cycle)); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(bizDevice.certificate_valid)); + //添加操作按钮 QPushButton *button = new QPushButton("查看"); - ui->tableWidget->setCellWidget(row, 6, button); + ui->tableWidget->setCellWidget(row, 12, button); //设置按钮简单样式 button->setStyleSheet("QPushButton {" - " border: none; /* 无边框 "*/ - // " color: green; /* 文本颜色 */" - // " text-decoration: underline; /* 文本下划线 */" - // "}"); + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); // 设置鼠标悬停时的光标样式为小手图标 - // button->setCursor(Qt::PointingHandCursor); + button->setCursor(Qt::PointingHandCursor); // 连接按钮的 clicked 信号到自定义槽函数 - // connect(button, &QPushButton::clicked, this, [this, button, row]() { - // 获取当前行第一列的 ID - // QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); - // if (idItem) { - // QString id = idItem->text(); -// - // OnButtonSelectClicked(id); - // } + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); - // }); + OnButtonSelectClicked(id); + } - // row++; - - // } + }); + row++; + } } +void BeExamined_DeviceItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + + DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +//返回按钮 +void BeExamined_DeviceItem::on_pushButton_2_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); +} +void BeExamined_DeviceItem::DeviceInfoInit(QString id) +{ + // ======================================================================================== + // 初始化详情 + // ==================================================================================== + + QList data = dbManager.getTestedCatDevice(id); + for (const TestedCatDevice& testedCatDevice : data) { + + ui->equipment_name->setText(testedCatDevice.equipment_name); + ui->model->setText(testedCatDevice.model); + ui->help_instruction->setText(testedCatDevice.help_instruction); + ui->manufacture_no->setText(testedCatDevice.manufacture_no); + ui->product_country->setText(testedCatDevice.product_country); + ui->manufacturer->setText(testedCatDevice.manufacturer); + ui->product_date->setText(testedCatDevice.product_date); + ui->purchase_date->setText(testedCatDevice.purchase_date); + ui->unit_price->setText(testedCatDevice.unit_price); + ui->usage_status->setText(testedCatDevice.usage_status); + ui->quality_condition->setText(testedCatDevice.quality_condition); + ui->dept_name->setText(testedCatDevice.FULL_NAME); + ui->category->setText(testedCatDevice.category); + ui->check_cycle->setText(testedCatDevice.check_cycle); + ui->level->setText(testedCatDevice.level); + ui->remark->setText(testedCatDevice.remark); + } + + + // ======================================================================================== + // 初始化检定项目及核查点 + // ==================================================================================== + + //获取核查点tablewight的数据 + QStringList headlist; + + QList Data=dbManager.Search_CalibrationTable(id,&headlist); + + //tableWidgetItem + ui->tableWidgetItem->setRowCount(0); + ui->tableWidgetItem->setColumnCount(headlist.count()); + ui->tableWidgetItem->setHorizontalHeaderLabels(headlist); + //循环数据 + int rowCount=0; + int row=0; + ; + for (const QStringList& item : Data) + { + //获取行号 并进行添加行 + rowCount = ui->tableWidgetItem->rowCount(); + ui->tableWidgetItem->insertRow(rowCount); + //添加 序号 + ui->tableWidgetItem->setItem(row, 0, new QTableWidgetItem(QString::number(row+1))); + //循环读取值 headlist,count是列的数量 + for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型 + } + + row++; + + } +} + + + diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h index ffdc22a..0050ee7 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h @@ -21,6 +21,11 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + + void DeviceInfoInit(QString id); + + void on_pushButton_2_clicked(); private: Ui::BeExamined_DeviceItem *ui; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui index ce63879..cdacfaf 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui @@ -215,6 +215,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -225,6 +230,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 @@ -391,7 +401,7 @@ - + ForbiddenCursor @@ -412,7 +422,7 @@ - + ForbiddenCursor @@ -428,12 +438,12 @@ - 出厂编号: + 辅助字段: - + ForbiddenCursor @@ -449,12 +459,12 @@ - 检定有效期: + 出厂编号: - + ForbiddenCursor @@ -475,7 +485,7 @@ - + ForbiddenCursor @@ -496,7 +506,7 @@ - + ForbiddenCursor @@ -517,7 +527,7 @@ - + ForbiddenCursor @@ -538,7 +548,7 @@ - + ForbiddenCursor @@ -552,14 +562,14 @@ - + - 使用年限: + 设备单价: - + ForbiddenCursor @@ -573,14 +583,14 @@ - + - 设备单价: + 使用状态: - + ForbiddenCursor @@ -594,14 +604,14 @@ - + - 使用状态: + 质量状况: - + ForbiddenCursor @@ -615,14 +625,14 @@ - + - 质量状况: + 所在单位: - + ForbiddenCursor @@ -638,12 +648,12 @@ - 所属部门: + 使用部门: - + ForbiddenCursor @@ -657,14 +667,14 @@ - + - 负责人: + 设备分类: - + ForbiddenCursor @@ -678,14 +688,14 @@ - + - 设备供方: + 检定周期: - + ForbiddenCursor @@ -699,14 +709,14 @@ - + - 位置信息: + 重要等级: - + ForbiddenCursor @@ -720,140 +730,14 @@ - - - 设备类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 标准类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 设备分类: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 重要等级: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 检定周期: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 对应开箱记录: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - 备注: - - + + ForbiddenCursor @@ -892,7 +776,7 @@ - + diff --git a/softwareDirectory/AutoVerScheme/create_task.cpp b/softwareDirectory/AutoVerScheme/create_task.cpp index 9b49a1a..ddd78ef 100644 --- a/softwareDirectory/AutoVerScheme/create_task.cpp +++ b/softwareDirectory/AutoVerScheme/create_task.cpp @@ -2,12 +2,15 @@ #include "ui_create_task.h" #include "QMessageBox" + + QString Create_Task::State=""; Create_Task::Create_Task(QWidget *parent) : InfoBase(parent), ui(new Ui::Create_Task) { ui->setupUi(this); this->initForm(); + } Create_Task::~Create_Task() @@ -25,17 +28,19 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(8); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(9); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "任务单编号" << "委托方"<< "使用部门" << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; + headers <<"ID"<< "序号" << "任务单编号" << "委托方"<< "使用部门" + << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); //ShowMessageBox("标题","初始化完成"); } @@ -57,5 +62,171 @@ } void Create_Task::Load() { - //ShowMessageBox("创建任务界面","创建任务界面初始化完成"); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + + QList data = BaseCommonApi::getCreateTaskList(""); + + int rowCount = 0; + int row=0; + QString is_urgent; + for (const CreateTaskList& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.order_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.customer_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.DEPT_FULL_NAME)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.require_over_time.toString())); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.deliverer)); + if(item.is_urgent=="1") + is_urgent="是"; + else + is_urgent="否"; + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(is_urgent)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("查看"); + QPushButton *button2 = new QPushButton("编辑"); + QPushButton *button3 = new QPushButton("删除"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + Create_Task::State="Select"; + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonUpdateClicked(id); + Create_Task::State="Update"; + } + + }); + //设置按钮3简单样式 + button3->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: red; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button3->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button3, &QPushButton::clicked, this, [this, button3, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtoDeleteClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->addWidget(button3); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 8, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void Create_Task::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + HiddenButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "查看按钮ID",id); +} +void Create_Task::OnButtonUpdateClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "编辑按钮ID",id); +} +void Create_Task::OnButtoDeleteClicked(QString id) +{ + // ======================================================================================== + // 删除按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + + QMessageBox::information(this, "删除按钮ID",id); +} + +void Create_Task::on_pushButton_2_clicked() +{ + // ======================================================================================== + // 创建任务单按钮 + // ==================================================================================== + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + Create_Task::State="Create"; +} +void Create_Task::HiddenButton() +{ + ui->SaveButton->hide(); + ui->CreateButton->hide(); + ui->ScanButton->hide(); + ui->deletebutton->hide(); +} +void Create_Task::DisplayButton() +{ + ui->SaveButton->show(); + ui->CreateButton->show(); + ui->ScanButton->show(); + ui->deletebutton->show(); +} + +void Create_Task::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/create_task.h b/softwareDirectory/AutoVerScheme/create_task.h index 7cf383f..6b67c7c 100644 --- a/softwareDirectory/AutoVerScheme/create_task.h +++ b/softwareDirectory/AutoVerScheme/create_task.h @@ -16,11 +16,22 @@ explicit Create_Task(QWidget *parent = nullptr); ~Create_Task(); + //全局静态变量 + static QString State; private slots: void initForm(); //初始化界面数据 void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonUpdateClicked(QString id); + void OnButtoDeleteClicked(QString id); + void on_pushButton_2_clicked(); + void HiddenButton(); + void DisplayButton(); + + void on_pushButton_clicked(); + private: Ui::Create_Task *ui; }; diff --git a/softwareDirectory/AutoVerScheme/create_task.ui b/softwareDirectory/AutoVerScheme/create_task.ui index d9d88ed..b45af33 100644 --- a/softwareDirectory/AutoVerScheme/create_task.ui +++ b/softwareDirectory/AutoVerScheme/create_task.ui @@ -19,278 +19,651 @@ - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 1 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 任务单编号: - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - 委托方: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 使用部门: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 要求完成时间: - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(3, 58, 132); + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 任务单编号: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 委托方: + + + + + + + + + + 使用部门: + + + + + + + + + + 要求检完时间: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); color:white; - - - 查询 - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(207, 132, 33); + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); color:white; - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - 6 + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + 3 + + + + + + 50 + 40 + + + + + 100 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 创建任务单 + + + + + + + + + + + + + + + + + + + + + color:black; - - 9 - - - 9 - - - 9 - - - - - - 0 - 0 - - - - - 120 - 40 - - - - OpenHandCursor - - - Qt::DefaultContextMenu - - - Qt::RightToLeft - - - false - - - background-color:rgb(9, 89, 179); + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 创建任务单 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 保存 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; color:white; - - - 创建任务单 - - - true - - - - - - - - - - - - - - SizeVerCursor - - - - - - - + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接人: + + + + + + + 要求检完时间: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 是否加急: + + + + + + + 电话: + + + + + + + 委托方: + + + + + + + 任务单编号: + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接时间: + + + + + + + 送检人: + + + + + + + 接收说明: + + + + + + + 使用部门: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + 任务单列表: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 扫描增加 + + + false + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 增加行 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 删除行 + + + + + + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/depar_task.ui b/softwareDirectory/AutoVerScheme/depar_task.ui index efb7561..f44829d 100644 --- a/softwareDirectory/AutoVerScheme/depar_task.ui +++ b/softwareDirectory/AutoVerScheme/depar_task.ui @@ -213,86 +213,6 @@ - - - 12 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - diff --git a/softwareDirectory/AutoVerScheme/infomanageview.ui b/softwareDirectory/AutoVerScheme/infomanageview.ui index ef0b87b..cb76a28 100644 --- a/softwareDirectory/AutoVerScheme/infomanageview.ui +++ b/softwareDirectory/AutoVerScheme/infomanageview.ui @@ -20,7 +20,7 @@ color:black; background-color:rgba(240, 240, 240, 1); - + 0 @@ -37,77 +37,124 @@ 0 - - - - 0 - 0 - - - - - 170 - 0 - - - - - 16777215 - 16777215 - - + - color:White; - font-weight: bold; - font-size: 16px; -background-color:rgba(10, 15, 92, 1); + border-image: url(:/image/Index/u15.png); - - true - - - - - 0 - 0 - 170 - 625 - - - - - 0 - 0 - - - - - 170 - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - + + + + + + 50 + 50 + + + + + 35 + 35 + + + + image: url(:/image/Index/u2158.svg); + + + + + + + + + + color:white; +font-size:18px; +font-weight:bold; + + + 信息管理 + + + + - + + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 16777215 + 16777215 + + + + color:White; + font-weight: bold; + font-size: 16px; +background-color:rgba(10, 15, 92, 1); + + + true + + + + + 0 + 0 + 170 + 570 + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp index efc00ba..eea27f0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp @@ -25,17 +25,17 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 - + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0,0); //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "出厂编号" + headers <<"ID"<< "序号" << "设备名称" << "型号规则" << "出厂编号" <<"核查件名称"<<"核查件型号"<<"核查件编号" <<"核查员" << "核查日期" <<"实验室"<<"部门"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); @@ -58,5 +58,114 @@ } void InspectDataItem::Load() { - //ShowMessageBox("核查数据","核查数据"); + // ======================================================================================== + // 主页面初始化 核查管理初始化 + // ==================================================================================== + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + // 调用数据库管理器的函数获取数据 + int rowCount=0; + int row=0; + QList data = dbManager.getCheckData(); + for (const CheckData& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.equipment_name)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.model)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.manufacture_no)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.meter_standard_name)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(item.meter_standard_id)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(item.create_user_name)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(item.check_date.toString())); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(item.dept_name)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("详情"); + QPushButton *button2 = new QPushButton("预览"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonPreViewtClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 12, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void InspectDataItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +void InspectDataItem::OnButtonPreViewtClicked(QString id) +{ + // ======================================================================================== + // 预览按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} + +void InspectDataItem::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.h b/softwareDirectory/AutoVerScheme/inspectdataitem.h index bdf7066..6644339 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.h +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.h @@ -20,6 +20,10 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonPreViewtClicked(QString id); + void on_pushButton_clicked(); + private: Ui::InspectDataItem *ui; }; diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.ui b/softwareDirectory/AutoVerScheme/inspectdataitem.ui index 86786c9..3f319c0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.ui +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.ui @@ -7,232 +7,928 @@ 0 0 1362 - 543 + 553 Form - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 0 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 设备名称: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 型号规则: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 出厂编号: - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 核查员: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 核查日期: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 实验室: - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - Qt::RightToLeft - - - 查询 - - - - - - - Qt::RightToLeft - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - - - - - - - - - - + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 设备名称: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 型号规则: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 出厂编号: + + + + + + + + 0 + 0 + + + + + + + + 核查员: + + + + + + + + + + 实验室: + + + + + + + + + + 核查日期: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + + + + + + + + + + + + + + + + + color:black; + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 核查数据详情 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; +color:white; + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + 设备基本信息: + + + + + + + 设备名称: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 型号规格: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 出厂编号: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定有效期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产国家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产厂家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 购进日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用年限: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备单价: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用状态: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 质量状况: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 所属部门: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 负责人: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备供方: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 位置信息: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 标准类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备分类: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 重要等级: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定周期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 对应开箱记录: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 备注: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + 3 + + + false + + + Qt::LogicalMoveStyle + + + + + + + + + + + + + + + + 核查项目及核查点: + + + + + + + + + + + + + + 0 + 0 + + + + + 30 + 0 + + + + + + + + + + false + + + + 6 + + + 0 + + + 0 + + + 0 + + + 6 + + + + + 检定项备注: + + + + + + + background-color: #f0f0f0; +color: grey; + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/my_task.ui b/softwareDirectory/AutoVerScheme/my_task.ui index a078840..e04a336 100644 --- a/softwareDirectory/AutoVerScheme/my_task.ui +++ b/softwareDirectory/AutoVerScheme/my_task.ui @@ -157,6 +157,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -167,6 +172,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 diff --git a/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg b/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg new file mode 100644 index 0000000..fd249e0 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/softwareDirectory/AutoVerScheme/res/res.qrc b/softwareDirectory/AutoVerScheme/res/res.qrc index a0eac47..05edcdc 100644 --- a/softwareDirectory/AutoVerScheme/res/res.qrc +++ b/softwareDirectory/AutoVerScheme/res/res.qrc @@ -44,7 +44,11 @@ image/Index/u7488.svg image/Index/u7491.svg image/Index/u7538.svg +<<<<<<< HEAD image/Index/u2324.svg image/Index/u2325.svg +======= + image/Index/u2158.svg +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c diff --git a/softwareDirectory/AutoVerScheme/rulefileitem.cpp b/softwareDirectory/AutoVerScheme/rulefileitem.cpp index 095165e..9361752 100644 --- a/softwareDirectory/AutoVerScheme/rulefileitem.cpp +++ b/softwareDirectory/AutoVerScheme/rulefileitem.cpp @@ -27,17 +27,17 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(9); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(10); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + ui->tableWidget->setColumnWidth(0, 0); //设置数据 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "文件号" << "文件名称" << "版本号" << "文件类型"<< "颁布时间" + headers <<"ID"<< "序号" << "文件号" << "文件名称" << "版本号" << "文件类型"<< "颁布时间" << "实施时间" <<"备注"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); } @@ -58,6 +58,106 @@ msgBox.exec(); } void RuleFileItem::Load() +{// ======================================================================================== + // 主页面初始化 技术文件初始化 + // ==================================================================================== + ui->tableWidget->setRowCount(0); + + //先设置为行为0 + ui->tableWidget->setRowCount(0); + // 调用数据库管理器的函数获取数据 + int rowCount=0; + int row=0; + QList data = dbManager.getTechnique_File(); + for (const Technique_File& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.file_distribute_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.file_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.version_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.active_date.toString())); + ui->tableWidget->setItem(row, 7, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(item.remark)); + + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("详情"); + QPushButton *button2 = new QPushButton("预览"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonPreViewtClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 9, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void RuleFileItem::OnButtonSelectClicked(QString id) { - //ShowMessageBox("技术文件","技术文件初始化完成"); + // ======================================================================================== + // 详情按钮 点击事件 进入详情页面 + // ==================================================================================== + + QMessageBox::information(this, "详情按钮ID",id); +} +void RuleFileItem::OnButtonPreViewtClicked(QString id) +{ + // ======================================================================================== + // 下载按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "下载按钮ID",id); } diff --git a/softwareDirectory/AutoVerScheme/rulefileitem.h b/softwareDirectory/AutoVerScheme/rulefileitem.h index d892a71..b544722 100644 --- a/softwareDirectory/AutoVerScheme/rulefileitem.h +++ b/softwareDirectory/AutoVerScheme/rulefileitem.h @@ -20,6 +20,8 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonPreViewtClicked(QString id); private: Ui::RuleFileItem *ui; }; diff --git a/softwareDirectory/AutoVerScheme/rulefileitem.ui b/softwareDirectory/AutoVerScheme/rulefileitem.ui index 9144b96..4763c13 100644 --- a/softwareDirectory/AutoVerScheme/rulefileitem.ui +++ b/softwareDirectory/AutoVerScheme/rulefileitem.ui @@ -108,6 +108,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -118,6 +123,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/InfoBase.h b/softwareDirectory/AutoVerScheme/InfoBase.h index 6dd59f3..bce9609 100644 --- a/softwareDirectory/AutoVerScheme/InfoBase.h +++ b/softwareDirectory/AutoVerScheme/InfoBase.h @@ -4,6 +4,7 @@ #include #include "QStandardItemModel" #include "databaseconnection.h" +#include "basecommonapi.h" ///信号管理页面的基类 所有信息管理页面都继承于InfoBase /// 便于统一管理 所有子类必须实现Load方法 /// 每次按钮点击切换都会调用Load方法 用于每次页面的数据刷新 @@ -16,7 +17,7 @@ //QStandardItemModel 的实例。这个模型将用于存储和管理数据。 QStandardItemModel *model; //信息管理页面 基类定义Conn对象 - DatabaseConnection *Conn=DatabaseConnection::getInstance(); + BaseCommonApi dbManager; }; #endif // INFOBASE_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index f62915b..6170ee7 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -15,7 +15,7 @@ " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id " " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID " " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID " - " WHERE sys_user.ID = ' :userId '"); + " WHERE sys_user.ID = :userId"); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -75,6 +75,35 @@ } return result; } + +//获取创建任务首页数据 +QList BaseCommonApi::getCreateTaskList(QString userId) +{ + userId="1640229293790650370"; + QList result; + QSqlQuery query; + query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " + " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " + " WHERE bi.create_user_id = :userId"); + // 将参数绑定到占位符 + query.bindValue(":userId", userId); + if (query.exec()) { + while (query.next()) { + CreateTaskList task; + task.id = query.value("id").toString(); + task.order_no = query.value("order_no").toString(); + task.customer_name = query.value("customer_name").toString(); + task.DEPT_FULL_NAME = query.value("FULL_NAME").toString(); + task.require_over_time = query.value("require_over_time").toDateTime(); + task.deliverer = query.value("deliverer").toString(); + task.is_urgent = query.value("is_urgent").toString(); + result.append(task); + } + } else { + qDebug() << "Query execution failed: " << query.lastError().text(); + } + return result; +} //获取创建任务首页数据 QListgetCreateTaskList(QString userId) { @@ -82,7 +111,7 @@ QSqlQuery query; query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " - " WHERE bi.create_user_id = ':userId' "); + " WHERE bi.create_user_id = :userId "); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -103,6 +132,7 @@ return result; } + //创建任务单-查看/编辑 顶部数据 传参该条数据的id QListBaseCommonApi::getCatTask(QString id) { @@ -111,7 +141,7 @@ query.prepare("SELECT bi.order_no ,bi.customer_name ,dept.FULL_NAME ,bi.require_over_time ," " bi.deliverer ,bi.deliverer_tel ,bi.undertaker_name ,bi.undertake_time , bi.is_urgent AS ," " bi.receive_illustrate FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID" - " WHERE bi.id = ' :id '"); + " WHERE bi.id = :id "); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -140,6 +170,7 @@ //获取创建任务 -任务单列表 + QListBaseCommonApi::getCatTaskList(QString orderId) { QList result; @@ -380,6 +411,7 @@ QListBaseCommonApi::getCheckDCPower(QString equipment_id,QStringList *headList) { + equipment_id="1693435753272557570"; QList result; QSqlQuery query; query.prepare("SELECT besciddp.id ,besciddp.params,besciddp.unit,resolution,besciddp.urel,besciddp.check_type,datum_point,cycle_number " @@ -407,9 +439,11 @@ } else { qDebug() << "Query execution failed: " << query.lastError().text(); } + *headList <<"序号"<<"核查项目"<<"核查点"<<"单位"<<"分辨力"<<"Urel"<<"核查类型"<<"是否为基准点(1/0)"<<"循环次数" <<"电阻值/频率"<<"电阻值单位/频率单位"<<"核查项备注"; + return result; } //根据id获取装置名称 @@ -436,9 +470,9 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " - " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id " - " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); +bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " + " JOIN sys_dept ON sys_dept.ID = eei.dept_id " + " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); if (isSuccess) { while (query.next()) { TestedDevice testedDevice; @@ -504,9 +538,10 @@ //判断 哪个 装置表 传参 设备id QList BaseCommonApi::getJudgeCalibrationTable(QString id) { + id="1716997603953311746"; QList result; QSqlQuery query; - query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = ':id')"); + query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = :id )"); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -526,12 +561,55 @@ return result; } +//标准装置字典类型 +/** + * 多功能校准源标准装置 = 1 + * 直流稳压电源检定装置 = 2 + * 多功能电气安全校准器标准装置 = 3 + * 0.02级活塞式压力计标准装置 = 4 + * 二等铂电阻温度计标准装置 = 5 + * 安全阀校验装置 = 6 + * 精密露点仪标准装置 = 7 + * E2等级砝码标准装置 = 8 + * 频谱分析仪标准装置 = 9 + * 信号发生器标准装置 = 10 + * 微波衰减标准装置 = 11 + * 频率短期稳定度标准装置 =12 + * 示波器标准装置 = 13 + * 铯原子频率标准装置 =14 + * 小功率标准装置 = 15 + * 低频信号发生器标准装置 = 16 + * S参数标准装置 = 17 + * 失真度标准装置 = 18 + */ +//根据被检设备ID获取当前设备的 核查项目及核查点 + +QList BaseCommonApi::Search_CalibrationTable(QString DeiverId,QStringList *HeadList) +{ + + QList DataList; + DataList.clear(); + QList CliTable=BaseCommonApi::getJudgeCalibrationTable(DeiverId); + if(CliTable.count()==0)return DataList; + switch (CliTable[0].belong_standard_equipment.toInt()) + { + case 1: + + //CliTable[0].item_category_id + DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList); + break; + } + + return DataList; +} //被检设备管理-检定项目及检定点-多功能校准源 -QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) +QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) { -QList result; +QList resultData; +QStringList result; +resultData.clear(); QSqlQuery query; query.prepare("SELECT bbdmidc.id ,bbdmidc.params ,bbdmidc.capacity ,bbdmidc.unit ,bbdmidc.frequency , bbdmidc.range_range , bbdmidc.standard_value , bbdmidc.resolution , bbdmidc.maximum_error , bbdmidc.error_param_a , bbdmidc.error_param_b " @@ -542,26 +620,24 @@ if (query.exec()) { while (query.next()) { - VerMultiCal calibration; - calibration.id = query.value("id").toString(); - calibration.params = query.value("params").toString(); - calibration.capacity = query.value("capacity").toString(); - calibration.unit = query.value("unit").toString(); - calibration.frequency = query.value("frequency").toString(); - calibration.range_range = query.value("range_range").toString(); - calibration.standard_value = query.value("standard_value").toString(); - calibration.resolution = query.value("resolution").toString(); - calibration.maximum_error = query.value("maximum_error").toString(); - calibration.error_param_a = query.value("error_param_a").toString(); - calibration.error_param_b = query.value("error_param_b").toString(); - - result.append(calibration); + result.clear(); + result.append(query.value("id").toString()); + result.append(query.value("params").toString()); + result.append(query.value("capacity").toString()); + result.append(query.value("unit").toString()); + result.append(query.value("frequency").toString()); + result.append(query.value("range_range").toString()); + result.append(query.value("standard_value").toString()); + result.append(query.value("resolution").toString()); + result.append(query.value("maximum_error").toString()); + result.append(query.value("error_param_a").toString()); + result.append(query.value("error_param_b").toString()); + resultData.append(result); } } else { qDebug() << "Query execution failed: " << query.lastError().text(); } - *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; - return result; + *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; } //检定数据管理 首页 @@ -757,7 +833,7 @@ " LEFT JOIN biz_equipment_standard_check_info besci ON besci.item_category_id = bescidc.item_category_id " " WHERE bescidc.equipment_id = :equipment_id "); - // 将参数绑定到占位符 '1692796512381222914' + // 将参数绑定到占位符 1692796512381222914 query.bindValue(":equipment_id", equipment_id); if (query.exec()) { while (query.next()) { @@ -788,12 +864,13 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " + bool isSuccess = query.exec("SELECT brtf.id,brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " " FROM biz_resource_technique_file brtf"); if (isSuccess) { while (query.next()) { Technique_File file; + file.id=query.value("id").toString(); file.file_distribute_no = query.value("file_distribute_no").toString(); file.file_name = query.value("file_name").toString(); file.version_no = query.value("version_no").toString(); @@ -876,7 +953,7 @@ QList result; QSqlQuery query; query.prepare("SELECT id,device_id ,communication_type ,serial_port ,visa ,create_time ,update_time " - "FROM zd_communication_setting WHERE device_id = ' :deviceId '"); + "FROM zd_communication_setting WHERE device_id = :deviceId "); query.bindValue(":deviceId", deviceId); if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h index 1b70cb9..ff8a320 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.h +++ b/softwareDirectory/AutoVerScheme/basecommonapi.h @@ -9,7 +9,7 @@ #include "databaseconnection.h" #include "id\IdWorker.h" - +#include "QStringList" //部门任务 @@ -52,6 +52,7 @@ QDateTime require_over_time; QString deliverer; QString is_urgent; + }; //创建任务单-查看任务单 class CatTask @@ -241,9 +242,15 @@ QString belong_standard_equipment; }; +class BaseEntity: public QObject +{ + Q_OBJECT + public: + +}; //被检设备管理-检定项目及检定点-检定项多功能校准源 -class VerMultiCal +class VerMultiCal:public BaseEntity { public: QString id; @@ -365,6 +372,7 @@ class Technique_File { public: + QString id; QString file_distribute_no; QString file_name; QString version_no; @@ -444,12 +452,22 @@ public: BaseCommonApi(); + // + static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList); + //部门任务 + static QList getAllData(); + //部门任务 参数登录用户的id static QList getAllData(QString userId); + //我的任务 static QList getMyTasks(QString id); //获取创建任务首页数据 - static QListgetCreateTaskList(QString id); + + static QListgetCreateTaskList(QString userId); + + + //创建任务-查看任务单顶部 static QListgetCatTask(QString orderNo); //创建任务-查看任务列表底部 @@ -479,7 +497,10 @@ //判断 哪个 装置表 传参 设备id 返回itemId static QList getJudgeCalibrationTable(QString id); //被检设备管理-检定项目及检定点-多功能校准源 - static QList getVerMultiCal(QString itemId,QStringList *headList); + + + static QList getVerMultiCal(QString itemId,QStringList *headList); + // 获取检定数据管理 首页 static QList getVerificationData(); // 检定数据管理-检定基本信息 @@ -494,6 +515,7 @@ static QList getCheckDataManageResultManageMult(QString equipment_id); //技术文件 static QList getTechnique_File(); + //检定程序管理首页查询 static QList getVerificationProgramInfoMain(); //检定程序管理 编辑 @@ -525,7 +547,6 @@ IdWorker &idWorker = Singleton::instance(); //自动检定 - }; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp index c3b2786..70148f4 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp @@ -4,6 +4,7 @@ #include "basecommonapi.h" //#include "tested_device_manage_serve.h" +#include "QStringList" //被检设备 BeExamined_DeviceItem::BeExamined_DeviceItem(QWidget *parent) : @@ -32,19 +33,32 @@ "}"); // ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); // item->setTextAlignment(Qt::AlignCenter); //ui->tableWidget->setItem(0, 0, item); //设置数据 - + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" + headers << "ID" << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" << "生产厂家"<<"所在单位" <<"使用部门"<<"计量标识"<<"检定周期"<<"证书有效期"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); + //详情页面tableWidgetItem设置 + ui->tableWidgetItem->setStyleSheet("QHeaderView::section {" + "border: 1px solid rgba(197, 196, 196, 1);" + "border-left:none;" + "border-top:none;" + "background-color:white;" + "}"); + + // ui->tableWidget->setRowCount(10); // 设置10行 + //ui->tableWidgetItem->setColumnCount(14); // 设置11列 + ui->tableWidgetItem->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 + ui->tableWidgetItem->verticalHeader()->setParent(nullptr); //隐藏行头 + } void BeExamined_DeviceItem::ShowMessageBox(QString title,QString value) { // 创建一个QMessageBox对象 @@ -64,24 +78,19 @@ } void BeExamined_DeviceItem::Load() { - //获取主页面内容 - //进入主页面 - /* - ui->stackedWidget->setCurrentIndex(0); + // ======================================================================================== + // 主页面初始化 + // ==================================================================================== + + + ui->stackedWidget->setCurrentIndex(0); //先设置为行为0 ui->tableWidget->setRowCount(0); - - - // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BeExamined_DeviceItem dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; int row=0; - QList data = dbManager.getBizDeviceManage(); - - - for (const BizDevice& bizDevice : data) { + QList data = dbManager.getTestedDevice(); + for (const TestedDevice& bizDevice : data) { rowCount = ui->tableWidget->rowCount(); ui->tableWidget->insertRow(rowCount); @@ -89,34 +98,118 @@ ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); ui->tableWidget->setItem(row, 2, new QTableWidgetItem(bizDevice.equipment_name)); ui->tableWidget->setItem(row, 3, new QTableWidgetItem(bizDevice.model)); - ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacture_no)); - ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.help_instruction)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacture_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(bizDevice.FULL_NAME)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(bizDevice.meter_identify)); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem(bizDevice.check_cycle)); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(bizDevice.certificate_valid)); + //添加操作按钮 QPushButton *button = new QPushButton("查看"); - ui->tableWidget->setCellWidget(row, 6, button); + ui->tableWidget->setCellWidget(row, 12, button); //设置按钮简单样式 button->setStyleSheet("QPushButton {" - " border: none; /* 无边框 "*/ - // " color: green; /* 文本颜色 */" - // " text-decoration: underline; /* 文本下划线 */" - // "}"); + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); // 设置鼠标悬停时的光标样式为小手图标 - // button->setCursor(Qt::PointingHandCursor); + button->setCursor(Qt::PointingHandCursor); // 连接按钮的 clicked 信号到自定义槽函数 - // connect(button, &QPushButton::clicked, this, [this, button, row]() { - // 获取当前行第一列的 ID - // QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); - // if (idItem) { - // QString id = idItem->text(); -// - // OnButtonSelectClicked(id); - // } + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); - // }); + OnButtonSelectClicked(id); + } - // row++; - - // } + }); + row++; + } } +void BeExamined_DeviceItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + + DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +//返回按钮 +void BeExamined_DeviceItem::on_pushButton_2_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); +} +void BeExamined_DeviceItem::DeviceInfoInit(QString id) +{ + // ======================================================================================== + // 初始化详情 + // ==================================================================================== + + QList data = dbManager.getTestedCatDevice(id); + for (const TestedCatDevice& testedCatDevice : data) { + + ui->equipment_name->setText(testedCatDevice.equipment_name); + ui->model->setText(testedCatDevice.model); + ui->help_instruction->setText(testedCatDevice.help_instruction); + ui->manufacture_no->setText(testedCatDevice.manufacture_no); + ui->product_country->setText(testedCatDevice.product_country); + ui->manufacturer->setText(testedCatDevice.manufacturer); + ui->product_date->setText(testedCatDevice.product_date); + ui->purchase_date->setText(testedCatDevice.purchase_date); + ui->unit_price->setText(testedCatDevice.unit_price); + ui->usage_status->setText(testedCatDevice.usage_status); + ui->quality_condition->setText(testedCatDevice.quality_condition); + ui->dept_name->setText(testedCatDevice.FULL_NAME); + ui->category->setText(testedCatDevice.category); + ui->check_cycle->setText(testedCatDevice.check_cycle); + ui->level->setText(testedCatDevice.level); + ui->remark->setText(testedCatDevice.remark); + } + + + // ======================================================================================== + // 初始化检定项目及核查点 + // ==================================================================================== + + //获取核查点tablewight的数据 + QStringList headlist; + + QList Data=dbManager.Search_CalibrationTable(id,&headlist); + + //tableWidgetItem + ui->tableWidgetItem->setRowCount(0); + ui->tableWidgetItem->setColumnCount(headlist.count()); + ui->tableWidgetItem->setHorizontalHeaderLabels(headlist); + //循环数据 + int rowCount=0; + int row=0; + ; + for (const QStringList& item : Data) + { + //获取行号 并进行添加行 + rowCount = ui->tableWidgetItem->rowCount(); + ui->tableWidgetItem->insertRow(rowCount); + //添加 序号 + ui->tableWidgetItem->setItem(row, 0, new QTableWidgetItem(QString::number(row+1))); + //循环读取值 headlist,count是列的数量 + for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型 + } + + row++; + + } +} + + + diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h index ffdc22a..0050ee7 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h @@ -21,6 +21,11 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + + void DeviceInfoInit(QString id); + + void on_pushButton_2_clicked(); private: Ui::BeExamined_DeviceItem *ui; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui index ce63879..cdacfaf 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui @@ -215,6 +215,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -225,6 +230,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 @@ -391,7 +401,7 @@ - + ForbiddenCursor @@ -412,7 +422,7 @@ - + ForbiddenCursor @@ -428,12 +438,12 @@ - 出厂编号: + 辅助字段: - + ForbiddenCursor @@ -449,12 +459,12 @@ - 检定有效期: + 出厂编号: - + ForbiddenCursor @@ -475,7 +485,7 @@ - + ForbiddenCursor @@ -496,7 +506,7 @@ - + ForbiddenCursor @@ -517,7 +527,7 @@ - + ForbiddenCursor @@ -538,7 +548,7 @@ - + ForbiddenCursor @@ -552,14 +562,14 @@ - + - 使用年限: + 设备单价: - + ForbiddenCursor @@ -573,14 +583,14 @@ - + - 设备单价: + 使用状态: - + ForbiddenCursor @@ -594,14 +604,14 @@ - + - 使用状态: + 质量状况: - + ForbiddenCursor @@ -615,14 +625,14 @@ - + - 质量状况: + 所在单位: - + ForbiddenCursor @@ -638,12 +648,12 @@ - 所属部门: + 使用部门: - + ForbiddenCursor @@ -657,14 +667,14 @@ - + - 负责人: + 设备分类: - + ForbiddenCursor @@ -678,14 +688,14 @@ - + - 设备供方: + 检定周期: - + ForbiddenCursor @@ -699,14 +709,14 @@ - + - 位置信息: + 重要等级: - + ForbiddenCursor @@ -720,140 +730,14 @@ - - - 设备类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 标准类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 设备分类: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 重要等级: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 检定周期: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 对应开箱记录: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - 备注: - - + + ForbiddenCursor @@ -892,7 +776,7 @@ - + diff --git a/softwareDirectory/AutoVerScheme/create_task.cpp b/softwareDirectory/AutoVerScheme/create_task.cpp index 9b49a1a..ddd78ef 100644 --- a/softwareDirectory/AutoVerScheme/create_task.cpp +++ b/softwareDirectory/AutoVerScheme/create_task.cpp @@ -2,12 +2,15 @@ #include "ui_create_task.h" #include "QMessageBox" + + QString Create_Task::State=""; Create_Task::Create_Task(QWidget *parent) : InfoBase(parent), ui(new Ui::Create_Task) { ui->setupUi(this); this->initForm(); + } Create_Task::~Create_Task() @@ -25,17 +28,19 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(8); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(9); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "任务单编号" << "委托方"<< "使用部门" << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; + headers <<"ID"<< "序号" << "任务单编号" << "委托方"<< "使用部门" + << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); //ShowMessageBox("标题","初始化完成"); } @@ -57,5 +62,171 @@ } void Create_Task::Load() { - //ShowMessageBox("创建任务界面","创建任务界面初始化完成"); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + + QList data = BaseCommonApi::getCreateTaskList(""); + + int rowCount = 0; + int row=0; + QString is_urgent; + for (const CreateTaskList& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.order_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.customer_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.DEPT_FULL_NAME)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.require_over_time.toString())); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.deliverer)); + if(item.is_urgent=="1") + is_urgent="是"; + else + is_urgent="否"; + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(is_urgent)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("查看"); + QPushButton *button2 = new QPushButton("编辑"); + QPushButton *button3 = new QPushButton("删除"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + Create_Task::State="Select"; + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonUpdateClicked(id); + Create_Task::State="Update"; + } + + }); + //设置按钮3简单样式 + button3->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: red; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button3->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button3, &QPushButton::clicked, this, [this, button3, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtoDeleteClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->addWidget(button3); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 8, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void Create_Task::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + HiddenButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "查看按钮ID",id); +} +void Create_Task::OnButtonUpdateClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "编辑按钮ID",id); +} +void Create_Task::OnButtoDeleteClicked(QString id) +{ + // ======================================================================================== + // 删除按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + + QMessageBox::information(this, "删除按钮ID",id); +} + +void Create_Task::on_pushButton_2_clicked() +{ + // ======================================================================================== + // 创建任务单按钮 + // ==================================================================================== + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + Create_Task::State="Create"; +} +void Create_Task::HiddenButton() +{ + ui->SaveButton->hide(); + ui->CreateButton->hide(); + ui->ScanButton->hide(); + ui->deletebutton->hide(); +} +void Create_Task::DisplayButton() +{ + ui->SaveButton->show(); + ui->CreateButton->show(); + ui->ScanButton->show(); + ui->deletebutton->show(); +} + +void Create_Task::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/create_task.h b/softwareDirectory/AutoVerScheme/create_task.h index 7cf383f..6b67c7c 100644 --- a/softwareDirectory/AutoVerScheme/create_task.h +++ b/softwareDirectory/AutoVerScheme/create_task.h @@ -16,11 +16,22 @@ explicit Create_Task(QWidget *parent = nullptr); ~Create_Task(); + //全局静态变量 + static QString State; private slots: void initForm(); //初始化界面数据 void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonUpdateClicked(QString id); + void OnButtoDeleteClicked(QString id); + void on_pushButton_2_clicked(); + void HiddenButton(); + void DisplayButton(); + + void on_pushButton_clicked(); + private: Ui::Create_Task *ui; }; diff --git a/softwareDirectory/AutoVerScheme/create_task.ui b/softwareDirectory/AutoVerScheme/create_task.ui index d9d88ed..b45af33 100644 --- a/softwareDirectory/AutoVerScheme/create_task.ui +++ b/softwareDirectory/AutoVerScheme/create_task.ui @@ -19,278 +19,651 @@ - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 1 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 任务单编号: - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - 委托方: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 使用部门: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 要求完成时间: - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(3, 58, 132); + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 任务单编号: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 委托方: + + + + + + + + + + 使用部门: + + + + + + + + + + 要求检完时间: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); color:white; - - - 查询 - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(207, 132, 33); + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); color:white; - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - 6 + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + 3 + + + + + + 50 + 40 + + + + + 100 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 创建任务单 + + + + + + + + + + + + + + + + + + + + + color:black; - - 9 - - - 9 - - - 9 - - - - - - 0 - 0 - - - - - 120 - 40 - - - - OpenHandCursor - - - Qt::DefaultContextMenu - - - Qt::RightToLeft - - - false - - - background-color:rgb(9, 89, 179); + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 创建任务单 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 保存 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; color:white; - - - 创建任务单 - - - true - - - - - - - - - - - - - - SizeVerCursor - - - - - - - + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接人: + + + + + + + 要求检完时间: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 是否加急: + + + + + + + 电话: + + + + + + + 委托方: + + + + + + + 任务单编号: + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接时间: + + + + + + + 送检人: + + + + + + + 接收说明: + + + + + + + 使用部门: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + 任务单列表: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 扫描增加 + + + false + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 增加行 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 删除行 + + + + + + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/depar_task.ui b/softwareDirectory/AutoVerScheme/depar_task.ui index efb7561..f44829d 100644 --- a/softwareDirectory/AutoVerScheme/depar_task.ui +++ b/softwareDirectory/AutoVerScheme/depar_task.ui @@ -213,86 +213,6 @@ - - - 12 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - diff --git a/softwareDirectory/AutoVerScheme/infomanageview.ui b/softwareDirectory/AutoVerScheme/infomanageview.ui index ef0b87b..cb76a28 100644 --- a/softwareDirectory/AutoVerScheme/infomanageview.ui +++ b/softwareDirectory/AutoVerScheme/infomanageview.ui @@ -20,7 +20,7 @@ color:black; background-color:rgba(240, 240, 240, 1); - + 0 @@ -37,77 +37,124 @@ 0 - - - - 0 - 0 - - - - - 170 - 0 - - - - - 16777215 - 16777215 - - + - color:White; - font-weight: bold; - font-size: 16px; -background-color:rgba(10, 15, 92, 1); + border-image: url(:/image/Index/u15.png); - - true - - - - - 0 - 0 - 170 - 625 - - - - - 0 - 0 - - - - - 170 - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - + + + + + + 50 + 50 + + + + + 35 + 35 + + + + image: url(:/image/Index/u2158.svg); + + + + + + + + + + color:white; +font-size:18px; +font-weight:bold; + + + 信息管理 + + + + - + + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 16777215 + 16777215 + + + + color:White; + font-weight: bold; + font-size: 16px; +background-color:rgba(10, 15, 92, 1); + + + true + + + + + 0 + 0 + 170 + 570 + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp index efc00ba..eea27f0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp @@ -25,17 +25,17 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 - + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0,0); //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "出厂编号" + headers <<"ID"<< "序号" << "设备名称" << "型号规则" << "出厂编号" <<"核查件名称"<<"核查件型号"<<"核查件编号" <<"核查员" << "核查日期" <<"实验室"<<"部门"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); @@ -58,5 +58,114 @@ } void InspectDataItem::Load() { - //ShowMessageBox("核查数据","核查数据"); + // ======================================================================================== + // 主页面初始化 核查管理初始化 + // ==================================================================================== + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + // 调用数据库管理器的函数获取数据 + int rowCount=0; + int row=0; + QList data = dbManager.getCheckData(); + for (const CheckData& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.equipment_name)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.model)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.manufacture_no)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.meter_standard_name)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(item.meter_standard_id)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(item.create_user_name)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(item.check_date.toString())); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(item.dept_name)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("详情"); + QPushButton *button2 = new QPushButton("预览"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonPreViewtClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 12, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void InspectDataItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +void InspectDataItem::OnButtonPreViewtClicked(QString id) +{ + // ======================================================================================== + // 预览按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} + +void InspectDataItem::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.h b/softwareDirectory/AutoVerScheme/inspectdataitem.h index bdf7066..6644339 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.h +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.h @@ -20,6 +20,10 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonPreViewtClicked(QString id); + void on_pushButton_clicked(); + private: Ui::InspectDataItem *ui; }; diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.ui b/softwareDirectory/AutoVerScheme/inspectdataitem.ui index 86786c9..3f319c0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.ui +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.ui @@ -7,232 +7,928 @@ 0 0 1362 - 543 + 553 Form - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 0 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 设备名称: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 型号规则: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 出厂编号: - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 核查员: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 核查日期: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 实验室: - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - Qt::RightToLeft - - - 查询 - - - - - - - Qt::RightToLeft - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - - - - - - - - - - + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 设备名称: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 型号规则: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 出厂编号: + + + + + + + + 0 + 0 + + + + + + + + 核查员: + + + + + + + + + + 实验室: + + + + + + + + + + 核查日期: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + + + + + + + + + + + + + + + + + color:black; + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 核查数据详情 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; +color:white; + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + 设备基本信息: + + + + + + + 设备名称: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 型号规格: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 出厂编号: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定有效期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产国家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产厂家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 购进日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用年限: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备单价: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用状态: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 质量状况: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 所属部门: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 负责人: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备供方: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 位置信息: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 标准类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备分类: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 重要等级: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定周期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 对应开箱记录: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 备注: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + 3 + + + false + + + Qt::LogicalMoveStyle + + + + + + + + + + + + + + + + 核查项目及核查点: + + + + + + + + + + + + + + 0 + 0 + + + + + 30 + 0 + + + + + + + + + + false + + + + 6 + + + 0 + + + 0 + + + 0 + + + 6 + + + + + 检定项备注: + + + + + + + background-color: #f0f0f0; +color: grey; + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/my_task.ui b/softwareDirectory/AutoVerScheme/my_task.ui index a078840..e04a336 100644 --- a/softwareDirectory/AutoVerScheme/my_task.ui +++ b/softwareDirectory/AutoVerScheme/my_task.ui @@ -157,6 +157,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -167,6 +172,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 diff --git a/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg b/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg new file mode 100644 index 0000000..fd249e0 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/softwareDirectory/AutoVerScheme/res/res.qrc b/softwareDirectory/AutoVerScheme/res/res.qrc index a0eac47..05edcdc 100644 --- a/softwareDirectory/AutoVerScheme/res/res.qrc +++ b/softwareDirectory/AutoVerScheme/res/res.qrc @@ -44,7 +44,11 @@ image/Index/u7488.svg image/Index/u7491.svg image/Index/u7538.svg +<<<<<<< HEAD image/Index/u2324.svg image/Index/u2325.svg +======= + image/Index/u2158.svg +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c diff --git a/softwareDirectory/AutoVerScheme/rulefileitem.cpp b/softwareDirectory/AutoVerScheme/rulefileitem.cpp index 095165e..9361752 100644 --- a/softwareDirectory/AutoVerScheme/rulefileitem.cpp +++ b/softwareDirectory/AutoVerScheme/rulefileitem.cpp @@ -27,17 +27,17 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(9); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(10); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + ui->tableWidget->setColumnWidth(0, 0); //设置数据 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "文件号" << "文件名称" << "版本号" << "文件类型"<< "颁布时间" + headers <<"ID"<< "序号" << "文件号" << "文件名称" << "版本号" << "文件类型"<< "颁布时间" << "实施时间" <<"备注"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); } @@ -58,6 +58,106 @@ msgBox.exec(); } void RuleFileItem::Load() +{// ======================================================================================== + // 主页面初始化 技术文件初始化 + // ==================================================================================== + ui->tableWidget->setRowCount(0); + + //先设置为行为0 + ui->tableWidget->setRowCount(0); + // 调用数据库管理器的函数获取数据 + int rowCount=0; + int row=0; + QList data = dbManager.getTechnique_File(); + for (const Technique_File& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.file_distribute_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.file_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.version_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.active_date.toString())); + ui->tableWidget->setItem(row, 7, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(item.remark)); + + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("详情"); + QPushButton *button2 = new QPushButton("预览"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonPreViewtClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 9, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void RuleFileItem::OnButtonSelectClicked(QString id) { - //ShowMessageBox("技术文件","技术文件初始化完成"); + // ======================================================================================== + // 详情按钮 点击事件 进入详情页面 + // ==================================================================================== + + QMessageBox::information(this, "详情按钮ID",id); +} +void RuleFileItem::OnButtonPreViewtClicked(QString id) +{ + // ======================================================================================== + // 下载按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "下载按钮ID",id); } diff --git a/softwareDirectory/AutoVerScheme/rulefileitem.h b/softwareDirectory/AutoVerScheme/rulefileitem.h index d892a71..b544722 100644 --- a/softwareDirectory/AutoVerScheme/rulefileitem.h +++ b/softwareDirectory/AutoVerScheme/rulefileitem.h @@ -20,6 +20,8 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonPreViewtClicked(QString id); private: Ui::RuleFileItem *ui; }; diff --git a/softwareDirectory/AutoVerScheme/rulefileitem.ui b/softwareDirectory/AutoVerScheme/rulefileitem.ui index 9144b96..4763c13 100644 --- a/softwareDirectory/AutoVerScheme/rulefileitem.ui +++ b/softwareDirectory/AutoVerScheme/rulefileitem.ui @@ -108,6 +108,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -118,6 +123,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 diff --git a/softwareDirectory/AutoVerScheme/standard_deviceitem.cpp b/softwareDirectory/AutoVerScheme/standard_deviceitem.cpp index 456b1aa..3489d64 100644 --- a/softwareDirectory/AutoVerScheme/standard_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/standard_deviceitem.cpp @@ -91,9 +91,7 @@ ui->tableWidget->setRowCount(0); // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BaseCommonApi dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; @@ -156,7 +154,7 @@ { - BaseCommonApi dbManager; + QList data = dbManager.getCatDeviceInfor(id); // 获取当前日期 使用年限=当前日期减去购进日期 @@ -203,8 +201,8 @@ //获取核查点tablewight的数据 QStringList headlist; - QString DeviceName = BaseCommonApi::getApparatus(id); - QList bizDeviceManageData=dbManager.getCheckDCPower(DeviceName,&headlist); + //QString DeviceName = BaseCommonApi::getApparatus(id); + QList bizDeviceManageData=dbManager.getCheckDCPower(id,&headlist); //QList bizDeviceManageData = BaseCommonApi::getCheckDCPower(id); //设置tablewight ui->tableWidgetItem->setRowCount(0); diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/InfoBase.h b/softwareDirectory/AutoVerScheme/InfoBase.h index 6dd59f3..bce9609 100644 --- a/softwareDirectory/AutoVerScheme/InfoBase.h +++ b/softwareDirectory/AutoVerScheme/InfoBase.h @@ -4,6 +4,7 @@ #include #include "QStandardItemModel" #include "databaseconnection.h" +#include "basecommonapi.h" ///信号管理页面的基类 所有信息管理页面都继承于InfoBase /// 便于统一管理 所有子类必须实现Load方法 /// 每次按钮点击切换都会调用Load方法 用于每次页面的数据刷新 @@ -16,7 +17,7 @@ //QStandardItemModel 的实例。这个模型将用于存储和管理数据。 QStandardItemModel *model; //信息管理页面 基类定义Conn对象 - DatabaseConnection *Conn=DatabaseConnection::getInstance(); + BaseCommonApi dbManager; }; #endif // INFOBASE_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index f62915b..6170ee7 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -15,7 +15,7 @@ " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id " " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID " " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID " - " WHERE sys_user.ID = ' :userId '"); + " WHERE sys_user.ID = :userId"); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -75,6 +75,35 @@ } return result; } + +//获取创建任务首页数据 +QList BaseCommonApi::getCreateTaskList(QString userId) +{ + userId="1640229293790650370"; + QList result; + QSqlQuery query; + query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " + " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " + " WHERE bi.create_user_id = :userId"); + // 将参数绑定到占位符 + query.bindValue(":userId", userId); + if (query.exec()) { + while (query.next()) { + CreateTaskList task; + task.id = query.value("id").toString(); + task.order_no = query.value("order_no").toString(); + task.customer_name = query.value("customer_name").toString(); + task.DEPT_FULL_NAME = query.value("FULL_NAME").toString(); + task.require_over_time = query.value("require_over_time").toDateTime(); + task.deliverer = query.value("deliverer").toString(); + task.is_urgent = query.value("is_urgent").toString(); + result.append(task); + } + } else { + qDebug() << "Query execution failed: " << query.lastError().text(); + } + return result; +} //获取创建任务首页数据 QListgetCreateTaskList(QString userId) { @@ -82,7 +111,7 @@ QSqlQuery query; query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " - " WHERE bi.create_user_id = ':userId' "); + " WHERE bi.create_user_id = :userId "); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -103,6 +132,7 @@ return result; } + //创建任务单-查看/编辑 顶部数据 传参该条数据的id QListBaseCommonApi::getCatTask(QString id) { @@ -111,7 +141,7 @@ query.prepare("SELECT bi.order_no ,bi.customer_name ,dept.FULL_NAME ,bi.require_over_time ," " bi.deliverer ,bi.deliverer_tel ,bi.undertaker_name ,bi.undertake_time , bi.is_urgent AS ," " bi.receive_illustrate FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID" - " WHERE bi.id = ' :id '"); + " WHERE bi.id = :id "); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -140,6 +170,7 @@ //获取创建任务 -任务单列表 + QListBaseCommonApi::getCatTaskList(QString orderId) { QList result; @@ -380,6 +411,7 @@ QListBaseCommonApi::getCheckDCPower(QString equipment_id,QStringList *headList) { + equipment_id="1693435753272557570"; QList result; QSqlQuery query; query.prepare("SELECT besciddp.id ,besciddp.params,besciddp.unit,resolution,besciddp.urel,besciddp.check_type,datum_point,cycle_number " @@ -407,9 +439,11 @@ } else { qDebug() << "Query execution failed: " << query.lastError().text(); } + *headList <<"序号"<<"核查项目"<<"核查点"<<"单位"<<"分辨力"<<"Urel"<<"核查类型"<<"是否为基准点(1/0)"<<"循环次数" <<"电阻值/频率"<<"电阻值单位/频率单位"<<"核查项备注"; + return result; } //根据id获取装置名称 @@ -436,9 +470,9 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " - " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id " - " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); +bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " + " JOIN sys_dept ON sys_dept.ID = eei.dept_id " + " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); if (isSuccess) { while (query.next()) { TestedDevice testedDevice; @@ -504,9 +538,10 @@ //判断 哪个 装置表 传参 设备id QList BaseCommonApi::getJudgeCalibrationTable(QString id) { + id="1716997603953311746"; QList result; QSqlQuery query; - query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = ':id')"); + query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = :id )"); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -526,12 +561,55 @@ return result; } +//标准装置字典类型 +/** + * 多功能校准源标准装置 = 1 + * 直流稳压电源检定装置 = 2 + * 多功能电气安全校准器标准装置 = 3 + * 0.02级活塞式压力计标准装置 = 4 + * 二等铂电阻温度计标准装置 = 5 + * 安全阀校验装置 = 6 + * 精密露点仪标准装置 = 7 + * E2等级砝码标准装置 = 8 + * 频谱分析仪标准装置 = 9 + * 信号发生器标准装置 = 10 + * 微波衰减标准装置 = 11 + * 频率短期稳定度标准装置 =12 + * 示波器标准装置 = 13 + * 铯原子频率标准装置 =14 + * 小功率标准装置 = 15 + * 低频信号发生器标准装置 = 16 + * S参数标准装置 = 17 + * 失真度标准装置 = 18 + */ +//根据被检设备ID获取当前设备的 核查项目及核查点 + +QList BaseCommonApi::Search_CalibrationTable(QString DeiverId,QStringList *HeadList) +{ + + QList DataList; + DataList.clear(); + QList CliTable=BaseCommonApi::getJudgeCalibrationTable(DeiverId); + if(CliTable.count()==0)return DataList; + switch (CliTable[0].belong_standard_equipment.toInt()) + { + case 1: + + //CliTable[0].item_category_id + DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList); + break; + } + + return DataList; +} //被检设备管理-检定项目及检定点-多功能校准源 -QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) +QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) { -QList result; +QList resultData; +QStringList result; +resultData.clear(); QSqlQuery query; query.prepare("SELECT bbdmidc.id ,bbdmidc.params ,bbdmidc.capacity ,bbdmidc.unit ,bbdmidc.frequency , bbdmidc.range_range , bbdmidc.standard_value , bbdmidc.resolution , bbdmidc.maximum_error , bbdmidc.error_param_a , bbdmidc.error_param_b " @@ -542,26 +620,24 @@ if (query.exec()) { while (query.next()) { - VerMultiCal calibration; - calibration.id = query.value("id").toString(); - calibration.params = query.value("params").toString(); - calibration.capacity = query.value("capacity").toString(); - calibration.unit = query.value("unit").toString(); - calibration.frequency = query.value("frequency").toString(); - calibration.range_range = query.value("range_range").toString(); - calibration.standard_value = query.value("standard_value").toString(); - calibration.resolution = query.value("resolution").toString(); - calibration.maximum_error = query.value("maximum_error").toString(); - calibration.error_param_a = query.value("error_param_a").toString(); - calibration.error_param_b = query.value("error_param_b").toString(); - - result.append(calibration); + result.clear(); + result.append(query.value("id").toString()); + result.append(query.value("params").toString()); + result.append(query.value("capacity").toString()); + result.append(query.value("unit").toString()); + result.append(query.value("frequency").toString()); + result.append(query.value("range_range").toString()); + result.append(query.value("standard_value").toString()); + result.append(query.value("resolution").toString()); + result.append(query.value("maximum_error").toString()); + result.append(query.value("error_param_a").toString()); + result.append(query.value("error_param_b").toString()); + resultData.append(result); } } else { qDebug() << "Query execution failed: " << query.lastError().text(); } - *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; - return result; + *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; } //检定数据管理 首页 @@ -757,7 +833,7 @@ " LEFT JOIN biz_equipment_standard_check_info besci ON besci.item_category_id = bescidc.item_category_id " " WHERE bescidc.equipment_id = :equipment_id "); - // 将参数绑定到占位符 '1692796512381222914' + // 将参数绑定到占位符 1692796512381222914 query.bindValue(":equipment_id", equipment_id); if (query.exec()) { while (query.next()) { @@ -788,12 +864,13 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " + bool isSuccess = query.exec("SELECT brtf.id,brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " " FROM biz_resource_technique_file brtf"); if (isSuccess) { while (query.next()) { Technique_File file; + file.id=query.value("id").toString(); file.file_distribute_no = query.value("file_distribute_no").toString(); file.file_name = query.value("file_name").toString(); file.version_no = query.value("version_no").toString(); @@ -876,7 +953,7 @@ QList result; QSqlQuery query; query.prepare("SELECT id,device_id ,communication_type ,serial_port ,visa ,create_time ,update_time " - "FROM zd_communication_setting WHERE device_id = ' :deviceId '"); + "FROM zd_communication_setting WHERE device_id = :deviceId "); query.bindValue(":deviceId", deviceId); if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h index 1b70cb9..ff8a320 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.h +++ b/softwareDirectory/AutoVerScheme/basecommonapi.h @@ -9,7 +9,7 @@ #include "databaseconnection.h" #include "id\IdWorker.h" - +#include "QStringList" //部门任务 @@ -52,6 +52,7 @@ QDateTime require_over_time; QString deliverer; QString is_urgent; + }; //创建任务单-查看任务单 class CatTask @@ -241,9 +242,15 @@ QString belong_standard_equipment; }; +class BaseEntity: public QObject +{ + Q_OBJECT + public: + +}; //被检设备管理-检定项目及检定点-检定项多功能校准源 -class VerMultiCal +class VerMultiCal:public BaseEntity { public: QString id; @@ -365,6 +372,7 @@ class Technique_File { public: + QString id; QString file_distribute_no; QString file_name; QString version_no; @@ -444,12 +452,22 @@ public: BaseCommonApi(); + // + static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList); + //部门任务 + static QList getAllData(); + //部门任务 参数登录用户的id static QList getAllData(QString userId); + //我的任务 static QList getMyTasks(QString id); //获取创建任务首页数据 - static QListgetCreateTaskList(QString id); + + static QListgetCreateTaskList(QString userId); + + + //创建任务-查看任务单顶部 static QListgetCatTask(QString orderNo); //创建任务-查看任务列表底部 @@ -479,7 +497,10 @@ //判断 哪个 装置表 传参 设备id 返回itemId static QList getJudgeCalibrationTable(QString id); //被检设备管理-检定项目及检定点-多功能校准源 - static QList getVerMultiCal(QString itemId,QStringList *headList); + + + static QList getVerMultiCal(QString itemId,QStringList *headList); + // 获取检定数据管理 首页 static QList getVerificationData(); // 检定数据管理-检定基本信息 @@ -494,6 +515,7 @@ static QList getCheckDataManageResultManageMult(QString equipment_id); //技术文件 static QList getTechnique_File(); + //检定程序管理首页查询 static QList getVerificationProgramInfoMain(); //检定程序管理 编辑 @@ -525,7 +547,6 @@ IdWorker &idWorker = Singleton::instance(); //自动检定 - }; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp index c3b2786..70148f4 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp @@ -4,6 +4,7 @@ #include "basecommonapi.h" //#include "tested_device_manage_serve.h" +#include "QStringList" //被检设备 BeExamined_DeviceItem::BeExamined_DeviceItem(QWidget *parent) : @@ -32,19 +33,32 @@ "}"); // ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); // item->setTextAlignment(Qt::AlignCenter); //ui->tableWidget->setItem(0, 0, item); //设置数据 - + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" + headers << "ID" << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" << "生产厂家"<<"所在单位" <<"使用部门"<<"计量标识"<<"检定周期"<<"证书有效期"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); + //详情页面tableWidgetItem设置 + ui->tableWidgetItem->setStyleSheet("QHeaderView::section {" + "border: 1px solid rgba(197, 196, 196, 1);" + "border-left:none;" + "border-top:none;" + "background-color:white;" + "}"); + + // ui->tableWidget->setRowCount(10); // 设置10行 + //ui->tableWidgetItem->setColumnCount(14); // 设置11列 + ui->tableWidgetItem->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 + ui->tableWidgetItem->verticalHeader()->setParent(nullptr); //隐藏行头 + } void BeExamined_DeviceItem::ShowMessageBox(QString title,QString value) { // 创建一个QMessageBox对象 @@ -64,24 +78,19 @@ } void BeExamined_DeviceItem::Load() { - //获取主页面内容 - //进入主页面 - /* - ui->stackedWidget->setCurrentIndex(0); + // ======================================================================================== + // 主页面初始化 + // ==================================================================================== + + + ui->stackedWidget->setCurrentIndex(0); //先设置为行为0 ui->tableWidget->setRowCount(0); - - - // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BeExamined_DeviceItem dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; int row=0; - QList data = dbManager.getBizDeviceManage(); - - - for (const BizDevice& bizDevice : data) { + QList data = dbManager.getTestedDevice(); + for (const TestedDevice& bizDevice : data) { rowCount = ui->tableWidget->rowCount(); ui->tableWidget->insertRow(rowCount); @@ -89,34 +98,118 @@ ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); ui->tableWidget->setItem(row, 2, new QTableWidgetItem(bizDevice.equipment_name)); ui->tableWidget->setItem(row, 3, new QTableWidgetItem(bizDevice.model)); - ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacture_no)); - ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.help_instruction)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacture_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(bizDevice.FULL_NAME)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(bizDevice.meter_identify)); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem(bizDevice.check_cycle)); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(bizDevice.certificate_valid)); + //添加操作按钮 QPushButton *button = new QPushButton("查看"); - ui->tableWidget->setCellWidget(row, 6, button); + ui->tableWidget->setCellWidget(row, 12, button); //设置按钮简单样式 button->setStyleSheet("QPushButton {" - " border: none; /* 无边框 "*/ - // " color: green; /* 文本颜色 */" - // " text-decoration: underline; /* 文本下划线 */" - // "}"); + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); // 设置鼠标悬停时的光标样式为小手图标 - // button->setCursor(Qt::PointingHandCursor); + button->setCursor(Qt::PointingHandCursor); // 连接按钮的 clicked 信号到自定义槽函数 - // connect(button, &QPushButton::clicked, this, [this, button, row]() { - // 获取当前行第一列的 ID - // QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); - // if (idItem) { - // QString id = idItem->text(); -// - // OnButtonSelectClicked(id); - // } + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); - // }); + OnButtonSelectClicked(id); + } - // row++; - - // } + }); + row++; + } } +void BeExamined_DeviceItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + + DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +//返回按钮 +void BeExamined_DeviceItem::on_pushButton_2_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); +} +void BeExamined_DeviceItem::DeviceInfoInit(QString id) +{ + // ======================================================================================== + // 初始化详情 + // ==================================================================================== + + QList data = dbManager.getTestedCatDevice(id); + for (const TestedCatDevice& testedCatDevice : data) { + + ui->equipment_name->setText(testedCatDevice.equipment_name); + ui->model->setText(testedCatDevice.model); + ui->help_instruction->setText(testedCatDevice.help_instruction); + ui->manufacture_no->setText(testedCatDevice.manufacture_no); + ui->product_country->setText(testedCatDevice.product_country); + ui->manufacturer->setText(testedCatDevice.manufacturer); + ui->product_date->setText(testedCatDevice.product_date); + ui->purchase_date->setText(testedCatDevice.purchase_date); + ui->unit_price->setText(testedCatDevice.unit_price); + ui->usage_status->setText(testedCatDevice.usage_status); + ui->quality_condition->setText(testedCatDevice.quality_condition); + ui->dept_name->setText(testedCatDevice.FULL_NAME); + ui->category->setText(testedCatDevice.category); + ui->check_cycle->setText(testedCatDevice.check_cycle); + ui->level->setText(testedCatDevice.level); + ui->remark->setText(testedCatDevice.remark); + } + + + // ======================================================================================== + // 初始化检定项目及核查点 + // ==================================================================================== + + //获取核查点tablewight的数据 + QStringList headlist; + + QList Data=dbManager.Search_CalibrationTable(id,&headlist); + + //tableWidgetItem + ui->tableWidgetItem->setRowCount(0); + ui->tableWidgetItem->setColumnCount(headlist.count()); + ui->tableWidgetItem->setHorizontalHeaderLabels(headlist); + //循环数据 + int rowCount=0; + int row=0; + ; + for (const QStringList& item : Data) + { + //获取行号 并进行添加行 + rowCount = ui->tableWidgetItem->rowCount(); + ui->tableWidgetItem->insertRow(rowCount); + //添加 序号 + ui->tableWidgetItem->setItem(row, 0, new QTableWidgetItem(QString::number(row+1))); + //循环读取值 headlist,count是列的数量 + for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型 + } + + row++; + + } +} + + + diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h index ffdc22a..0050ee7 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h @@ -21,6 +21,11 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + + void DeviceInfoInit(QString id); + + void on_pushButton_2_clicked(); private: Ui::BeExamined_DeviceItem *ui; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui index ce63879..cdacfaf 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui @@ -215,6 +215,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -225,6 +230,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 @@ -391,7 +401,7 @@ - + ForbiddenCursor @@ -412,7 +422,7 @@ - + ForbiddenCursor @@ -428,12 +438,12 @@ - 出厂编号: + 辅助字段: - + ForbiddenCursor @@ -449,12 +459,12 @@ - 检定有效期: + 出厂编号: - + ForbiddenCursor @@ -475,7 +485,7 @@ - + ForbiddenCursor @@ -496,7 +506,7 @@ - + ForbiddenCursor @@ -517,7 +527,7 @@ - + ForbiddenCursor @@ -538,7 +548,7 @@ - + ForbiddenCursor @@ -552,14 +562,14 @@ - + - 使用年限: + 设备单价: - + ForbiddenCursor @@ -573,14 +583,14 @@ - + - 设备单价: + 使用状态: - + ForbiddenCursor @@ -594,14 +604,14 @@ - + - 使用状态: + 质量状况: - + ForbiddenCursor @@ -615,14 +625,14 @@ - + - 质量状况: + 所在单位: - + ForbiddenCursor @@ -638,12 +648,12 @@ - 所属部门: + 使用部门: - + ForbiddenCursor @@ -657,14 +667,14 @@ - + - 负责人: + 设备分类: - + ForbiddenCursor @@ -678,14 +688,14 @@ - + - 设备供方: + 检定周期: - + ForbiddenCursor @@ -699,14 +709,14 @@ - + - 位置信息: + 重要等级: - + ForbiddenCursor @@ -720,140 +730,14 @@ - - - 设备类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 标准类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 设备分类: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 重要等级: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 检定周期: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 对应开箱记录: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - 备注: - - + + ForbiddenCursor @@ -892,7 +776,7 @@ - + diff --git a/softwareDirectory/AutoVerScheme/create_task.cpp b/softwareDirectory/AutoVerScheme/create_task.cpp index 9b49a1a..ddd78ef 100644 --- a/softwareDirectory/AutoVerScheme/create_task.cpp +++ b/softwareDirectory/AutoVerScheme/create_task.cpp @@ -2,12 +2,15 @@ #include "ui_create_task.h" #include "QMessageBox" + + QString Create_Task::State=""; Create_Task::Create_Task(QWidget *parent) : InfoBase(parent), ui(new Ui::Create_Task) { ui->setupUi(this); this->initForm(); + } Create_Task::~Create_Task() @@ -25,17 +28,19 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(8); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(9); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "任务单编号" << "委托方"<< "使用部门" << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; + headers <<"ID"<< "序号" << "任务单编号" << "委托方"<< "使用部门" + << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); //ShowMessageBox("标题","初始化完成"); } @@ -57,5 +62,171 @@ } void Create_Task::Load() { - //ShowMessageBox("创建任务界面","创建任务界面初始化完成"); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + + QList data = BaseCommonApi::getCreateTaskList(""); + + int rowCount = 0; + int row=0; + QString is_urgent; + for (const CreateTaskList& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.order_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.customer_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.DEPT_FULL_NAME)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.require_over_time.toString())); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.deliverer)); + if(item.is_urgent=="1") + is_urgent="是"; + else + is_urgent="否"; + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(is_urgent)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("查看"); + QPushButton *button2 = new QPushButton("编辑"); + QPushButton *button3 = new QPushButton("删除"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + Create_Task::State="Select"; + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonUpdateClicked(id); + Create_Task::State="Update"; + } + + }); + //设置按钮3简单样式 + button3->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: red; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button3->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button3, &QPushButton::clicked, this, [this, button3, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtoDeleteClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->addWidget(button3); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 8, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void Create_Task::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + HiddenButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "查看按钮ID",id); +} +void Create_Task::OnButtonUpdateClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "编辑按钮ID",id); +} +void Create_Task::OnButtoDeleteClicked(QString id) +{ + // ======================================================================================== + // 删除按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + + QMessageBox::information(this, "删除按钮ID",id); +} + +void Create_Task::on_pushButton_2_clicked() +{ + // ======================================================================================== + // 创建任务单按钮 + // ==================================================================================== + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + Create_Task::State="Create"; +} +void Create_Task::HiddenButton() +{ + ui->SaveButton->hide(); + ui->CreateButton->hide(); + ui->ScanButton->hide(); + ui->deletebutton->hide(); +} +void Create_Task::DisplayButton() +{ + ui->SaveButton->show(); + ui->CreateButton->show(); + ui->ScanButton->show(); + ui->deletebutton->show(); +} + +void Create_Task::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/create_task.h b/softwareDirectory/AutoVerScheme/create_task.h index 7cf383f..6b67c7c 100644 --- a/softwareDirectory/AutoVerScheme/create_task.h +++ b/softwareDirectory/AutoVerScheme/create_task.h @@ -16,11 +16,22 @@ explicit Create_Task(QWidget *parent = nullptr); ~Create_Task(); + //全局静态变量 + static QString State; private slots: void initForm(); //初始化界面数据 void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonUpdateClicked(QString id); + void OnButtoDeleteClicked(QString id); + void on_pushButton_2_clicked(); + void HiddenButton(); + void DisplayButton(); + + void on_pushButton_clicked(); + private: Ui::Create_Task *ui; }; diff --git a/softwareDirectory/AutoVerScheme/create_task.ui b/softwareDirectory/AutoVerScheme/create_task.ui index d9d88ed..b45af33 100644 --- a/softwareDirectory/AutoVerScheme/create_task.ui +++ b/softwareDirectory/AutoVerScheme/create_task.ui @@ -19,278 +19,651 @@ - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 1 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 任务单编号: - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - 委托方: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 使用部门: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 要求完成时间: - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(3, 58, 132); + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 任务单编号: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 委托方: + + + + + + + + + + 使用部门: + + + + + + + + + + 要求检完时间: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); color:white; - - - 查询 - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(207, 132, 33); + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); color:white; - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - 6 + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + 3 + + + + + + 50 + 40 + + + + + 100 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 创建任务单 + + + + + + + + + + + + + + + + + + + + + color:black; - - 9 - - - 9 - - - 9 - - - - - - 0 - 0 - - - - - 120 - 40 - - - - OpenHandCursor - - - Qt::DefaultContextMenu - - - Qt::RightToLeft - - - false - - - background-color:rgb(9, 89, 179); + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 创建任务单 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 保存 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; color:white; - - - 创建任务单 - - - true - - - - - - - - - - - - - - SizeVerCursor - - - - - - - + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接人: + + + + + + + 要求检完时间: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 是否加急: + + + + + + + 电话: + + + + + + + 委托方: + + + + + + + 任务单编号: + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接时间: + + + + + + + 送检人: + + + + + + + 接收说明: + + + + + + + 使用部门: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + 任务单列表: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 扫描增加 + + + false + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 增加行 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 删除行 + + + + + + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/depar_task.ui b/softwareDirectory/AutoVerScheme/depar_task.ui index efb7561..f44829d 100644 --- a/softwareDirectory/AutoVerScheme/depar_task.ui +++ b/softwareDirectory/AutoVerScheme/depar_task.ui @@ -213,86 +213,6 @@ - - - 12 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - diff --git a/softwareDirectory/AutoVerScheme/infomanageview.ui b/softwareDirectory/AutoVerScheme/infomanageview.ui index ef0b87b..cb76a28 100644 --- a/softwareDirectory/AutoVerScheme/infomanageview.ui +++ b/softwareDirectory/AutoVerScheme/infomanageview.ui @@ -20,7 +20,7 @@ color:black; background-color:rgba(240, 240, 240, 1); - + 0 @@ -37,77 +37,124 @@ 0 - - - - 0 - 0 - - - - - 170 - 0 - - - - - 16777215 - 16777215 - - + - color:White; - font-weight: bold; - font-size: 16px; -background-color:rgba(10, 15, 92, 1); + border-image: url(:/image/Index/u15.png); - - true - - - - - 0 - 0 - 170 - 625 - - - - - 0 - 0 - - - - - 170 - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - + + + + + + 50 + 50 + + + + + 35 + 35 + + + + image: url(:/image/Index/u2158.svg); + + + + + + + + + + color:white; +font-size:18px; +font-weight:bold; + + + 信息管理 + + + + - + + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 16777215 + 16777215 + + + + color:White; + font-weight: bold; + font-size: 16px; +background-color:rgba(10, 15, 92, 1); + + + true + + + + + 0 + 0 + 170 + 570 + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp index efc00ba..eea27f0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp @@ -25,17 +25,17 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 - + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0,0); //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "出厂编号" + headers <<"ID"<< "序号" << "设备名称" << "型号规则" << "出厂编号" <<"核查件名称"<<"核查件型号"<<"核查件编号" <<"核查员" << "核查日期" <<"实验室"<<"部门"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); @@ -58,5 +58,114 @@ } void InspectDataItem::Load() { - //ShowMessageBox("核查数据","核查数据"); + // ======================================================================================== + // 主页面初始化 核查管理初始化 + // ==================================================================================== + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + // 调用数据库管理器的函数获取数据 + int rowCount=0; + int row=0; + QList data = dbManager.getCheckData(); + for (const CheckData& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.equipment_name)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.model)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.manufacture_no)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.meter_standard_name)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(item.meter_standard_id)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(item.create_user_name)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(item.check_date.toString())); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(item.dept_name)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("详情"); + QPushButton *button2 = new QPushButton("预览"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonPreViewtClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 12, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void InspectDataItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +void InspectDataItem::OnButtonPreViewtClicked(QString id) +{ + // ======================================================================================== + // 预览按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} + +void InspectDataItem::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.h b/softwareDirectory/AutoVerScheme/inspectdataitem.h index bdf7066..6644339 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.h +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.h @@ -20,6 +20,10 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonPreViewtClicked(QString id); + void on_pushButton_clicked(); + private: Ui::InspectDataItem *ui; }; diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.ui b/softwareDirectory/AutoVerScheme/inspectdataitem.ui index 86786c9..3f319c0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.ui +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.ui @@ -7,232 +7,928 @@ 0 0 1362 - 543 + 553 Form - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 0 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 设备名称: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 型号规则: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 出厂编号: - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 核查员: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 核查日期: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 实验室: - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - Qt::RightToLeft - - - 查询 - - - - - - - Qt::RightToLeft - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - - - - - - - - - - + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 设备名称: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 型号规则: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 出厂编号: + + + + + + + + 0 + 0 + + + + + + + + 核查员: + + + + + + + + + + 实验室: + + + + + + + + + + 核查日期: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + + + + + + + + + + + + + + + + + color:black; + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 核查数据详情 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; +color:white; + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + 设备基本信息: + + + + + + + 设备名称: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 型号规格: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 出厂编号: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定有效期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产国家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产厂家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 购进日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用年限: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备单价: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用状态: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 质量状况: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 所属部门: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 负责人: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备供方: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 位置信息: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 标准类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备分类: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 重要等级: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定周期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 对应开箱记录: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 备注: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + 3 + + + false + + + Qt::LogicalMoveStyle + + + + + + + + + + + + + + + + 核查项目及核查点: + + + + + + + + + + + + + + 0 + 0 + + + + + 30 + 0 + + + + + + + + + + false + + + + 6 + + + 0 + + + 0 + + + 0 + + + 6 + + + + + 检定项备注: + + + + + + + background-color: #f0f0f0; +color: grey; + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/my_task.ui b/softwareDirectory/AutoVerScheme/my_task.ui index a078840..e04a336 100644 --- a/softwareDirectory/AutoVerScheme/my_task.ui +++ b/softwareDirectory/AutoVerScheme/my_task.ui @@ -157,6 +157,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -167,6 +172,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 diff --git a/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg b/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg new file mode 100644 index 0000000..fd249e0 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/softwareDirectory/AutoVerScheme/res/res.qrc b/softwareDirectory/AutoVerScheme/res/res.qrc index a0eac47..05edcdc 100644 --- a/softwareDirectory/AutoVerScheme/res/res.qrc +++ b/softwareDirectory/AutoVerScheme/res/res.qrc @@ -44,7 +44,11 @@ image/Index/u7488.svg image/Index/u7491.svg image/Index/u7538.svg +<<<<<<< HEAD image/Index/u2324.svg image/Index/u2325.svg +======= + image/Index/u2158.svg +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c diff --git a/softwareDirectory/AutoVerScheme/rulefileitem.cpp b/softwareDirectory/AutoVerScheme/rulefileitem.cpp index 095165e..9361752 100644 --- a/softwareDirectory/AutoVerScheme/rulefileitem.cpp +++ b/softwareDirectory/AutoVerScheme/rulefileitem.cpp @@ -27,17 +27,17 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(9); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(10); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + ui->tableWidget->setColumnWidth(0, 0); //设置数据 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "文件号" << "文件名称" << "版本号" << "文件类型"<< "颁布时间" + headers <<"ID"<< "序号" << "文件号" << "文件名称" << "版本号" << "文件类型"<< "颁布时间" << "实施时间" <<"备注"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); } @@ -58,6 +58,106 @@ msgBox.exec(); } void RuleFileItem::Load() +{// ======================================================================================== + // 主页面初始化 技术文件初始化 + // ==================================================================================== + ui->tableWidget->setRowCount(0); + + //先设置为行为0 + ui->tableWidget->setRowCount(0); + // 调用数据库管理器的函数获取数据 + int rowCount=0; + int row=0; + QList data = dbManager.getTechnique_File(); + for (const Technique_File& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.file_distribute_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.file_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.version_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.active_date.toString())); + ui->tableWidget->setItem(row, 7, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(item.remark)); + + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("详情"); + QPushButton *button2 = new QPushButton("预览"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonPreViewtClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 9, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void RuleFileItem::OnButtonSelectClicked(QString id) { - //ShowMessageBox("技术文件","技术文件初始化完成"); + // ======================================================================================== + // 详情按钮 点击事件 进入详情页面 + // ==================================================================================== + + QMessageBox::information(this, "详情按钮ID",id); +} +void RuleFileItem::OnButtonPreViewtClicked(QString id) +{ + // ======================================================================================== + // 下载按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "下载按钮ID",id); } diff --git a/softwareDirectory/AutoVerScheme/rulefileitem.h b/softwareDirectory/AutoVerScheme/rulefileitem.h index d892a71..b544722 100644 --- a/softwareDirectory/AutoVerScheme/rulefileitem.h +++ b/softwareDirectory/AutoVerScheme/rulefileitem.h @@ -20,6 +20,8 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonPreViewtClicked(QString id); private: Ui::RuleFileItem *ui; }; diff --git a/softwareDirectory/AutoVerScheme/rulefileitem.ui b/softwareDirectory/AutoVerScheme/rulefileitem.ui index 9144b96..4763c13 100644 --- a/softwareDirectory/AutoVerScheme/rulefileitem.ui +++ b/softwareDirectory/AutoVerScheme/rulefileitem.ui @@ -108,6 +108,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -118,6 +123,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 diff --git a/softwareDirectory/AutoVerScheme/standard_deviceitem.cpp b/softwareDirectory/AutoVerScheme/standard_deviceitem.cpp index 456b1aa..3489d64 100644 --- a/softwareDirectory/AutoVerScheme/standard_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/standard_deviceitem.cpp @@ -91,9 +91,7 @@ ui->tableWidget->setRowCount(0); // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BaseCommonApi dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; @@ -156,7 +154,7 @@ { - BaseCommonApi dbManager; + QList data = dbManager.getCatDeviceInfor(id); // 获取当前日期 使用年限=当前日期减去购进日期 @@ -203,8 +201,8 @@ //获取核查点tablewight的数据 QStringList headlist; - QString DeviceName = BaseCommonApi::getApparatus(id); - QList bizDeviceManageData=dbManager.getCheckDCPower(DeviceName,&headlist); + //QString DeviceName = BaseCommonApi::getApparatus(id); + QList bizDeviceManageData=dbManager.getCheckDCPower(id,&headlist); //QList bizDeviceManageData = BaseCommonApi::getCheckDCPower(id); //设置tablewight ui->tableWidgetItem->setRowCount(0); diff --git a/softwareDirectory/AutoVerScheme/standard_deviceitem.ui b/softwareDirectory/AutoVerScheme/standard_deviceitem.ui index 4416771..ba62a28 100644 --- a/softwareDirectory/AutoVerScheme/standard_deviceitem.ui +++ b/softwareDirectory/AutoVerScheme/standard_deviceitem.ui @@ -32,7 +32,7 @@ - 1 + 0 @@ -180,6 +180,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -190,6 +195,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/InfoBase.h b/softwareDirectory/AutoVerScheme/InfoBase.h index 6dd59f3..bce9609 100644 --- a/softwareDirectory/AutoVerScheme/InfoBase.h +++ b/softwareDirectory/AutoVerScheme/InfoBase.h @@ -4,6 +4,7 @@ #include #include "QStandardItemModel" #include "databaseconnection.h" +#include "basecommonapi.h" ///信号管理页面的基类 所有信息管理页面都继承于InfoBase /// 便于统一管理 所有子类必须实现Load方法 /// 每次按钮点击切换都会调用Load方法 用于每次页面的数据刷新 @@ -16,7 +17,7 @@ //QStandardItemModel 的实例。这个模型将用于存储和管理数据。 QStandardItemModel *model; //信息管理页面 基类定义Conn对象 - DatabaseConnection *Conn=DatabaseConnection::getInstance(); + BaseCommonApi dbManager; }; #endif // INFOBASE_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index f62915b..6170ee7 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -15,7 +15,7 @@ " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id " " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID " " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID " - " WHERE sys_user.ID = ' :userId '"); + " WHERE sys_user.ID = :userId"); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -75,6 +75,35 @@ } return result; } + +//获取创建任务首页数据 +QList BaseCommonApi::getCreateTaskList(QString userId) +{ + userId="1640229293790650370"; + QList result; + QSqlQuery query; + query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " + " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " + " WHERE bi.create_user_id = :userId"); + // 将参数绑定到占位符 + query.bindValue(":userId", userId); + if (query.exec()) { + while (query.next()) { + CreateTaskList task; + task.id = query.value("id").toString(); + task.order_no = query.value("order_no").toString(); + task.customer_name = query.value("customer_name").toString(); + task.DEPT_FULL_NAME = query.value("FULL_NAME").toString(); + task.require_over_time = query.value("require_over_time").toDateTime(); + task.deliverer = query.value("deliverer").toString(); + task.is_urgent = query.value("is_urgent").toString(); + result.append(task); + } + } else { + qDebug() << "Query execution failed: " << query.lastError().text(); + } + return result; +} //获取创建任务首页数据 QListgetCreateTaskList(QString userId) { @@ -82,7 +111,7 @@ QSqlQuery query; query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " - " WHERE bi.create_user_id = ':userId' "); + " WHERE bi.create_user_id = :userId "); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -103,6 +132,7 @@ return result; } + //创建任务单-查看/编辑 顶部数据 传参该条数据的id QListBaseCommonApi::getCatTask(QString id) { @@ -111,7 +141,7 @@ query.prepare("SELECT bi.order_no ,bi.customer_name ,dept.FULL_NAME ,bi.require_over_time ," " bi.deliverer ,bi.deliverer_tel ,bi.undertaker_name ,bi.undertake_time , bi.is_urgent AS ," " bi.receive_illustrate FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID" - " WHERE bi.id = ' :id '"); + " WHERE bi.id = :id "); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -140,6 +170,7 @@ //获取创建任务 -任务单列表 + QListBaseCommonApi::getCatTaskList(QString orderId) { QList result; @@ -380,6 +411,7 @@ QListBaseCommonApi::getCheckDCPower(QString equipment_id,QStringList *headList) { + equipment_id="1693435753272557570"; QList result; QSqlQuery query; query.prepare("SELECT besciddp.id ,besciddp.params,besciddp.unit,resolution,besciddp.urel,besciddp.check_type,datum_point,cycle_number " @@ -407,9 +439,11 @@ } else { qDebug() << "Query execution failed: " << query.lastError().text(); } + *headList <<"序号"<<"核查项目"<<"核查点"<<"单位"<<"分辨力"<<"Urel"<<"核查类型"<<"是否为基准点(1/0)"<<"循环次数" <<"电阻值/频率"<<"电阻值单位/频率单位"<<"核查项备注"; + return result; } //根据id获取装置名称 @@ -436,9 +470,9 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " - " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id " - " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); +bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " + " JOIN sys_dept ON sys_dept.ID = eei.dept_id " + " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); if (isSuccess) { while (query.next()) { TestedDevice testedDevice; @@ -504,9 +538,10 @@ //判断 哪个 装置表 传参 设备id QList BaseCommonApi::getJudgeCalibrationTable(QString id) { + id="1716997603953311746"; QList result; QSqlQuery query; - query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = ':id')"); + query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = :id )"); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -526,12 +561,55 @@ return result; } +//标准装置字典类型 +/** + * 多功能校准源标准装置 = 1 + * 直流稳压电源检定装置 = 2 + * 多功能电气安全校准器标准装置 = 3 + * 0.02级活塞式压力计标准装置 = 4 + * 二等铂电阻温度计标准装置 = 5 + * 安全阀校验装置 = 6 + * 精密露点仪标准装置 = 7 + * E2等级砝码标准装置 = 8 + * 频谱分析仪标准装置 = 9 + * 信号发生器标准装置 = 10 + * 微波衰减标准装置 = 11 + * 频率短期稳定度标准装置 =12 + * 示波器标准装置 = 13 + * 铯原子频率标准装置 =14 + * 小功率标准装置 = 15 + * 低频信号发生器标准装置 = 16 + * S参数标准装置 = 17 + * 失真度标准装置 = 18 + */ +//根据被检设备ID获取当前设备的 核查项目及核查点 + +QList BaseCommonApi::Search_CalibrationTable(QString DeiverId,QStringList *HeadList) +{ + + QList DataList; + DataList.clear(); + QList CliTable=BaseCommonApi::getJudgeCalibrationTable(DeiverId); + if(CliTable.count()==0)return DataList; + switch (CliTable[0].belong_standard_equipment.toInt()) + { + case 1: + + //CliTable[0].item_category_id + DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList); + break; + } + + return DataList; +} //被检设备管理-检定项目及检定点-多功能校准源 -QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) +QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) { -QList result; +QList resultData; +QStringList result; +resultData.clear(); QSqlQuery query; query.prepare("SELECT bbdmidc.id ,bbdmidc.params ,bbdmidc.capacity ,bbdmidc.unit ,bbdmidc.frequency , bbdmidc.range_range , bbdmidc.standard_value , bbdmidc.resolution , bbdmidc.maximum_error , bbdmidc.error_param_a , bbdmidc.error_param_b " @@ -542,26 +620,24 @@ if (query.exec()) { while (query.next()) { - VerMultiCal calibration; - calibration.id = query.value("id").toString(); - calibration.params = query.value("params").toString(); - calibration.capacity = query.value("capacity").toString(); - calibration.unit = query.value("unit").toString(); - calibration.frequency = query.value("frequency").toString(); - calibration.range_range = query.value("range_range").toString(); - calibration.standard_value = query.value("standard_value").toString(); - calibration.resolution = query.value("resolution").toString(); - calibration.maximum_error = query.value("maximum_error").toString(); - calibration.error_param_a = query.value("error_param_a").toString(); - calibration.error_param_b = query.value("error_param_b").toString(); - - result.append(calibration); + result.clear(); + result.append(query.value("id").toString()); + result.append(query.value("params").toString()); + result.append(query.value("capacity").toString()); + result.append(query.value("unit").toString()); + result.append(query.value("frequency").toString()); + result.append(query.value("range_range").toString()); + result.append(query.value("standard_value").toString()); + result.append(query.value("resolution").toString()); + result.append(query.value("maximum_error").toString()); + result.append(query.value("error_param_a").toString()); + result.append(query.value("error_param_b").toString()); + resultData.append(result); } } else { qDebug() << "Query execution failed: " << query.lastError().text(); } - *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; - return result; + *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; } //检定数据管理 首页 @@ -757,7 +833,7 @@ " LEFT JOIN biz_equipment_standard_check_info besci ON besci.item_category_id = bescidc.item_category_id " " WHERE bescidc.equipment_id = :equipment_id "); - // 将参数绑定到占位符 '1692796512381222914' + // 将参数绑定到占位符 1692796512381222914 query.bindValue(":equipment_id", equipment_id); if (query.exec()) { while (query.next()) { @@ -788,12 +864,13 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " + bool isSuccess = query.exec("SELECT brtf.id,brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " " FROM biz_resource_technique_file brtf"); if (isSuccess) { while (query.next()) { Technique_File file; + file.id=query.value("id").toString(); file.file_distribute_no = query.value("file_distribute_no").toString(); file.file_name = query.value("file_name").toString(); file.version_no = query.value("version_no").toString(); @@ -876,7 +953,7 @@ QList result; QSqlQuery query; query.prepare("SELECT id,device_id ,communication_type ,serial_port ,visa ,create_time ,update_time " - "FROM zd_communication_setting WHERE device_id = ' :deviceId '"); + "FROM zd_communication_setting WHERE device_id = :deviceId "); query.bindValue(":deviceId", deviceId); if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h index 1b70cb9..ff8a320 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.h +++ b/softwareDirectory/AutoVerScheme/basecommonapi.h @@ -9,7 +9,7 @@ #include "databaseconnection.h" #include "id\IdWorker.h" - +#include "QStringList" //部门任务 @@ -52,6 +52,7 @@ QDateTime require_over_time; QString deliverer; QString is_urgent; + }; //创建任务单-查看任务单 class CatTask @@ -241,9 +242,15 @@ QString belong_standard_equipment; }; +class BaseEntity: public QObject +{ + Q_OBJECT + public: + +}; //被检设备管理-检定项目及检定点-检定项多功能校准源 -class VerMultiCal +class VerMultiCal:public BaseEntity { public: QString id; @@ -365,6 +372,7 @@ class Technique_File { public: + QString id; QString file_distribute_no; QString file_name; QString version_no; @@ -444,12 +452,22 @@ public: BaseCommonApi(); + // + static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList); + //部门任务 + static QList getAllData(); + //部门任务 参数登录用户的id static QList getAllData(QString userId); + //我的任务 static QList getMyTasks(QString id); //获取创建任务首页数据 - static QListgetCreateTaskList(QString id); + + static QListgetCreateTaskList(QString userId); + + + //创建任务-查看任务单顶部 static QListgetCatTask(QString orderNo); //创建任务-查看任务列表底部 @@ -479,7 +497,10 @@ //判断 哪个 装置表 传参 设备id 返回itemId static QList getJudgeCalibrationTable(QString id); //被检设备管理-检定项目及检定点-多功能校准源 - static QList getVerMultiCal(QString itemId,QStringList *headList); + + + static QList getVerMultiCal(QString itemId,QStringList *headList); + // 获取检定数据管理 首页 static QList getVerificationData(); // 检定数据管理-检定基本信息 @@ -494,6 +515,7 @@ static QList getCheckDataManageResultManageMult(QString equipment_id); //技术文件 static QList getTechnique_File(); + //检定程序管理首页查询 static QList getVerificationProgramInfoMain(); //检定程序管理 编辑 @@ -525,7 +547,6 @@ IdWorker &idWorker = Singleton::instance(); //自动检定 - }; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp index c3b2786..70148f4 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp @@ -4,6 +4,7 @@ #include "basecommonapi.h" //#include "tested_device_manage_serve.h" +#include "QStringList" //被检设备 BeExamined_DeviceItem::BeExamined_DeviceItem(QWidget *parent) : @@ -32,19 +33,32 @@ "}"); // ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); // item->setTextAlignment(Qt::AlignCenter); //ui->tableWidget->setItem(0, 0, item); //设置数据 - + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" + headers << "ID" << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" << "生产厂家"<<"所在单位" <<"使用部门"<<"计量标识"<<"检定周期"<<"证书有效期"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); + //详情页面tableWidgetItem设置 + ui->tableWidgetItem->setStyleSheet("QHeaderView::section {" + "border: 1px solid rgba(197, 196, 196, 1);" + "border-left:none;" + "border-top:none;" + "background-color:white;" + "}"); + + // ui->tableWidget->setRowCount(10); // 设置10行 + //ui->tableWidgetItem->setColumnCount(14); // 设置11列 + ui->tableWidgetItem->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 + ui->tableWidgetItem->verticalHeader()->setParent(nullptr); //隐藏行头 + } void BeExamined_DeviceItem::ShowMessageBox(QString title,QString value) { // 创建一个QMessageBox对象 @@ -64,24 +78,19 @@ } void BeExamined_DeviceItem::Load() { - //获取主页面内容 - //进入主页面 - /* - ui->stackedWidget->setCurrentIndex(0); + // ======================================================================================== + // 主页面初始化 + // ==================================================================================== + + + ui->stackedWidget->setCurrentIndex(0); //先设置为行为0 ui->tableWidget->setRowCount(0); - - - // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BeExamined_DeviceItem dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; int row=0; - QList data = dbManager.getBizDeviceManage(); - - - for (const BizDevice& bizDevice : data) { + QList data = dbManager.getTestedDevice(); + for (const TestedDevice& bizDevice : data) { rowCount = ui->tableWidget->rowCount(); ui->tableWidget->insertRow(rowCount); @@ -89,34 +98,118 @@ ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); ui->tableWidget->setItem(row, 2, new QTableWidgetItem(bizDevice.equipment_name)); ui->tableWidget->setItem(row, 3, new QTableWidgetItem(bizDevice.model)); - ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacture_no)); - ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.help_instruction)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacture_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(bizDevice.FULL_NAME)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(bizDevice.meter_identify)); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem(bizDevice.check_cycle)); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(bizDevice.certificate_valid)); + //添加操作按钮 QPushButton *button = new QPushButton("查看"); - ui->tableWidget->setCellWidget(row, 6, button); + ui->tableWidget->setCellWidget(row, 12, button); //设置按钮简单样式 button->setStyleSheet("QPushButton {" - " border: none; /* 无边框 "*/ - // " color: green; /* 文本颜色 */" - // " text-decoration: underline; /* 文本下划线 */" - // "}"); + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); // 设置鼠标悬停时的光标样式为小手图标 - // button->setCursor(Qt::PointingHandCursor); + button->setCursor(Qt::PointingHandCursor); // 连接按钮的 clicked 信号到自定义槽函数 - // connect(button, &QPushButton::clicked, this, [this, button, row]() { - // 获取当前行第一列的 ID - // QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); - // if (idItem) { - // QString id = idItem->text(); -// - // OnButtonSelectClicked(id); - // } + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); - // }); + OnButtonSelectClicked(id); + } - // row++; - - // } + }); + row++; + } } +void BeExamined_DeviceItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + + DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +//返回按钮 +void BeExamined_DeviceItem::on_pushButton_2_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); +} +void BeExamined_DeviceItem::DeviceInfoInit(QString id) +{ + // ======================================================================================== + // 初始化详情 + // ==================================================================================== + + QList data = dbManager.getTestedCatDevice(id); + for (const TestedCatDevice& testedCatDevice : data) { + + ui->equipment_name->setText(testedCatDevice.equipment_name); + ui->model->setText(testedCatDevice.model); + ui->help_instruction->setText(testedCatDevice.help_instruction); + ui->manufacture_no->setText(testedCatDevice.manufacture_no); + ui->product_country->setText(testedCatDevice.product_country); + ui->manufacturer->setText(testedCatDevice.manufacturer); + ui->product_date->setText(testedCatDevice.product_date); + ui->purchase_date->setText(testedCatDevice.purchase_date); + ui->unit_price->setText(testedCatDevice.unit_price); + ui->usage_status->setText(testedCatDevice.usage_status); + ui->quality_condition->setText(testedCatDevice.quality_condition); + ui->dept_name->setText(testedCatDevice.FULL_NAME); + ui->category->setText(testedCatDevice.category); + ui->check_cycle->setText(testedCatDevice.check_cycle); + ui->level->setText(testedCatDevice.level); + ui->remark->setText(testedCatDevice.remark); + } + + + // ======================================================================================== + // 初始化检定项目及核查点 + // ==================================================================================== + + //获取核查点tablewight的数据 + QStringList headlist; + + QList Data=dbManager.Search_CalibrationTable(id,&headlist); + + //tableWidgetItem + ui->tableWidgetItem->setRowCount(0); + ui->tableWidgetItem->setColumnCount(headlist.count()); + ui->tableWidgetItem->setHorizontalHeaderLabels(headlist); + //循环数据 + int rowCount=0; + int row=0; + ; + for (const QStringList& item : Data) + { + //获取行号 并进行添加行 + rowCount = ui->tableWidgetItem->rowCount(); + ui->tableWidgetItem->insertRow(rowCount); + //添加 序号 + ui->tableWidgetItem->setItem(row, 0, new QTableWidgetItem(QString::number(row+1))); + //循环读取值 headlist,count是列的数量 + for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型 + } + + row++; + + } +} + + + diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h index ffdc22a..0050ee7 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h @@ -21,6 +21,11 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + + void DeviceInfoInit(QString id); + + void on_pushButton_2_clicked(); private: Ui::BeExamined_DeviceItem *ui; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui index ce63879..cdacfaf 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui @@ -215,6 +215,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -225,6 +230,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 @@ -391,7 +401,7 @@ - + ForbiddenCursor @@ -412,7 +422,7 @@ - + ForbiddenCursor @@ -428,12 +438,12 @@ - 出厂编号: + 辅助字段: - + ForbiddenCursor @@ -449,12 +459,12 @@ - 检定有效期: + 出厂编号: - + ForbiddenCursor @@ -475,7 +485,7 @@ - + ForbiddenCursor @@ -496,7 +506,7 @@ - + ForbiddenCursor @@ -517,7 +527,7 @@ - + ForbiddenCursor @@ -538,7 +548,7 @@ - + ForbiddenCursor @@ -552,14 +562,14 @@ - + - 使用年限: + 设备单价: - + ForbiddenCursor @@ -573,14 +583,14 @@ - + - 设备单价: + 使用状态: - + ForbiddenCursor @@ -594,14 +604,14 @@ - + - 使用状态: + 质量状况: - + ForbiddenCursor @@ -615,14 +625,14 @@ - + - 质量状况: + 所在单位: - + ForbiddenCursor @@ -638,12 +648,12 @@ - 所属部门: + 使用部门: - + ForbiddenCursor @@ -657,14 +667,14 @@ - + - 负责人: + 设备分类: - + ForbiddenCursor @@ -678,14 +688,14 @@ - + - 设备供方: + 检定周期: - + ForbiddenCursor @@ -699,14 +709,14 @@ - + - 位置信息: + 重要等级: - + ForbiddenCursor @@ -720,140 +730,14 @@ - - - 设备类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 标准类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 设备分类: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 重要等级: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 检定周期: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 对应开箱记录: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - 备注: - - + + ForbiddenCursor @@ -892,7 +776,7 @@ - + diff --git a/softwareDirectory/AutoVerScheme/create_task.cpp b/softwareDirectory/AutoVerScheme/create_task.cpp index 9b49a1a..ddd78ef 100644 --- a/softwareDirectory/AutoVerScheme/create_task.cpp +++ b/softwareDirectory/AutoVerScheme/create_task.cpp @@ -2,12 +2,15 @@ #include "ui_create_task.h" #include "QMessageBox" + + QString Create_Task::State=""; Create_Task::Create_Task(QWidget *parent) : InfoBase(parent), ui(new Ui::Create_Task) { ui->setupUi(this); this->initForm(); + } Create_Task::~Create_Task() @@ -25,17 +28,19 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(8); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(9); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "任务单编号" << "委托方"<< "使用部门" << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; + headers <<"ID"<< "序号" << "任务单编号" << "委托方"<< "使用部门" + << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); //ShowMessageBox("标题","初始化完成"); } @@ -57,5 +62,171 @@ } void Create_Task::Load() { - //ShowMessageBox("创建任务界面","创建任务界面初始化完成"); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + + QList data = BaseCommonApi::getCreateTaskList(""); + + int rowCount = 0; + int row=0; + QString is_urgent; + for (const CreateTaskList& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.order_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.customer_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.DEPT_FULL_NAME)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.require_over_time.toString())); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.deliverer)); + if(item.is_urgent=="1") + is_urgent="是"; + else + is_urgent="否"; + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(is_urgent)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("查看"); + QPushButton *button2 = new QPushButton("编辑"); + QPushButton *button3 = new QPushButton("删除"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + Create_Task::State="Select"; + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonUpdateClicked(id); + Create_Task::State="Update"; + } + + }); + //设置按钮3简单样式 + button3->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: red; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button3->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button3, &QPushButton::clicked, this, [this, button3, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtoDeleteClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->addWidget(button3); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 8, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void Create_Task::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + HiddenButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "查看按钮ID",id); +} +void Create_Task::OnButtonUpdateClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "编辑按钮ID",id); +} +void Create_Task::OnButtoDeleteClicked(QString id) +{ + // ======================================================================================== + // 删除按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + + QMessageBox::information(this, "删除按钮ID",id); +} + +void Create_Task::on_pushButton_2_clicked() +{ + // ======================================================================================== + // 创建任务单按钮 + // ==================================================================================== + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + Create_Task::State="Create"; +} +void Create_Task::HiddenButton() +{ + ui->SaveButton->hide(); + ui->CreateButton->hide(); + ui->ScanButton->hide(); + ui->deletebutton->hide(); +} +void Create_Task::DisplayButton() +{ + ui->SaveButton->show(); + ui->CreateButton->show(); + ui->ScanButton->show(); + ui->deletebutton->show(); +} + +void Create_Task::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/create_task.h b/softwareDirectory/AutoVerScheme/create_task.h index 7cf383f..6b67c7c 100644 --- a/softwareDirectory/AutoVerScheme/create_task.h +++ b/softwareDirectory/AutoVerScheme/create_task.h @@ -16,11 +16,22 @@ explicit Create_Task(QWidget *parent = nullptr); ~Create_Task(); + //全局静态变量 + static QString State; private slots: void initForm(); //初始化界面数据 void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonUpdateClicked(QString id); + void OnButtoDeleteClicked(QString id); + void on_pushButton_2_clicked(); + void HiddenButton(); + void DisplayButton(); + + void on_pushButton_clicked(); + private: Ui::Create_Task *ui; }; diff --git a/softwareDirectory/AutoVerScheme/create_task.ui b/softwareDirectory/AutoVerScheme/create_task.ui index d9d88ed..b45af33 100644 --- a/softwareDirectory/AutoVerScheme/create_task.ui +++ b/softwareDirectory/AutoVerScheme/create_task.ui @@ -19,278 +19,651 @@ - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 1 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 任务单编号: - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - 委托方: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 使用部门: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 要求完成时间: - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(3, 58, 132); + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 任务单编号: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 委托方: + + + + + + + + + + 使用部门: + + + + + + + + + + 要求检完时间: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); color:white; - - - 查询 - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(207, 132, 33); + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); color:white; - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - 6 + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + 3 + + + + + + 50 + 40 + + + + + 100 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 创建任务单 + + + + + + + + + + + + + + + + + + + + + color:black; - - 9 - - - 9 - - - 9 - - - - - - 0 - 0 - - - - - 120 - 40 - - - - OpenHandCursor - - - Qt::DefaultContextMenu - - - Qt::RightToLeft - - - false - - - background-color:rgb(9, 89, 179); + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 创建任务单 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 保存 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; color:white; - - - 创建任务单 - - - true - - - - - - - - - - - - - - SizeVerCursor - - - - - - - + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接人: + + + + + + + 要求检完时间: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 是否加急: + + + + + + + 电话: + + + + + + + 委托方: + + + + + + + 任务单编号: + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接时间: + + + + + + + 送检人: + + + + + + + 接收说明: + + + + + + + 使用部门: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + 任务单列表: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 扫描增加 + + + false + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 增加行 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 删除行 + + + + + + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/depar_task.ui b/softwareDirectory/AutoVerScheme/depar_task.ui index efb7561..f44829d 100644 --- a/softwareDirectory/AutoVerScheme/depar_task.ui +++ b/softwareDirectory/AutoVerScheme/depar_task.ui @@ -213,86 +213,6 @@ - - - 12 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - diff --git a/softwareDirectory/AutoVerScheme/infomanageview.ui b/softwareDirectory/AutoVerScheme/infomanageview.ui index ef0b87b..cb76a28 100644 --- a/softwareDirectory/AutoVerScheme/infomanageview.ui +++ b/softwareDirectory/AutoVerScheme/infomanageview.ui @@ -20,7 +20,7 @@ color:black; background-color:rgba(240, 240, 240, 1); - + 0 @@ -37,77 +37,124 @@ 0 - - - - 0 - 0 - - - - - 170 - 0 - - - - - 16777215 - 16777215 - - + - color:White; - font-weight: bold; - font-size: 16px; -background-color:rgba(10, 15, 92, 1); + border-image: url(:/image/Index/u15.png); - - true - - - - - 0 - 0 - 170 - 625 - - - - - 0 - 0 - - - - - 170 - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - + + + + + + 50 + 50 + + + + + 35 + 35 + + + + image: url(:/image/Index/u2158.svg); + + + + + + + + + + color:white; +font-size:18px; +font-weight:bold; + + + 信息管理 + + + + - + + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 16777215 + 16777215 + + + + color:White; + font-weight: bold; + font-size: 16px; +background-color:rgba(10, 15, 92, 1); + + + true + + + + + 0 + 0 + 170 + 570 + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp index efc00ba..eea27f0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp @@ -25,17 +25,17 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 - + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0,0); //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "出厂编号" + headers <<"ID"<< "序号" << "设备名称" << "型号规则" << "出厂编号" <<"核查件名称"<<"核查件型号"<<"核查件编号" <<"核查员" << "核查日期" <<"实验室"<<"部门"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); @@ -58,5 +58,114 @@ } void InspectDataItem::Load() { - //ShowMessageBox("核查数据","核查数据"); + // ======================================================================================== + // 主页面初始化 核查管理初始化 + // ==================================================================================== + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + // 调用数据库管理器的函数获取数据 + int rowCount=0; + int row=0; + QList data = dbManager.getCheckData(); + for (const CheckData& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.equipment_name)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.model)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.manufacture_no)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.meter_standard_name)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(item.meter_standard_id)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(item.create_user_name)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(item.check_date.toString())); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(item.dept_name)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("详情"); + QPushButton *button2 = new QPushButton("预览"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonPreViewtClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 12, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void InspectDataItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +void InspectDataItem::OnButtonPreViewtClicked(QString id) +{ + // ======================================================================================== + // 预览按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} + +void InspectDataItem::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.h b/softwareDirectory/AutoVerScheme/inspectdataitem.h index bdf7066..6644339 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.h +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.h @@ -20,6 +20,10 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonPreViewtClicked(QString id); + void on_pushButton_clicked(); + private: Ui::InspectDataItem *ui; }; diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.ui b/softwareDirectory/AutoVerScheme/inspectdataitem.ui index 86786c9..3f319c0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.ui +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.ui @@ -7,232 +7,928 @@ 0 0 1362 - 543 + 553 Form - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 0 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 设备名称: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 型号规则: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 出厂编号: - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 核查员: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 核查日期: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 实验室: - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - Qt::RightToLeft - - - 查询 - - - - - - - Qt::RightToLeft - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - - - - - - - - - - + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 设备名称: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 型号规则: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 出厂编号: + + + + + + + + 0 + 0 + + + + + + + + 核查员: + + + + + + + + + + 实验室: + + + + + + + + + + 核查日期: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + + + + + + + + + + + + + + + + + color:black; + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 核查数据详情 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; +color:white; + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + 设备基本信息: + + + + + + + 设备名称: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 型号规格: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 出厂编号: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定有效期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产国家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产厂家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 购进日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用年限: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备单价: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用状态: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 质量状况: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 所属部门: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 负责人: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备供方: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 位置信息: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 标准类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备分类: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 重要等级: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定周期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 对应开箱记录: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 备注: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + 3 + + + false + + + Qt::LogicalMoveStyle + + + + + + + + + + + + + + + + 核查项目及核查点: + + + + + + + + + + + + + + 0 + 0 + + + + + 30 + 0 + + + + + + + + + + false + + + + 6 + + + 0 + + + 0 + + + 0 + + + 6 + + + + + 检定项备注: + + + + + + + background-color: #f0f0f0; +color: grey; + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/my_task.ui b/softwareDirectory/AutoVerScheme/my_task.ui index a078840..e04a336 100644 --- a/softwareDirectory/AutoVerScheme/my_task.ui +++ b/softwareDirectory/AutoVerScheme/my_task.ui @@ -157,6 +157,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -167,6 +172,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 diff --git a/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg b/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg new file mode 100644 index 0000000..fd249e0 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/softwareDirectory/AutoVerScheme/res/res.qrc b/softwareDirectory/AutoVerScheme/res/res.qrc index a0eac47..05edcdc 100644 --- a/softwareDirectory/AutoVerScheme/res/res.qrc +++ b/softwareDirectory/AutoVerScheme/res/res.qrc @@ -44,7 +44,11 @@ image/Index/u7488.svg image/Index/u7491.svg image/Index/u7538.svg +<<<<<<< HEAD image/Index/u2324.svg image/Index/u2325.svg +======= + image/Index/u2158.svg +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c diff --git a/softwareDirectory/AutoVerScheme/rulefileitem.cpp b/softwareDirectory/AutoVerScheme/rulefileitem.cpp index 095165e..9361752 100644 --- a/softwareDirectory/AutoVerScheme/rulefileitem.cpp +++ b/softwareDirectory/AutoVerScheme/rulefileitem.cpp @@ -27,17 +27,17 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(9); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(10); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + ui->tableWidget->setColumnWidth(0, 0); //设置数据 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "文件号" << "文件名称" << "版本号" << "文件类型"<< "颁布时间" + headers <<"ID"<< "序号" << "文件号" << "文件名称" << "版本号" << "文件类型"<< "颁布时间" << "实施时间" <<"备注"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); } @@ -58,6 +58,106 @@ msgBox.exec(); } void RuleFileItem::Load() +{// ======================================================================================== + // 主页面初始化 技术文件初始化 + // ==================================================================================== + ui->tableWidget->setRowCount(0); + + //先设置为行为0 + ui->tableWidget->setRowCount(0); + // 调用数据库管理器的函数获取数据 + int rowCount=0; + int row=0; + QList data = dbManager.getTechnique_File(); + for (const Technique_File& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.file_distribute_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.file_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.version_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.active_date.toString())); + ui->tableWidget->setItem(row, 7, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(item.remark)); + + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("详情"); + QPushButton *button2 = new QPushButton("预览"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonPreViewtClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 9, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void RuleFileItem::OnButtonSelectClicked(QString id) { - //ShowMessageBox("技术文件","技术文件初始化完成"); + // ======================================================================================== + // 详情按钮 点击事件 进入详情页面 + // ==================================================================================== + + QMessageBox::information(this, "详情按钮ID",id); +} +void RuleFileItem::OnButtonPreViewtClicked(QString id) +{ + // ======================================================================================== + // 下载按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "下载按钮ID",id); } diff --git a/softwareDirectory/AutoVerScheme/rulefileitem.h b/softwareDirectory/AutoVerScheme/rulefileitem.h index d892a71..b544722 100644 --- a/softwareDirectory/AutoVerScheme/rulefileitem.h +++ b/softwareDirectory/AutoVerScheme/rulefileitem.h @@ -20,6 +20,8 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonPreViewtClicked(QString id); private: Ui::RuleFileItem *ui; }; diff --git a/softwareDirectory/AutoVerScheme/rulefileitem.ui b/softwareDirectory/AutoVerScheme/rulefileitem.ui index 9144b96..4763c13 100644 --- a/softwareDirectory/AutoVerScheme/rulefileitem.ui +++ b/softwareDirectory/AutoVerScheme/rulefileitem.ui @@ -108,6 +108,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -118,6 +123,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 diff --git a/softwareDirectory/AutoVerScheme/standard_deviceitem.cpp b/softwareDirectory/AutoVerScheme/standard_deviceitem.cpp index 456b1aa..3489d64 100644 --- a/softwareDirectory/AutoVerScheme/standard_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/standard_deviceitem.cpp @@ -91,9 +91,7 @@ ui->tableWidget->setRowCount(0); // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BaseCommonApi dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; @@ -156,7 +154,7 @@ { - BaseCommonApi dbManager; + QList data = dbManager.getCatDeviceInfor(id); // 获取当前日期 使用年限=当前日期减去购进日期 @@ -203,8 +201,8 @@ //获取核查点tablewight的数据 QStringList headlist; - QString DeviceName = BaseCommonApi::getApparatus(id); - QList bizDeviceManageData=dbManager.getCheckDCPower(DeviceName,&headlist); + //QString DeviceName = BaseCommonApi::getApparatus(id); + QList bizDeviceManageData=dbManager.getCheckDCPower(id,&headlist); //QList bizDeviceManageData = BaseCommonApi::getCheckDCPower(id); //设置tablewight ui->tableWidgetItem->setRowCount(0); diff --git a/softwareDirectory/AutoVerScheme/standard_deviceitem.ui b/softwareDirectory/AutoVerScheme/standard_deviceitem.ui index 4416771..ba62a28 100644 --- a/softwareDirectory/AutoVerScheme/standard_deviceitem.ui +++ b/softwareDirectory/AutoVerScheme/standard_deviceitem.ui @@ -32,7 +32,7 @@ - 1 + 0 @@ -180,6 +180,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -190,6 +195,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 diff --git a/softwareDirectory/AutoVerScheme/testdataitem.cpp b/softwareDirectory/AutoVerScheme/testdataitem.cpp index 5666404..08c3200 100644 --- a/softwareDirectory/AutoVerScheme/testdataitem.cpp +++ b/softwareDirectory/AutoVerScheme/testdataitem.cpp @@ -26,17 +26,17 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(14); // 设置11列 + // ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(15); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 - + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0,0); //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" + headers <<"ID" << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" << "生产厂家"<<"委托单位" <<"使用部门"<< "检定员"<< "检定时间" <<"检定有效期"<<"计量标识"<<"限用说明"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); @@ -59,5 +59,117 @@ } void TestDataItem::Load() { - //ShowMessageBox("检定","检定管理初始化完成"); + + + // ======================================================================================== + // 主页面初始化 检定管理初始化 + // ==================================================================================== + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + // 调用数据库管理器的函数获取数据 + int rowCount=0; + int row=0; + QList data = dbManager.getVerificationData(); + for (const VerificationData& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.sample_name)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.model)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.help_instruction)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.manufacture_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.manufacturer)); + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(item.customer_name)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(item.FULL_NAME)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(item.NAME)); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem(item.trace_date.toString())); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(item.measure_valid_date.toString())); + ui->tableWidget->setItem(row, 12, new QTableWidgetItem(item.meter_identify)); + ui->tableWidget->setItem(row, 13, new QTableWidgetItem(item.restriction_instruction)); + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("详情"); + QPushButton *button2 = new QPushButton("预览"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonPreViewtClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 14, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void TestDataItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +void TestDataItem::OnButtonPreViewtClicked(QString id) +{ + // ======================================================================================== + // 预览按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} + +void TestDataItem::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/InfoBase.h b/softwareDirectory/AutoVerScheme/InfoBase.h index 6dd59f3..bce9609 100644 --- a/softwareDirectory/AutoVerScheme/InfoBase.h +++ b/softwareDirectory/AutoVerScheme/InfoBase.h @@ -4,6 +4,7 @@ #include #include "QStandardItemModel" #include "databaseconnection.h" +#include "basecommonapi.h" ///信号管理页面的基类 所有信息管理页面都继承于InfoBase /// 便于统一管理 所有子类必须实现Load方法 /// 每次按钮点击切换都会调用Load方法 用于每次页面的数据刷新 @@ -16,7 +17,7 @@ //QStandardItemModel 的实例。这个模型将用于存储和管理数据。 QStandardItemModel *model; //信息管理页面 基类定义Conn对象 - DatabaseConnection *Conn=DatabaseConnection::getInstance(); + BaseCommonApi dbManager; }; #endif // INFOBASE_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index f62915b..6170ee7 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -15,7 +15,7 @@ " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id " " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID " " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID " - " WHERE sys_user.ID = ' :userId '"); + " WHERE sys_user.ID = :userId"); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -75,6 +75,35 @@ } return result; } + +//获取创建任务首页数据 +QList BaseCommonApi::getCreateTaskList(QString userId) +{ + userId="1640229293790650370"; + QList result; + QSqlQuery query; + query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " + " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " + " WHERE bi.create_user_id = :userId"); + // 将参数绑定到占位符 + query.bindValue(":userId", userId); + if (query.exec()) { + while (query.next()) { + CreateTaskList task; + task.id = query.value("id").toString(); + task.order_no = query.value("order_no").toString(); + task.customer_name = query.value("customer_name").toString(); + task.DEPT_FULL_NAME = query.value("FULL_NAME").toString(); + task.require_over_time = query.value("require_over_time").toDateTime(); + task.deliverer = query.value("deliverer").toString(); + task.is_urgent = query.value("is_urgent").toString(); + result.append(task); + } + } else { + qDebug() << "Query execution failed: " << query.lastError().text(); + } + return result; +} //获取创建任务首页数据 QListgetCreateTaskList(QString userId) { @@ -82,7 +111,7 @@ QSqlQuery query; query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " - " WHERE bi.create_user_id = ':userId' "); + " WHERE bi.create_user_id = :userId "); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -103,6 +132,7 @@ return result; } + //创建任务单-查看/编辑 顶部数据 传参该条数据的id QListBaseCommonApi::getCatTask(QString id) { @@ -111,7 +141,7 @@ query.prepare("SELECT bi.order_no ,bi.customer_name ,dept.FULL_NAME ,bi.require_over_time ," " bi.deliverer ,bi.deliverer_tel ,bi.undertaker_name ,bi.undertake_time , bi.is_urgent AS ," " bi.receive_illustrate FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID" - " WHERE bi.id = ' :id '"); + " WHERE bi.id = :id "); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -140,6 +170,7 @@ //获取创建任务 -任务单列表 + QListBaseCommonApi::getCatTaskList(QString orderId) { QList result; @@ -380,6 +411,7 @@ QListBaseCommonApi::getCheckDCPower(QString equipment_id,QStringList *headList) { + equipment_id="1693435753272557570"; QList result; QSqlQuery query; query.prepare("SELECT besciddp.id ,besciddp.params,besciddp.unit,resolution,besciddp.urel,besciddp.check_type,datum_point,cycle_number " @@ -407,9 +439,11 @@ } else { qDebug() << "Query execution failed: " << query.lastError().text(); } + *headList <<"序号"<<"核查项目"<<"核查点"<<"单位"<<"分辨力"<<"Urel"<<"核查类型"<<"是否为基准点(1/0)"<<"循环次数" <<"电阻值/频率"<<"电阻值单位/频率单位"<<"核查项备注"; + return result; } //根据id获取装置名称 @@ -436,9 +470,9 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " - " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id " - " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); +bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " + " JOIN sys_dept ON sys_dept.ID = eei.dept_id " + " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); if (isSuccess) { while (query.next()) { TestedDevice testedDevice; @@ -504,9 +538,10 @@ //判断 哪个 装置表 传参 设备id QList BaseCommonApi::getJudgeCalibrationTable(QString id) { + id="1716997603953311746"; QList result; QSqlQuery query; - query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = ':id')"); + query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = :id )"); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -526,12 +561,55 @@ return result; } +//标准装置字典类型 +/** + * 多功能校准源标准装置 = 1 + * 直流稳压电源检定装置 = 2 + * 多功能电气安全校准器标准装置 = 3 + * 0.02级活塞式压力计标准装置 = 4 + * 二等铂电阻温度计标准装置 = 5 + * 安全阀校验装置 = 6 + * 精密露点仪标准装置 = 7 + * E2等级砝码标准装置 = 8 + * 频谱分析仪标准装置 = 9 + * 信号发生器标准装置 = 10 + * 微波衰减标准装置 = 11 + * 频率短期稳定度标准装置 =12 + * 示波器标准装置 = 13 + * 铯原子频率标准装置 =14 + * 小功率标准装置 = 15 + * 低频信号发生器标准装置 = 16 + * S参数标准装置 = 17 + * 失真度标准装置 = 18 + */ +//根据被检设备ID获取当前设备的 核查项目及核查点 + +QList BaseCommonApi::Search_CalibrationTable(QString DeiverId,QStringList *HeadList) +{ + + QList DataList; + DataList.clear(); + QList CliTable=BaseCommonApi::getJudgeCalibrationTable(DeiverId); + if(CliTable.count()==0)return DataList; + switch (CliTable[0].belong_standard_equipment.toInt()) + { + case 1: + + //CliTable[0].item_category_id + DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList); + break; + } + + return DataList; +} //被检设备管理-检定项目及检定点-多功能校准源 -QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) +QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) { -QList result; +QList resultData; +QStringList result; +resultData.clear(); QSqlQuery query; query.prepare("SELECT bbdmidc.id ,bbdmidc.params ,bbdmidc.capacity ,bbdmidc.unit ,bbdmidc.frequency , bbdmidc.range_range , bbdmidc.standard_value , bbdmidc.resolution , bbdmidc.maximum_error , bbdmidc.error_param_a , bbdmidc.error_param_b " @@ -542,26 +620,24 @@ if (query.exec()) { while (query.next()) { - VerMultiCal calibration; - calibration.id = query.value("id").toString(); - calibration.params = query.value("params").toString(); - calibration.capacity = query.value("capacity").toString(); - calibration.unit = query.value("unit").toString(); - calibration.frequency = query.value("frequency").toString(); - calibration.range_range = query.value("range_range").toString(); - calibration.standard_value = query.value("standard_value").toString(); - calibration.resolution = query.value("resolution").toString(); - calibration.maximum_error = query.value("maximum_error").toString(); - calibration.error_param_a = query.value("error_param_a").toString(); - calibration.error_param_b = query.value("error_param_b").toString(); - - result.append(calibration); + result.clear(); + result.append(query.value("id").toString()); + result.append(query.value("params").toString()); + result.append(query.value("capacity").toString()); + result.append(query.value("unit").toString()); + result.append(query.value("frequency").toString()); + result.append(query.value("range_range").toString()); + result.append(query.value("standard_value").toString()); + result.append(query.value("resolution").toString()); + result.append(query.value("maximum_error").toString()); + result.append(query.value("error_param_a").toString()); + result.append(query.value("error_param_b").toString()); + resultData.append(result); } } else { qDebug() << "Query execution failed: " << query.lastError().text(); } - *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; - return result; + *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; } //检定数据管理 首页 @@ -757,7 +833,7 @@ " LEFT JOIN biz_equipment_standard_check_info besci ON besci.item_category_id = bescidc.item_category_id " " WHERE bescidc.equipment_id = :equipment_id "); - // 将参数绑定到占位符 '1692796512381222914' + // 将参数绑定到占位符 1692796512381222914 query.bindValue(":equipment_id", equipment_id); if (query.exec()) { while (query.next()) { @@ -788,12 +864,13 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " + bool isSuccess = query.exec("SELECT brtf.id,brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " " FROM biz_resource_technique_file brtf"); if (isSuccess) { while (query.next()) { Technique_File file; + file.id=query.value("id").toString(); file.file_distribute_no = query.value("file_distribute_no").toString(); file.file_name = query.value("file_name").toString(); file.version_no = query.value("version_no").toString(); @@ -876,7 +953,7 @@ QList result; QSqlQuery query; query.prepare("SELECT id,device_id ,communication_type ,serial_port ,visa ,create_time ,update_time " - "FROM zd_communication_setting WHERE device_id = ' :deviceId '"); + "FROM zd_communication_setting WHERE device_id = :deviceId "); query.bindValue(":deviceId", deviceId); if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h index 1b70cb9..ff8a320 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.h +++ b/softwareDirectory/AutoVerScheme/basecommonapi.h @@ -9,7 +9,7 @@ #include "databaseconnection.h" #include "id\IdWorker.h" - +#include "QStringList" //部门任务 @@ -52,6 +52,7 @@ QDateTime require_over_time; QString deliverer; QString is_urgent; + }; //创建任务单-查看任务单 class CatTask @@ -241,9 +242,15 @@ QString belong_standard_equipment; }; +class BaseEntity: public QObject +{ + Q_OBJECT + public: + +}; //被检设备管理-检定项目及检定点-检定项多功能校准源 -class VerMultiCal +class VerMultiCal:public BaseEntity { public: QString id; @@ -365,6 +372,7 @@ class Technique_File { public: + QString id; QString file_distribute_no; QString file_name; QString version_no; @@ -444,12 +452,22 @@ public: BaseCommonApi(); + // + static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList); + //部门任务 + static QList getAllData(); + //部门任务 参数登录用户的id static QList getAllData(QString userId); + //我的任务 static QList getMyTasks(QString id); //获取创建任务首页数据 - static QListgetCreateTaskList(QString id); + + static QListgetCreateTaskList(QString userId); + + + //创建任务-查看任务单顶部 static QListgetCatTask(QString orderNo); //创建任务-查看任务列表底部 @@ -479,7 +497,10 @@ //判断 哪个 装置表 传参 设备id 返回itemId static QList getJudgeCalibrationTable(QString id); //被检设备管理-检定项目及检定点-多功能校准源 - static QList getVerMultiCal(QString itemId,QStringList *headList); + + + static QList getVerMultiCal(QString itemId,QStringList *headList); + // 获取检定数据管理 首页 static QList getVerificationData(); // 检定数据管理-检定基本信息 @@ -494,6 +515,7 @@ static QList getCheckDataManageResultManageMult(QString equipment_id); //技术文件 static QList getTechnique_File(); + //检定程序管理首页查询 static QList getVerificationProgramInfoMain(); //检定程序管理 编辑 @@ -525,7 +547,6 @@ IdWorker &idWorker = Singleton::instance(); //自动检定 - }; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp index c3b2786..70148f4 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp @@ -4,6 +4,7 @@ #include "basecommonapi.h" //#include "tested_device_manage_serve.h" +#include "QStringList" //被检设备 BeExamined_DeviceItem::BeExamined_DeviceItem(QWidget *parent) : @@ -32,19 +33,32 @@ "}"); // ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); // item->setTextAlignment(Qt::AlignCenter); //ui->tableWidget->setItem(0, 0, item); //设置数据 - + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" + headers << "ID" << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" << "生产厂家"<<"所在单位" <<"使用部门"<<"计量标识"<<"检定周期"<<"证书有效期"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); + //详情页面tableWidgetItem设置 + ui->tableWidgetItem->setStyleSheet("QHeaderView::section {" + "border: 1px solid rgba(197, 196, 196, 1);" + "border-left:none;" + "border-top:none;" + "background-color:white;" + "}"); + + // ui->tableWidget->setRowCount(10); // 设置10行 + //ui->tableWidgetItem->setColumnCount(14); // 设置11列 + ui->tableWidgetItem->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 + ui->tableWidgetItem->verticalHeader()->setParent(nullptr); //隐藏行头 + } void BeExamined_DeviceItem::ShowMessageBox(QString title,QString value) { // 创建一个QMessageBox对象 @@ -64,24 +78,19 @@ } void BeExamined_DeviceItem::Load() { - //获取主页面内容 - //进入主页面 - /* - ui->stackedWidget->setCurrentIndex(0); + // ======================================================================================== + // 主页面初始化 + // ==================================================================================== + + + ui->stackedWidget->setCurrentIndex(0); //先设置为行为0 ui->tableWidget->setRowCount(0); - - - // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BeExamined_DeviceItem dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; int row=0; - QList data = dbManager.getBizDeviceManage(); - - - for (const BizDevice& bizDevice : data) { + QList data = dbManager.getTestedDevice(); + for (const TestedDevice& bizDevice : data) { rowCount = ui->tableWidget->rowCount(); ui->tableWidget->insertRow(rowCount); @@ -89,34 +98,118 @@ ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); ui->tableWidget->setItem(row, 2, new QTableWidgetItem(bizDevice.equipment_name)); ui->tableWidget->setItem(row, 3, new QTableWidgetItem(bizDevice.model)); - ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacture_no)); - ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.help_instruction)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacture_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(bizDevice.FULL_NAME)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(bizDevice.meter_identify)); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem(bizDevice.check_cycle)); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(bizDevice.certificate_valid)); + //添加操作按钮 QPushButton *button = new QPushButton("查看"); - ui->tableWidget->setCellWidget(row, 6, button); + ui->tableWidget->setCellWidget(row, 12, button); //设置按钮简单样式 button->setStyleSheet("QPushButton {" - " border: none; /* 无边框 "*/ - // " color: green; /* 文本颜色 */" - // " text-decoration: underline; /* 文本下划线 */" - // "}"); + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); // 设置鼠标悬停时的光标样式为小手图标 - // button->setCursor(Qt::PointingHandCursor); + button->setCursor(Qt::PointingHandCursor); // 连接按钮的 clicked 信号到自定义槽函数 - // connect(button, &QPushButton::clicked, this, [this, button, row]() { - // 获取当前行第一列的 ID - // QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); - // if (idItem) { - // QString id = idItem->text(); -// - // OnButtonSelectClicked(id); - // } + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); - // }); + OnButtonSelectClicked(id); + } - // row++; - - // } + }); + row++; + } } +void BeExamined_DeviceItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + + DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +//返回按钮 +void BeExamined_DeviceItem::on_pushButton_2_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); +} +void BeExamined_DeviceItem::DeviceInfoInit(QString id) +{ + // ======================================================================================== + // 初始化详情 + // ==================================================================================== + + QList data = dbManager.getTestedCatDevice(id); + for (const TestedCatDevice& testedCatDevice : data) { + + ui->equipment_name->setText(testedCatDevice.equipment_name); + ui->model->setText(testedCatDevice.model); + ui->help_instruction->setText(testedCatDevice.help_instruction); + ui->manufacture_no->setText(testedCatDevice.manufacture_no); + ui->product_country->setText(testedCatDevice.product_country); + ui->manufacturer->setText(testedCatDevice.manufacturer); + ui->product_date->setText(testedCatDevice.product_date); + ui->purchase_date->setText(testedCatDevice.purchase_date); + ui->unit_price->setText(testedCatDevice.unit_price); + ui->usage_status->setText(testedCatDevice.usage_status); + ui->quality_condition->setText(testedCatDevice.quality_condition); + ui->dept_name->setText(testedCatDevice.FULL_NAME); + ui->category->setText(testedCatDevice.category); + ui->check_cycle->setText(testedCatDevice.check_cycle); + ui->level->setText(testedCatDevice.level); + ui->remark->setText(testedCatDevice.remark); + } + + + // ======================================================================================== + // 初始化检定项目及核查点 + // ==================================================================================== + + //获取核查点tablewight的数据 + QStringList headlist; + + QList Data=dbManager.Search_CalibrationTable(id,&headlist); + + //tableWidgetItem + ui->tableWidgetItem->setRowCount(0); + ui->tableWidgetItem->setColumnCount(headlist.count()); + ui->tableWidgetItem->setHorizontalHeaderLabels(headlist); + //循环数据 + int rowCount=0; + int row=0; + ; + for (const QStringList& item : Data) + { + //获取行号 并进行添加行 + rowCount = ui->tableWidgetItem->rowCount(); + ui->tableWidgetItem->insertRow(rowCount); + //添加 序号 + ui->tableWidgetItem->setItem(row, 0, new QTableWidgetItem(QString::number(row+1))); + //循环读取值 headlist,count是列的数量 + for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型 + } + + row++; + + } +} + + + diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h index ffdc22a..0050ee7 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h @@ -21,6 +21,11 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + + void DeviceInfoInit(QString id); + + void on_pushButton_2_clicked(); private: Ui::BeExamined_DeviceItem *ui; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui index ce63879..cdacfaf 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui @@ -215,6 +215,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -225,6 +230,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 @@ -391,7 +401,7 @@ - + ForbiddenCursor @@ -412,7 +422,7 @@ - + ForbiddenCursor @@ -428,12 +438,12 @@ - 出厂编号: + 辅助字段: - + ForbiddenCursor @@ -449,12 +459,12 @@ - 检定有效期: + 出厂编号: - + ForbiddenCursor @@ -475,7 +485,7 @@ - + ForbiddenCursor @@ -496,7 +506,7 @@ - + ForbiddenCursor @@ -517,7 +527,7 @@ - + ForbiddenCursor @@ -538,7 +548,7 @@ - + ForbiddenCursor @@ -552,14 +562,14 @@ - + - 使用年限: + 设备单价: - + ForbiddenCursor @@ -573,14 +583,14 @@ - + - 设备单价: + 使用状态: - + ForbiddenCursor @@ -594,14 +604,14 @@ - + - 使用状态: + 质量状况: - + ForbiddenCursor @@ -615,14 +625,14 @@ - + - 质量状况: + 所在单位: - + ForbiddenCursor @@ -638,12 +648,12 @@ - 所属部门: + 使用部门: - + ForbiddenCursor @@ -657,14 +667,14 @@ - + - 负责人: + 设备分类: - + ForbiddenCursor @@ -678,14 +688,14 @@ - + - 设备供方: + 检定周期: - + ForbiddenCursor @@ -699,14 +709,14 @@ - + - 位置信息: + 重要等级: - + ForbiddenCursor @@ -720,140 +730,14 @@ - - - 设备类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 标准类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 设备分类: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 重要等级: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 检定周期: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 对应开箱记录: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - 备注: - - + + ForbiddenCursor @@ -892,7 +776,7 @@ - + diff --git a/softwareDirectory/AutoVerScheme/create_task.cpp b/softwareDirectory/AutoVerScheme/create_task.cpp index 9b49a1a..ddd78ef 100644 --- a/softwareDirectory/AutoVerScheme/create_task.cpp +++ b/softwareDirectory/AutoVerScheme/create_task.cpp @@ -2,12 +2,15 @@ #include "ui_create_task.h" #include "QMessageBox" + + QString Create_Task::State=""; Create_Task::Create_Task(QWidget *parent) : InfoBase(parent), ui(new Ui::Create_Task) { ui->setupUi(this); this->initForm(); + } Create_Task::~Create_Task() @@ -25,17 +28,19 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(8); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(9); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "任务单编号" << "委托方"<< "使用部门" << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; + headers <<"ID"<< "序号" << "任务单编号" << "委托方"<< "使用部门" + << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); //ShowMessageBox("标题","初始化完成"); } @@ -57,5 +62,171 @@ } void Create_Task::Load() { - //ShowMessageBox("创建任务界面","创建任务界面初始化完成"); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + + QList data = BaseCommonApi::getCreateTaskList(""); + + int rowCount = 0; + int row=0; + QString is_urgent; + for (const CreateTaskList& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.order_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.customer_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.DEPT_FULL_NAME)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.require_over_time.toString())); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.deliverer)); + if(item.is_urgent=="1") + is_urgent="是"; + else + is_urgent="否"; + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(is_urgent)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("查看"); + QPushButton *button2 = new QPushButton("编辑"); + QPushButton *button3 = new QPushButton("删除"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + Create_Task::State="Select"; + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonUpdateClicked(id); + Create_Task::State="Update"; + } + + }); + //设置按钮3简单样式 + button3->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: red; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button3->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button3, &QPushButton::clicked, this, [this, button3, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtoDeleteClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->addWidget(button3); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 8, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void Create_Task::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + HiddenButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "查看按钮ID",id); +} +void Create_Task::OnButtonUpdateClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "编辑按钮ID",id); +} +void Create_Task::OnButtoDeleteClicked(QString id) +{ + // ======================================================================================== + // 删除按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + + QMessageBox::information(this, "删除按钮ID",id); +} + +void Create_Task::on_pushButton_2_clicked() +{ + // ======================================================================================== + // 创建任务单按钮 + // ==================================================================================== + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + Create_Task::State="Create"; +} +void Create_Task::HiddenButton() +{ + ui->SaveButton->hide(); + ui->CreateButton->hide(); + ui->ScanButton->hide(); + ui->deletebutton->hide(); +} +void Create_Task::DisplayButton() +{ + ui->SaveButton->show(); + ui->CreateButton->show(); + ui->ScanButton->show(); + ui->deletebutton->show(); +} + +void Create_Task::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/create_task.h b/softwareDirectory/AutoVerScheme/create_task.h index 7cf383f..6b67c7c 100644 --- a/softwareDirectory/AutoVerScheme/create_task.h +++ b/softwareDirectory/AutoVerScheme/create_task.h @@ -16,11 +16,22 @@ explicit Create_Task(QWidget *parent = nullptr); ~Create_Task(); + //全局静态变量 + static QString State; private slots: void initForm(); //初始化界面数据 void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonUpdateClicked(QString id); + void OnButtoDeleteClicked(QString id); + void on_pushButton_2_clicked(); + void HiddenButton(); + void DisplayButton(); + + void on_pushButton_clicked(); + private: Ui::Create_Task *ui; }; diff --git a/softwareDirectory/AutoVerScheme/create_task.ui b/softwareDirectory/AutoVerScheme/create_task.ui index d9d88ed..b45af33 100644 --- a/softwareDirectory/AutoVerScheme/create_task.ui +++ b/softwareDirectory/AutoVerScheme/create_task.ui @@ -19,278 +19,651 @@ - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 1 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 任务单编号: - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - 委托方: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 使用部门: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 要求完成时间: - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(3, 58, 132); + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 任务单编号: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 委托方: + + + + + + + + + + 使用部门: + + + + + + + + + + 要求检完时间: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); color:white; - - - 查询 - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(207, 132, 33); + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); color:white; - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - 6 + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + 3 + + + + + + 50 + 40 + + + + + 100 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 创建任务单 + + + + + + + + + + + + + + + + + + + + + color:black; - - 9 - - - 9 - - - 9 - - - - - - 0 - 0 - - - - - 120 - 40 - - - - OpenHandCursor - - - Qt::DefaultContextMenu - - - Qt::RightToLeft - - - false - - - background-color:rgb(9, 89, 179); + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 创建任务单 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 保存 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; color:white; - - - 创建任务单 - - - true - - - - - - - - - - - - - - SizeVerCursor - - - - - - - + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接人: + + + + + + + 要求检完时间: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 是否加急: + + + + + + + 电话: + + + + + + + 委托方: + + + + + + + 任务单编号: + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接时间: + + + + + + + 送检人: + + + + + + + 接收说明: + + + + + + + 使用部门: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + 任务单列表: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 扫描增加 + + + false + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 增加行 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 删除行 + + + + + + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/depar_task.ui b/softwareDirectory/AutoVerScheme/depar_task.ui index efb7561..f44829d 100644 --- a/softwareDirectory/AutoVerScheme/depar_task.ui +++ b/softwareDirectory/AutoVerScheme/depar_task.ui @@ -213,86 +213,6 @@ - - - 12 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - diff --git a/softwareDirectory/AutoVerScheme/infomanageview.ui b/softwareDirectory/AutoVerScheme/infomanageview.ui index ef0b87b..cb76a28 100644 --- a/softwareDirectory/AutoVerScheme/infomanageview.ui +++ b/softwareDirectory/AutoVerScheme/infomanageview.ui @@ -20,7 +20,7 @@ color:black; background-color:rgba(240, 240, 240, 1); - + 0 @@ -37,77 +37,124 @@ 0 - - - - 0 - 0 - - - - - 170 - 0 - - - - - 16777215 - 16777215 - - + - color:White; - font-weight: bold; - font-size: 16px; -background-color:rgba(10, 15, 92, 1); + border-image: url(:/image/Index/u15.png); - - true - - - - - 0 - 0 - 170 - 625 - - - - - 0 - 0 - - - - - 170 - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - + + + + + + 50 + 50 + + + + + 35 + 35 + + + + image: url(:/image/Index/u2158.svg); + + + + + + + + + + color:white; +font-size:18px; +font-weight:bold; + + + 信息管理 + + + + - + + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 16777215 + 16777215 + + + + color:White; + font-weight: bold; + font-size: 16px; +background-color:rgba(10, 15, 92, 1); + + + true + + + + + 0 + 0 + 170 + 570 + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp index efc00ba..eea27f0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp @@ -25,17 +25,17 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 - + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0,0); //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "出厂编号" + headers <<"ID"<< "序号" << "设备名称" << "型号规则" << "出厂编号" <<"核查件名称"<<"核查件型号"<<"核查件编号" <<"核查员" << "核查日期" <<"实验室"<<"部门"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); @@ -58,5 +58,114 @@ } void InspectDataItem::Load() { - //ShowMessageBox("核查数据","核查数据"); + // ======================================================================================== + // 主页面初始化 核查管理初始化 + // ==================================================================================== + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + // 调用数据库管理器的函数获取数据 + int rowCount=0; + int row=0; + QList data = dbManager.getCheckData(); + for (const CheckData& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.equipment_name)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.model)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.manufacture_no)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.meter_standard_name)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(item.meter_standard_id)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(item.create_user_name)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(item.check_date.toString())); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(item.dept_name)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("详情"); + QPushButton *button2 = new QPushButton("预览"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonPreViewtClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 12, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void InspectDataItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +void InspectDataItem::OnButtonPreViewtClicked(QString id) +{ + // ======================================================================================== + // 预览按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} + +void InspectDataItem::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.h b/softwareDirectory/AutoVerScheme/inspectdataitem.h index bdf7066..6644339 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.h +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.h @@ -20,6 +20,10 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonPreViewtClicked(QString id); + void on_pushButton_clicked(); + private: Ui::InspectDataItem *ui; }; diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.ui b/softwareDirectory/AutoVerScheme/inspectdataitem.ui index 86786c9..3f319c0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.ui +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.ui @@ -7,232 +7,928 @@ 0 0 1362 - 543 + 553 Form - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 0 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 设备名称: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 型号规则: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 出厂编号: - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 核查员: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 核查日期: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 实验室: - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - Qt::RightToLeft - - - 查询 - - - - - - - Qt::RightToLeft - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - - - - - - - - - - + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 设备名称: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 型号规则: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 出厂编号: + + + + + + + + 0 + 0 + + + + + + + + 核查员: + + + + + + + + + + 实验室: + + + + + + + + + + 核查日期: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + + + + + + + + + + + + + + + + + color:black; + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 核查数据详情 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; +color:white; + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + 设备基本信息: + + + + + + + 设备名称: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 型号规格: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 出厂编号: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定有效期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产国家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产厂家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 购进日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用年限: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备单价: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用状态: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 质量状况: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 所属部门: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 负责人: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备供方: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 位置信息: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 标准类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备分类: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 重要等级: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定周期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 对应开箱记录: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 备注: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + 3 + + + false + + + Qt::LogicalMoveStyle + + + + + + + + + + + + + + + + 核查项目及核查点: + + + + + + + + + + + + + + 0 + 0 + + + + + 30 + 0 + + + + + + + + + + false + + + + 6 + + + 0 + + + 0 + + + 0 + + + 6 + + + + + 检定项备注: + + + + + + + background-color: #f0f0f0; +color: grey; + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/my_task.ui b/softwareDirectory/AutoVerScheme/my_task.ui index a078840..e04a336 100644 --- a/softwareDirectory/AutoVerScheme/my_task.ui +++ b/softwareDirectory/AutoVerScheme/my_task.ui @@ -157,6 +157,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -167,6 +172,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 diff --git a/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg b/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg new file mode 100644 index 0000000..fd249e0 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/softwareDirectory/AutoVerScheme/res/res.qrc b/softwareDirectory/AutoVerScheme/res/res.qrc index a0eac47..05edcdc 100644 --- a/softwareDirectory/AutoVerScheme/res/res.qrc +++ b/softwareDirectory/AutoVerScheme/res/res.qrc @@ -44,7 +44,11 @@ image/Index/u7488.svg image/Index/u7491.svg image/Index/u7538.svg +<<<<<<< HEAD image/Index/u2324.svg image/Index/u2325.svg +======= + image/Index/u2158.svg +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c diff --git a/softwareDirectory/AutoVerScheme/rulefileitem.cpp b/softwareDirectory/AutoVerScheme/rulefileitem.cpp index 095165e..9361752 100644 --- a/softwareDirectory/AutoVerScheme/rulefileitem.cpp +++ b/softwareDirectory/AutoVerScheme/rulefileitem.cpp @@ -27,17 +27,17 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(9); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(10); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + ui->tableWidget->setColumnWidth(0, 0); //设置数据 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "文件号" << "文件名称" << "版本号" << "文件类型"<< "颁布时间" + headers <<"ID"<< "序号" << "文件号" << "文件名称" << "版本号" << "文件类型"<< "颁布时间" << "实施时间" <<"备注"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); } @@ -58,6 +58,106 @@ msgBox.exec(); } void RuleFileItem::Load() +{// ======================================================================================== + // 主页面初始化 技术文件初始化 + // ==================================================================================== + ui->tableWidget->setRowCount(0); + + //先设置为行为0 + ui->tableWidget->setRowCount(0); + // 调用数据库管理器的函数获取数据 + int rowCount=0; + int row=0; + QList data = dbManager.getTechnique_File(); + for (const Technique_File& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.file_distribute_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.file_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.version_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.active_date.toString())); + ui->tableWidget->setItem(row, 7, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(item.remark)); + + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("详情"); + QPushButton *button2 = new QPushButton("预览"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonPreViewtClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 9, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void RuleFileItem::OnButtonSelectClicked(QString id) { - //ShowMessageBox("技术文件","技术文件初始化完成"); + // ======================================================================================== + // 详情按钮 点击事件 进入详情页面 + // ==================================================================================== + + QMessageBox::information(this, "详情按钮ID",id); +} +void RuleFileItem::OnButtonPreViewtClicked(QString id) +{ + // ======================================================================================== + // 下载按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "下载按钮ID",id); } diff --git a/softwareDirectory/AutoVerScheme/rulefileitem.h b/softwareDirectory/AutoVerScheme/rulefileitem.h index d892a71..b544722 100644 --- a/softwareDirectory/AutoVerScheme/rulefileitem.h +++ b/softwareDirectory/AutoVerScheme/rulefileitem.h @@ -20,6 +20,8 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonPreViewtClicked(QString id); private: Ui::RuleFileItem *ui; }; diff --git a/softwareDirectory/AutoVerScheme/rulefileitem.ui b/softwareDirectory/AutoVerScheme/rulefileitem.ui index 9144b96..4763c13 100644 --- a/softwareDirectory/AutoVerScheme/rulefileitem.ui +++ b/softwareDirectory/AutoVerScheme/rulefileitem.ui @@ -108,6 +108,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -118,6 +123,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 diff --git a/softwareDirectory/AutoVerScheme/standard_deviceitem.cpp b/softwareDirectory/AutoVerScheme/standard_deviceitem.cpp index 456b1aa..3489d64 100644 --- a/softwareDirectory/AutoVerScheme/standard_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/standard_deviceitem.cpp @@ -91,9 +91,7 @@ ui->tableWidget->setRowCount(0); // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BaseCommonApi dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; @@ -156,7 +154,7 @@ { - BaseCommonApi dbManager; + QList data = dbManager.getCatDeviceInfor(id); // 获取当前日期 使用年限=当前日期减去购进日期 @@ -203,8 +201,8 @@ //获取核查点tablewight的数据 QStringList headlist; - QString DeviceName = BaseCommonApi::getApparatus(id); - QList bizDeviceManageData=dbManager.getCheckDCPower(DeviceName,&headlist); + //QString DeviceName = BaseCommonApi::getApparatus(id); + QList bizDeviceManageData=dbManager.getCheckDCPower(id,&headlist); //QList bizDeviceManageData = BaseCommonApi::getCheckDCPower(id); //设置tablewight ui->tableWidgetItem->setRowCount(0); diff --git a/softwareDirectory/AutoVerScheme/standard_deviceitem.ui b/softwareDirectory/AutoVerScheme/standard_deviceitem.ui index 4416771..ba62a28 100644 --- a/softwareDirectory/AutoVerScheme/standard_deviceitem.ui +++ b/softwareDirectory/AutoVerScheme/standard_deviceitem.ui @@ -32,7 +32,7 @@ - 1 + 0 @@ -180,6 +180,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -190,6 +195,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 diff --git a/softwareDirectory/AutoVerScheme/testdataitem.cpp b/softwareDirectory/AutoVerScheme/testdataitem.cpp index 5666404..08c3200 100644 --- a/softwareDirectory/AutoVerScheme/testdataitem.cpp +++ b/softwareDirectory/AutoVerScheme/testdataitem.cpp @@ -26,17 +26,17 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(14); // 设置11列 + // ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(15); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 - + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0,0); //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" + headers <<"ID" << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" << "生产厂家"<<"委托单位" <<"使用部门"<< "检定员"<< "检定时间" <<"检定有效期"<<"计量标识"<<"限用说明"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); @@ -59,5 +59,117 @@ } void TestDataItem::Load() { - //ShowMessageBox("检定","检定管理初始化完成"); + + + // ======================================================================================== + // 主页面初始化 检定管理初始化 + // ==================================================================================== + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + // 调用数据库管理器的函数获取数据 + int rowCount=0; + int row=0; + QList data = dbManager.getVerificationData(); + for (const VerificationData& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.sample_name)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.model)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.help_instruction)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.manufacture_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.manufacturer)); + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(item.customer_name)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(item.FULL_NAME)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(item.NAME)); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem(item.trace_date.toString())); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(item.measure_valid_date.toString())); + ui->tableWidget->setItem(row, 12, new QTableWidgetItem(item.meter_identify)); + ui->tableWidget->setItem(row, 13, new QTableWidgetItem(item.restriction_instruction)); + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("详情"); + QPushButton *button2 = new QPushButton("预览"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonPreViewtClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 14, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void TestDataItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +void TestDataItem::OnButtonPreViewtClicked(QString id) +{ + // ======================================================================================== + // 预览按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} + +void TestDataItem::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/testdataitem.h b/softwareDirectory/AutoVerScheme/testdataitem.h index 2e0563c..4e5a793 100644 --- a/softwareDirectory/AutoVerScheme/testdataitem.h +++ b/softwareDirectory/AutoVerScheme/testdataitem.h @@ -20,6 +20,9 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void on_pushButton_clicked(); + void OnButtonPreViewtClicked(QString id); private: Ui::TestDataItem *ui; }; diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user index 9831b40..5effbc0 100644 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user +++ b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user @@ -1,10 +1,14 @@ +<<<<<<< HEAD +======= + +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c EnvironmentId - {2746248a-b112-4e0f-9ae0-9e61f2a42309} + {c08df58c-84a7-4965-bca6-e98789474efa} ProjectExplorer.Project.ActiveTarget @@ -55,275 +59,15 @@ ProjectExplorer.Project.PluginSettings - - true - true - true - true - - 0 - true -fno-delayed-template-parsing true - - true - Builtin.TidyAndClazy - 4 - - - - true - ProjectExplorer.Project.Target.0 - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - Desktop Qt 5.14.2 MinGW 32-bit Desktop Qt 5.14.2 MinGW 32-bit qt.qt5.5142.win32_mingw73_kit @@ -331,7 +75,7 @@ 0 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug true @@ -379,7 +123,7 @@ 2 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release true @@ -427,7 +171,7 @@ 0 - D:/dev/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile true @@ -547,14 +291,257 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/dev/software/softwareDirectory/AutoVerScheme/AutoVerScheme.pro + + ProjectExplorer.CustomExecutableRunConfiguration + false false true - true + false + false + true + + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Desktop Qt 5.14.2 MinGW 64-bit + Desktop Qt 5.14.2 MinGW 64-bit + qt.qt5.5142.win64_mingw73_kit + 0 + 0 + 0 + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug + + + true + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + false + false + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + C:/Users/admin/Desktop/SVN/software/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile + + + true + QtProjectManager.QMakeBuildStep + true + + false + true + true + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + false + true false false true diff --git a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a b/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a deleted file mode 100644 index 742ac25..0000000 --- a/softwareDirectory/AutoVerScheme/AutoVerScheme.pro.user.94e4c4a +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - EnvironmentId - {94e4c4a1-54d4-412c-b108-da01d63f0d97} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - -fno-delayed-template-parsing - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.2 MinGW 32-bit - Desktop Qt 5.14.2 MinGW 32-bit - qt.qt5.5142.win32_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - D:/work/code/BJJZ/svntest/softwareDirectory/AutoVerScheme/AutoVerScheme.pro - - false - - false - true - true - false - false - true - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_32_bit-Debug - - 1 - - - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.14.2 MinGW 64-bit - Desktop Qt 5.14.2 MinGW 64-bit - qt.qt5.5142.win64_mingw73_kit - 0 - 0 - 0 - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - D:/work/code/BJJZ/svntest/softwareDirectory/build-AutoVerScheme-Desktop_Qt_5_14_2_MinGW_64_bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - - ProjectExplorer.CustomExecutableRunConfiguration - - - false - - false - true - false - false - true - - - - 1 - - - - ProjectExplorer.Project.TargetCount - 2 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/softwareDirectory/AutoVerScheme/InfoBase.h b/softwareDirectory/AutoVerScheme/InfoBase.h index 6dd59f3..bce9609 100644 --- a/softwareDirectory/AutoVerScheme/InfoBase.h +++ b/softwareDirectory/AutoVerScheme/InfoBase.h @@ -4,6 +4,7 @@ #include #include "QStandardItemModel" #include "databaseconnection.h" +#include "basecommonapi.h" ///信号管理页面的基类 所有信息管理页面都继承于InfoBase /// 便于统一管理 所有子类必须实现Load方法 /// 每次按钮点击切换都会调用Load方法 用于每次页面的数据刷新 @@ -16,7 +17,7 @@ //QStandardItemModel 的实例。这个模型将用于存储和管理数据。 QStandardItemModel *model; //信息管理页面 基类定义Conn对象 - DatabaseConnection *Conn=DatabaseConnection::getInstance(); + BaseCommonApi dbManager; }; #endif // INFOBASE_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index f62915b..6170ee7 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -15,7 +15,7 @@ " FROM biz_business_order_info bi LEft JOIN biz_business_order_sample_relation br ON bi.id = br.order_id " " LEft JOIN eqpt_equipment_info ei ON br.sample_no = ei.equipment_no LEft JOIN sys_dept dept ON ei.dept_id = dept.ID " " LEft JOIN sys_user ON bi.create_user_id = sys_user.ID " - " WHERE sys_user.ID = ' :userId '"); + " WHERE sys_user.ID = :userId"); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -75,6 +75,35 @@ } return result; } + +//获取创建任务首页数据 +QList BaseCommonApi::getCreateTaskList(QString userId) +{ + userId="1640229293790650370"; + QList result; + QSqlQuery query; + query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " + " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " + " WHERE bi.create_user_id = :userId"); + // 将参数绑定到占位符 + query.bindValue(":userId", userId); + if (query.exec()) { + while (query.next()) { + CreateTaskList task; + task.id = query.value("id").toString(); + task.order_no = query.value("order_no").toString(); + task.customer_name = query.value("customer_name").toString(); + task.DEPT_FULL_NAME = query.value("FULL_NAME").toString(); + task.require_over_time = query.value("require_over_time").toDateTime(); + task.deliverer = query.value("deliverer").toString(); + task.is_urgent = query.value("is_urgent").toString(); + result.append(task); + } + } else { + qDebug() << "Query execution failed: " << query.lastError().text(); + } + return result; +} //获取创建任务首页数据 QListgetCreateTaskList(QString userId) { @@ -82,7 +111,7 @@ QSqlQuery query; query.prepare("SELECT bi.id,bi.order_no,bi.customer_name,dept.FULL_NAME,bi.require_over_time,bi.deliverer,bi.is_urgent " " FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID " - " WHERE bi.create_user_id = ':userId' "); + " WHERE bi.create_user_id = :userId "); // 将参数绑定到占位符 query.bindValue(":userId", userId); if (query.exec()) { @@ -103,6 +132,7 @@ return result; } + //创建任务单-查看/编辑 顶部数据 传参该条数据的id QListBaseCommonApi::getCatTask(QString id) { @@ -111,7 +141,7 @@ query.prepare("SELECT bi.order_no ,bi.customer_name ,dept.FULL_NAME ,bi.require_over_time ," " bi.deliverer ,bi.deliverer_tel ,bi.undertaker_name ,bi.undertake_time , bi.is_urgent AS ," " bi.receive_illustrate FROM biz_business_order_info bi LEFT JOIN sys_dept dept ON bi.customer_id = dept.ID" - " WHERE bi.id = ' :id '"); + " WHERE bi.id = :id "); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -140,6 +170,7 @@ //获取创建任务 -任务单列表 + QListBaseCommonApi::getCatTaskList(QString orderId) { QList result; @@ -380,6 +411,7 @@ QListBaseCommonApi::getCheckDCPower(QString equipment_id,QStringList *headList) { + equipment_id="1693435753272557570"; QList result; QSqlQuery query; query.prepare("SELECT besciddp.id ,besciddp.params,besciddp.unit,resolution,besciddp.urel,besciddp.check_type,datum_point,cycle_number " @@ -407,9 +439,11 @@ } else { qDebug() << "Query execution failed: " << query.lastError().text(); } + *headList <<"序号"<<"核查项目"<<"核查点"<<"单位"<<"分辨力"<<"Urel"<<"核查类型"<<"是否为基准点(1/0)"<<"循环次数" <<"电阻值/频率"<<"电阻值单位/频率单位"<<"核查项备注"; + return result; } //根据id获取装置名称 @@ -436,9 +470,9 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " - " LEFT JOIN sys_dept ON sys_dept.ID = eei.dept_id " - " LEFT JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); +bool isSuccess = query.exec("SELECT eei.id ,eei.equipment_name ,eei.model ,eei.help_instruction ,eei.manufacture_no ,eei.manufacturer ,bboi.customer_name ,sys_dept.FULL_NAME ,eei.meter_identify ,eei.check_cycle ,eei.certificate_valid from eqpt_equipment_info eei " + " JOIN sys_dept ON sys_dept.ID = eei.dept_id " + " JOIN biz_business_order_info bboi ON bboi.customer_id = eei.company_id"); if (isSuccess) { while (query.next()) { TestedDevice testedDevice; @@ -504,9 +538,10 @@ //判断 哪个 装置表 传参 设备id QList BaseCommonApi::getJudgeCalibrationTable(QString id) { + id="1716997603953311746"; QList result; QSqlQuery query; - query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = ':id')"); + query.prepare("SELECT id,belong_standard_equipment FROM biz_business_device_measure_item_info bbdmii WHERE bbdmii.device_model_id =(SELECT eei.model_id from eqpt_equipment_info eei WHERE eei.id = :id )"); // 将参数绑定到占位符 query.bindValue(":id", id); if (query.exec()) { @@ -526,12 +561,55 @@ return result; } +//标准装置字典类型 +/** + * 多功能校准源标准装置 = 1 + * 直流稳压电源检定装置 = 2 + * 多功能电气安全校准器标准装置 = 3 + * 0.02级活塞式压力计标准装置 = 4 + * 二等铂电阻温度计标准装置 = 5 + * 安全阀校验装置 = 6 + * 精密露点仪标准装置 = 7 + * E2等级砝码标准装置 = 8 + * 频谱分析仪标准装置 = 9 + * 信号发生器标准装置 = 10 + * 微波衰减标准装置 = 11 + * 频率短期稳定度标准装置 =12 + * 示波器标准装置 = 13 + * 铯原子频率标准装置 =14 + * 小功率标准装置 = 15 + * 低频信号发生器标准装置 = 16 + * S参数标准装置 = 17 + * 失真度标准装置 = 18 + */ +//根据被检设备ID获取当前设备的 核查项目及核查点 + +QList BaseCommonApi::Search_CalibrationTable(QString DeiverId,QStringList *HeadList) +{ + + QList DataList; + DataList.clear(); + QList CliTable=BaseCommonApi::getJudgeCalibrationTable(DeiverId); + if(CliTable.count()==0)return DataList; + switch (CliTable[0].belong_standard_equipment.toInt()) + { + case 1: + + //CliTable[0].item_category_id + DataList=BaseCommonApi::getVerMultiCal("1717086652508487681",HeadList); + break; + } + + return DataList; +} //被检设备管理-检定项目及检定点-多功能校准源 -QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) +QList BaseCommonApi::getVerMultiCal(QString itemId,QStringList *headList) { -QList result; +QList resultData; +QStringList result; +resultData.clear(); QSqlQuery query; query.prepare("SELECT bbdmidc.id ,bbdmidc.params ,bbdmidc.capacity ,bbdmidc.unit ,bbdmidc.frequency , bbdmidc.range_range , bbdmidc.standard_value , bbdmidc.resolution , bbdmidc.maximum_error , bbdmidc.error_param_a , bbdmidc.error_param_b " @@ -542,26 +620,24 @@ if (query.exec()) { while (query.next()) { - VerMultiCal calibration; - calibration.id = query.value("id").toString(); - calibration.params = query.value("params").toString(); - calibration.capacity = query.value("capacity").toString(); - calibration.unit = query.value("unit").toString(); - calibration.frequency = query.value("frequency").toString(); - calibration.range_range = query.value("range_range").toString(); - calibration.standard_value = query.value("standard_value").toString(); - calibration.resolution = query.value("resolution").toString(); - calibration.maximum_error = query.value("maximum_error").toString(); - calibration.error_param_a = query.value("error_param_a").toString(); - calibration.error_param_b = query.value("error_param_b").toString(); - - result.append(calibration); + result.clear(); + result.append(query.value("id").toString()); + result.append(query.value("params").toString()); + result.append(query.value("capacity").toString()); + result.append(query.value("unit").toString()); + result.append(query.value("frequency").toString()); + result.append(query.value("range_range").toString()); + result.append(query.value("standard_value").toString()); + result.append(query.value("resolution").toString()); + result.append(query.value("maximum_error").toString()); + result.append(query.value("error_param_a").toString()); + result.append(query.value("error_param_b").toString()); + resultData.append(result); } } else { qDebug() << "Query execution failed: " << query.lastError().text(); } - *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; - return result; + *headList<<"序号"<<"参数"<<"量"<<"单位"<<"频率"<<"量程"<<"标准值"<<"分辨力"<<"最大允许误差"<<"误差参数a"<<"误差参数b"; } //检定数据管理 首页 @@ -757,7 +833,7 @@ " LEFT JOIN biz_equipment_standard_check_info besci ON besci.item_category_id = bescidc.item_category_id " " WHERE bescidc.equipment_id = :equipment_id "); - // 将参数绑定到占位符 '1692796512381222914' + // 将参数绑定到占位符 1692796512381222914 query.bindValue(":equipment_id", equipment_id); if (query.exec()) { while (query.next()) { @@ -788,12 +864,13 @@ { QList result; QSqlQuery query; - bool isSuccess = query.exec("SELECT brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " + bool isSuccess = query.exec("SELECT brtf.id,brtf.file_distribute_no ,brtf.file_name ,brtf.version_no ,brtf.active_date ,brtf.remark " " FROM biz_resource_technique_file brtf"); if (isSuccess) { while (query.next()) { Technique_File file; + file.id=query.value("id").toString(); file.file_distribute_no = query.value("file_distribute_no").toString(); file.file_name = query.value("file_name").toString(); file.version_no = query.value("version_no").toString(); @@ -876,7 +953,7 @@ QList result; QSqlQuery query; query.prepare("SELECT id,device_id ,communication_type ,serial_port ,visa ,create_time ,update_time " - "FROM zd_communication_setting WHERE device_id = ' :deviceId '"); + "FROM zd_communication_setting WHERE device_id = :deviceId "); query.bindValue(":deviceId", deviceId); if (query.exec()) { while (query.next()) { diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h index 1b70cb9..ff8a320 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.h +++ b/softwareDirectory/AutoVerScheme/basecommonapi.h @@ -9,7 +9,7 @@ #include "databaseconnection.h" #include "id\IdWorker.h" - +#include "QStringList" //部门任务 @@ -52,6 +52,7 @@ QDateTime require_over_time; QString deliverer; QString is_urgent; + }; //创建任务单-查看任务单 class CatTask @@ -241,9 +242,15 @@ QString belong_standard_equipment; }; +class BaseEntity: public QObject +{ + Q_OBJECT + public: + +}; //被检设备管理-检定项目及检定点-检定项多功能校准源 -class VerMultiCal +class VerMultiCal:public BaseEntity { public: QString id; @@ -365,6 +372,7 @@ class Technique_File { public: + QString id; QString file_distribute_no; QString file_name; QString version_no; @@ -444,12 +452,22 @@ public: BaseCommonApi(); + // + static QList Search_CalibrationTable(QString DeiverId,QStringList *HeadList); + //部门任务 + static QList getAllData(); + //部门任务 参数登录用户的id static QList getAllData(QString userId); + //我的任务 static QList getMyTasks(QString id); //获取创建任务首页数据 - static QListgetCreateTaskList(QString id); + + static QListgetCreateTaskList(QString userId); + + + //创建任务-查看任务单顶部 static QListgetCatTask(QString orderNo); //创建任务-查看任务列表底部 @@ -479,7 +497,10 @@ //判断 哪个 装置表 传参 设备id 返回itemId static QList getJudgeCalibrationTable(QString id); //被检设备管理-检定项目及检定点-多功能校准源 - static QList getVerMultiCal(QString itemId,QStringList *headList); + + + static QList getVerMultiCal(QString itemId,QStringList *headList); + // 获取检定数据管理 首页 static QList getVerificationData(); // 检定数据管理-检定基本信息 @@ -494,6 +515,7 @@ static QList getCheckDataManageResultManageMult(QString equipment_id); //技术文件 static QList getTechnique_File(); + //检定程序管理首页查询 static QList getVerificationProgramInfoMain(); //检定程序管理 编辑 @@ -525,7 +547,6 @@ IdWorker &idWorker = Singleton::instance(); //自动检定 - }; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp index c3b2786..70148f4 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.cpp @@ -4,6 +4,7 @@ #include "basecommonapi.h" //#include "tested_device_manage_serve.h" +#include "QStringList" //被检设备 BeExamined_DeviceItem::BeExamined_DeviceItem(QWidget *parent) : @@ -32,19 +33,32 @@ "}"); // ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); // item->setTextAlignment(Qt::AlignCenter); //ui->tableWidget->setItem(0, 0, item); //设置数据 - + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" + headers << "ID" << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" << "生产厂家"<<"所在单位" <<"使用部门"<<"计量标识"<<"检定周期"<<"证书有效期"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); + //详情页面tableWidgetItem设置 + ui->tableWidgetItem->setStyleSheet("QHeaderView::section {" + "border: 1px solid rgba(197, 196, 196, 1);" + "border-left:none;" + "border-top:none;" + "background-color:white;" + "}"); + + // ui->tableWidget->setRowCount(10); // 设置10行 + //ui->tableWidgetItem->setColumnCount(14); // 设置11列 + ui->tableWidgetItem->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 + ui->tableWidgetItem->verticalHeader()->setParent(nullptr); //隐藏行头 + } void BeExamined_DeviceItem::ShowMessageBox(QString title,QString value) { // 创建一个QMessageBox对象 @@ -64,24 +78,19 @@ } void BeExamined_DeviceItem::Load() { - //获取主页面内容 - //进入主页面 - /* - ui->stackedWidget->setCurrentIndex(0); + // ======================================================================================== + // 主页面初始化 + // ==================================================================================== + + + ui->stackedWidget->setCurrentIndex(0); //先设置为行为0 ui->tableWidget->setRowCount(0); - - - // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BeExamined_DeviceItem dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; int row=0; - QList data = dbManager.getBizDeviceManage(); - - - for (const BizDevice& bizDevice : data) { + QList data = dbManager.getTestedDevice(); + for (const TestedDevice& bizDevice : data) { rowCount = ui->tableWidget->rowCount(); ui->tableWidget->insertRow(rowCount); @@ -89,34 +98,118 @@ ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); ui->tableWidget->setItem(row, 2, new QTableWidgetItem(bizDevice.equipment_name)); ui->tableWidget->setItem(row, 3, new QTableWidgetItem(bizDevice.model)); - ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.manufacture_no)); - ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(bizDevice.help_instruction)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(bizDevice.manufacture_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(bizDevice.manufacturer)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(bizDevice.FULL_NAME)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(bizDevice.meter_identify)); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem(bizDevice.check_cycle)); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(bizDevice.certificate_valid)); + //添加操作按钮 QPushButton *button = new QPushButton("查看"); - ui->tableWidget->setCellWidget(row, 6, button); + ui->tableWidget->setCellWidget(row, 12, button); //设置按钮简单样式 button->setStyleSheet("QPushButton {" - " border: none; /* 无边框 "*/ - // " color: green; /* 文本颜色 */" - // " text-decoration: underline; /* 文本下划线 */" - // "}"); + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); // 设置鼠标悬停时的光标样式为小手图标 - // button->setCursor(Qt::PointingHandCursor); + button->setCursor(Qt::PointingHandCursor); // 连接按钮的 clicked 信号到自定义槽函数 - // connect(button, &QPushButton::clicked, this, [this, button, row]() { - // 获取当前行第一列的 ID - // QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); - // if (idItem) { - // QString id = idItem->text(); -// - // OnButtonSelectClicked(id); - // } + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); - // }); + OnButtonSelectClicked(id); + } - // row++; - - // } + }); + row++; + } } +void BeExamined_DeviceItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + + DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +//返回按钮 +void BeExamined_DeviceItem::on_pushButton_2_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); +} +void BeExamined_DeviceItem::DeviceInfoInit(QString id) +{ + // ======================================================================================== + // 初始化详情 + // ==================================================================================== + + QList data = dbManager.getTestedCatDevice(id); + for (const TestedCatDevice& testedCatDevice : data) { + + ui->equipment_name->setText(testedCatDevice.equipment_name); + ui->model->setText(testedCatDevice.model); + ui->help_instruction->setText(testedCatDevice.help_instruction); + ui->manufacture_no->setText(testedCatDevice.manufacture_no); + ui->product_country->setText(testedCatDevice.product_country); + ui->manufacturer->setText(testedCatDevice.manufacturer); + ui->product_date->setText(testedCatDevice.product_date); + ui->purchase_date->setText(testedCatDevice.purchase_date); + ui->unit_price->setText(testedCatDevice.unit_price); + ui->usage_status->setText(testedCatDevice.usage_status); + ui->quality_condition->setText(testedCatDevice.quality_condition); + ui->dept_name->setText(testedCatDevice.FULL_NAME); + ui->category->setText(testedCatDevice.category); + ui->check_cycle->setText(testedCatDevice.check_cycle); + ui->level->setText(testedCatDevice.level); + ui->remark->setText(testedCatDevice.remark); + } + + + // ======================================================================================== + // 初始化检定项目及核查点 + // ==================================================================================== + + //获取核查点tablewight的数据 + QStringList headlist; + + QList Data=dbManager.Search_CalibrationTable(id,&headlist); + + //tableWidgetItem + ui->tableWidgetItem->setRowCount(0); + ui->tableWidgetItem->setColumnCount(headlist.count()); + ui->tableWidgetItem->setHorizontalHeaderLabels(headlist); + //循环数据 + int rowCount=0; + int row=0; + ; + for (const QStringList& item : Data) + { + //获取行号 并进行添加行 + rowCount = ui->tableWidgetItem->rowCount(); + ui->tableWidgetItem->insertRow(rowCount); + //添加 序号 + ui->tableWidgetItem->setItem(row, 0, new QTableWidgetItem(QString::number(row+1))); + //循环读取值 headlist,count是列的数量 + for(int i=1;itableWidgetItem->setItem(row, i, new QTableWidgetItem(item[i])); //核查类型 + } + + row++; + + } +} + + + diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h index ffdc22a..0050ee7 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.h @@ -21,6 +21,11 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + + void DeviceInfoInit(QString id); + + void on_pushButton_2_clicked(); private: Ui::BeExamined_DeviceItem *ui; diff --git a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui index ce63879..cdacfaf 100644 --- a/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui +++ b/softwareDirectory/AutoVerScheme/beexamined_deviceitem.ui @@ -215,6 +215,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -225,6 +230,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 @@ -391,7 +401,7 @@ - + ForbiddenCursor @@ -412,7 +422,7 @@ - + ForbiddenCursor @@ -428,12 +438,12 @@ - 出厂编号: + 辅助字段: - + ForbiddenCursor @@ -449,12 +459,12 @@ - 检定有效期: + 出厂编号: - + ForbiddenCursor @@ -475,7 +485,7 @@ - + ForbiddenCursor @@ -496,7 +506,7 @@ - + ForbiddenCursor @@ -517,7 +527,7 @@ - + ForbiddenCursor @@ -538,7 +548,7 @@ - + ForbiddenCursor @@ -552,14 +562,14 @@ - + - 使用年限: + 设备单价: - + ForbiddenCursor @@ -573,14 +583,14 @@ - + - 设备单价: + 使用状态: - + ForbiddenCursor @@ -594,14 +604,14 @@ - + - 使用状态: + 质量状况: - + ForbiddenCursor @@ -615,14 +625,14 @@ - + - 质量状况: + 所在单位: - + ForbiddenCursor @@ -638,12 +648,12 @@ - 所属部门: + 使用部门: - + ForbiddenCursor @@ -657,14 +667,14 @@ - + - 负责人: + 设备分类: - + ForbiddenCursor @@ -678,14 +688,14 @@ - + - 设备供方: + 检定周期: - + ForbiddenCursor @@ -699,14 +709,14 @@ - + - 位置信息: + 重要等级: - + ForbiddenCursor @@ -720,140 +730,14 @@ - - - 设备类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 标准类型: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 设备分类: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 重要等级: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 检定周期: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - - - - 对应开箱记录: - - - - - - - ForbiddenCursor - - - background-color: #f0f0f0; -color: grey; - - - XXX - - - - 备注: - - + + ForbiddenCursor @@ -892,7 +776,7 @@ - + diff --git a/softwareDirectory/AutoVerScheme/create_task.cpp b/softwareDirectory/AutoVerScheme/create_task.cpp index 9b49a1a..ddd78ef 100644 --- a/softwareDirectory/AutoVerScheme/create_task.cpp +++ b/softwareDirectory/AutoVerScheme/create_task.cpp @@ -2,12 +2,15 @@ #include "ui_create_task.h" #include "QMessageBox" + + QString Create_Task::State=""; Create_Task::Create_Task(QWidget *parent) : InfoBase(parent), ui(new Ui::Create_Task) { ui->setupUi(this); this->initForm(); + } Create_Task::~Create_Task() @@ -25,17 +28,19 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(8); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(9); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0, 0); // 设置第一列的宽度为0 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "任务单编号" << "委托方"<< "使用部门" << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; + headers <<"ID"<< "序号" << "任务单编号" << "委托方"<< "使用部门" + << "要求检完时间" << "送检人"<<"是否加急"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); //ShowMessageBox("标题","初始化完成"); } @@ -57,5 +62,171 @@ } void Create_Task::Load() { - //ShowMessageBox("创建任务界面","创建任务界面初始化完成"); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + + QList data = BaseCommonApi::getCreateTaskList(""); + + int rowCount = 0; + int row=0; + QString is_urgent; + for (const CreateTaskList& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.order_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.customer_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.DEPT_FULL_NAME)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.require_over_time.toString())); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.deliverer)); + if(item.is_urgent=="1") + is_urgent="是"; + else + is_urgent="否"; + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(is_urgent)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("查看"); + QPushButton *button2 = new QPushButton("编辑"); + QPushButton *button3 = new QPushButton("删除"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + Create_Task::State="Select"; + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonUpdateClicked(id); + Create_Task::State="Update"; + } + + }); + //设置按钮3简单样式 + button3->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: red; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button3->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button3, &QPushButton::clicked, this, [this, button3, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtoDeleteClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->addWidget(button3); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 8, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void Create_Task::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 查看按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + HiddenButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "查看按钮ID",id); +} +void Create_Task::OnButtonUpdateClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "编辑按钮ID",id); +} +void Create_Task::OnButtoDeleteClicked(QString id) +{ + // ======================================================================================== + // 删除按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + + QMessageBox::information(this, "删除按钮ID",id); +} + +void Create_Task::on_pushButton_2_clicked() +{ + // ======================================================================================== + // 创建任务单按钮 + // ==================================================================================== + DisplayButton(); + ui->stackedWidget->setCurrentIndex(1); + Create_Task::State="Create"; +} +void Create_Task::HiddenButton() +{ + ui->SaveButton->hide(); + ui->CreateButton->hide(); + ui->ScanButton->hide(); + ui->deletebutton->hide(); +} +void Create_Task::DisplayButton() +{ + ui->SaveButton->show(); + ui->CreateButton->show(); + ui->ScanButton->show(); + ui->deletebutton->show(); +} + +void Create_Task::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/create_task.h b/softwareDirectory/AutoVerScheme/create_task.h index 7cf383f..6b67c7c 100644 --- a/softwareDirectory/AutoVerScheme/create_task.h +++ b/softwareDirectory/AutoVerScheme/create_task.h @@ -16,11 +16,22 @@ explicit Create_Task(QWidget *parent = nullptr); ~Create_Task(); + //全局静态变量 + static QString State; private slots: void initForm(); //初始化界面数据 void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonUpdateClicked(QString id); + void OnButtoDeleteClicked(QString id); + void on_pushButton_2_clicked(); + void HiddenButton(); + void DisplayButton(); + + void on_pushButton_clicked(); + private: Ui::Create_Task *ui; }; diff --git a/softwareDirectory/AutoVerScheme/create_task.ui b/softwareDirectory/AutoVerScheme/create_task.ui index d9d88ed..b45af33 100644 --- a/softwareDirectory/AutoVerScheme/create_task.ui +++ b/softwareDirectory/AutoVerScheme/create_task.ui @@ -19,278 +19,651 @@ - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 1 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 任务单编号: - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - 委托方: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 使用部门: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 要求完成时间: - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(3, 58, 132); + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 任务单编号: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 委托方: + + + + + + + + + + 使用部门: + + + + + + + + + + 要求检完时间: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); color:white; - - - 查询 - - - - - - - - 0 - 30 - - - - Qt::RightToLeft - - - background-color:rgb(207, 132, 33); + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); color:white; - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - 6 + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + 3 + + + + + + 50 + 40 + + + + + 100 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 创建任务单 + + + + + + + + + + + + + + + + + + + + + color:black; - - 9 - - - 9 - - - 9 - - - - - - 0 - 0 - - - - - 120 - 40 - - - - OpenHandCursor - - - Qt::DefaultContextMenu - - - Qt::RightToLeft - - - false - - - background-color:rgb(9, 89, 179); + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 创建任务单 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 保存 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; color:white; - - - 创建任务单 - - - true - - - - - - - - - - - - - - SizeVerCursor - - - - - - - + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接人: + + + + + + + 要求检完时间: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 是否加急: + + + + + + + 电话: + + + + + + + 委托方: + + + + + + + 任务单编号: + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + 承接时间: + + + + + + + 送检人: + + + + + + + 接收说明: + + + + + + + 使用部门: + + + + + + + + + + ForbiddenCursor + + + + + + XXX + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + 任务单列表: + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 扫描增加 + + + false + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 增加行 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 删除行 + + + + + + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/depar_task.ui b/softwareDirectory/AutoVerScheme/depar_task.ui index efb7561..f44829d 100644 --- a/softwareDirectory/AutoVerScheme/depar_task.ui +++ b/softwareDirectory/AutoVerScheme/depar_task.ui @@ -213,86 +213,6 @@ - - - 12 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PushButton - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - diff --git a/softwareDirectory/AutoVerScheme/infomanageview.ui b/softwareDirectory/AutoVerScheme/infomanageview.ui index ef0b87b..cb76a28 100644 --- a/softwareDirectory/AutoVerScheme/infomanageview.ui +++ b/softwareDirectory/AutoVerScheme/infomanageview.ui @@ -20,7 +20,7 @@ color:black; background-color:rgba(240, 240, 240, 1); - + 0 @@ -37,77 +37,124 @@ 0 - - - - 0 - 0 - - - - - 170 - 0 - - - - - 16777215 - 16777215 - - + - color:White; - font-weight: bold; - font-size: 16px; -background-color:rgba(10, 15, 92, 1); + border-image: url(:/image/Index/u15.png); - - true - - - - - 0 - 0 - 170 - 625 - - - - - 0 - 0 - - - - - 170 - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - + + + + + + 50 + 50 + + + + + 35 + 35 + + + + image: url(:/image/Index/u2158.svg); + + + + + + + + + + color:white; +font-size:18px; +font-weight:bold; + + + 信息管理 + + + + - + + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 16777215 + 16777215 + + + + color:White; + font-weight: bold; + font-size: 16px; +background-color:rgba(10, 15, 92, 1); + + + true + + + + + 0 + 0 + 170 + 570 + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp index efc00ba..eea27f0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.cpp +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.cpp @@ -25,17 +25,17 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(12); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(13); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 - + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0,0); //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "出厂编号" + headers <<"ID"<< "序号" << "设备名称" << "型号规则" << "出厂编号" <<"核查件名称"<<"核查件型号"<<"核查件编号" <<"核查员" << "核查日期" <<"实验室"<<"部门"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); @@ -58,5 +58,114 @@ } void InspectDataItem::Load() { - //ShowMessageBox("核查数据","核查数据"); + // ======================================================================================== + // 主页面初始化 核查管理初始化 + // ==================================================================================== + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + // 调用数据库管理器的函数获取数据 + int rowCount=0; + int row=0; + QList data = dbManager.getCheckData(); + for (const CheckData& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.equipment_name)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.model)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.manufacture_no)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.meter_standard_name)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(item.meter_standard_id)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(item.create_user_name)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(item.check_date.toString())); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(item.dept_name)); + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("详情"); + QPushButton *button2 = new QPushButton("预览"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonPreViewtClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 12, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void InspectDataItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +void InspectDataItem::OnButtonPreViewtClicked(QString id) +{ + // ======================================================================================== + // 预览按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} + +void InspectDataItem::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.h b/softwareDirectory/AutoVerScheme/inspectdataitem.h index bdf7066..6644339 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.h +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.h @@ -20,6 +20,10 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonPreViewtClicked(QString id); + void on_pushButton_clicked(); + private: Ui::InspectDataItem *ui; }; diff --git a/softwareDirectory/AutoVerScheme/inspectdataitem.ui b/softwareDirectory/AutoVerScheme/inspectdataitem.ui index 86786c9..3f319c0 100644 --- a/softwareDirectory/AutoVerScheme/inspectdataitem.ui +++ b/softwareDirectory/AutoVerScheme/inspectdataitem.ui @@ -7,232 +7,928 @@ 0 0 1362 - 543 + 553 Form - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 0 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 设备名称: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 型号规则: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 出厂编号: - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 核查员: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 核查日期: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 实验室: - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - Qt::RightToLeft - - - 查询 - - - - - - - Qt::RightToLeft - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - - - - - - - - - - + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 设备名称: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 型号规则: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 出厂编号: + + + + + + + + 0 + 0 + + + + + + + + 核查员: + + + + + + + + + + 实验室: + + + + + + + + + + 核查日期: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + + + + + + + + + + + + + + + + + color:black; + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 核查数据详情 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; +color:white; + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + 设备基本信息: + + + + + + + 设备名称: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 型号规格: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 出厂编号: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定有效期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产国家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产厂家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 购进日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用年限: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备单价: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用状态: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 质量状况: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 所属部门: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 负责人: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备供方: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 位置信息: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 标准类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备分类: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 重要等级: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定周期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 对应开箱记录: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 备注: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + 3 + + + false + + + Qt::LogicalMoveStyle + + + + + + + + + + + + + + + + 核查项目及核查点: + + + + + + + + + + + + + + 0 + 0 + + + + + 30 + 0 + + + + + + + + + + false + + + + 6 + + + 0 + + + 0 + + + 0 + + + 6 + + + + + 检定项备注: + + + + + + + background-color: #f0f0f0; +color: grey; + + + + + + + + + + + diff --git a/softwareDirectory/AutoVerScheme/my_task.ui b/softwareDirectory/AutoVerScheme/my_task.ui index a078840..e04a336 100644 --- a/softwareDirectory/AutoVerScheme/my_task.ui +++ b/softwareDirectory/AutoVerScheme/my_task.ui @@ -157,6 +157,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -167,6 +172,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 diff --git a/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg b/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg new file mode 100644 index 0000000..fd249e0 --- /dev/null +++ b/softwareDirectory/AutoVerScheme/res/image/Index/u2158.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/softwareDirectory/AutoVerScheme/res/res.qrc b/softwareDirectory/AutoVerScheme/res/res.qrc index a0eac47..05edcdc 100644 --- a/softwareDirectory/AutoVerScheme/res/res.qrc +++ b/softwareDirectory/AutoVerScheme/res/res.qrc @@ -44,7 +44,11 @@ image/Index/u7488.svg image/Index/u7491.svg image/Index/u7538.svg +<<<<<<< HEAD image/Index/u2324.svg image/Index/u2325.svg +======= + image/Index/u2158.svg +>>>>>>> bc52a12af274d152af1886225a77a3f12a2d5e6c diff --git a/softwareDirectory/AutoVerScheme/rulefileitem.cpp b/softwareDirectory/AutoVerScheme/rulefileitem.cpp index 095165e..9361752 100644 --- a/softwareDirectory/AutoVerScheme/rulefileitem.cpp +++ b/softwareDirectory/AutoVerScheme/rulefileitem.cpp @@ -27,17 +27,17 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(9); // 设置11列 + //ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(10); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + ui->tableWidget->setColumnWidth(0, 0); //设置数据 //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "文件号" << "文件名称" << "版本号" << "文件类型"<< "颁布时间" + headers <<"ID"<< "序号" << "文件号" << "文件名称" << "版本号" << "文件类型"<< "颁布时间" << "实施时间" <<"备注"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); } @@ -58,6 +58,106 @@ msgBox.exec(); } void RuleFileItem::Load() +{// ======================================================================================== + // 主页面初始化 技术文件初始化 + // ==================================================================================== + ui->tableWidget->setRowCount(0); + + //先设置为行为0 + ui->tableWidget->setRowCount(0); + // 调用数据库管理器的函数获取数据 + int rowCount=0; + int row=0; + QList data = dbManager.getTechnique_File(); + for (const Technique_File& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.file_distribute_no)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.file_name)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.version_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.active_date.toString())); + ui->tableWidget->setItem(row, 7, new QTableWidgetItem("缺少")); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(item.remark)); + + + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("详情"); + QPushButton *button2 = new QPushButton("预览"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonPreViewtClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 9, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void RuleFileItem::OnButtonSelectClicked(QString id) { - //ShowMessageBox("技术文件","技术文件初始化完成"); + // ======================================================================================== + // 详情按钮 点击事件 进入详情页面 + // ==================================================================================== + + QMessageBox::information(this, "详情按钮ID",id); +} +void RuleFileItem::OnButtonPreViewtClicked(QString id) +{ + // ======================================================================================== + // 下载按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "下载按钮ID",id); } diff --git a/softwareDirectory/AutoVerScheme/rulefileitem.h b/softwareDirectory/AutoVerScheme/rulefileitem.h index d892a71..b544722 100644 --- a/softwareDirectory/AutoVerScheme/rulefileitem.h +++ b/softwareDirectory/AutoVerScheme/rulefileitem.h @@ -20,6 +20,8 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void OnButtonPreViewtClicked(QString id); private: Ui::RuleFileItem *ui; }; diff --git a/softwareDirectory/AutoVerScheme/rulefileitem.ui b/softwareDirectory/AutoVerScheme/rulefileitem.ui index 9144b96..4763c13 100644 --- a/softwareDirectory/AutoVerScheme/rulefileitem.ui +++ b/softwareDirectory/AutoVerScheme/rulefileitem.ui @@ -108,6 +108,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -118,6 +123,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 diff --git a/softwareDirectory/AutoVerScheme/standard_deviceitem.cpp b/softwareDirectory/AutoVerScheme/standard_deviceitem.cpp index 456b1aa..3489d64 100644 --- a/softwareDirectory/AutoVerScheme/standard_deviceitem.cpp +++ b/softwareDirectory/AutoVerScheme/standard_deviceitem.cpp @@ -91,9 +91,7 @@ ui->tableWidget->setRowCount(0); // 创建数据库管理器对象 - //BizDeviceManage包含虚方法 指针实例化 - BaseCommonApi dbManager; // 调用数据库管理器的函数获取数据 int rowCount=0; @@ -156,7 +154,7 @@ { - BaseCommonApi dbManager; + QList data = dbManager.getCatDeviceInfor(id); // 获取当前日期 使用年限=当前日期减去购进日期 @@ -203,8 +201,8 @@ //获取核查点tablewight的数据 QStringList headlist; - QString DeviceName = BaseCommonApi::getApparatus(id); - QList bizDeviceManageData=dbManager.getCheckDCPower(DeviceName,&headlist); + //QString DeviceName = BaseCommonApi::getApparatus(id); + QList bizDeviceManageData=dbManager.getCheckDCPower(id,&headlist); //QList bizDeviceManageData = BaseCommonApi::getCheckDCPower(id); //设置tablewight ui->tableWidgetItem->setRowCount(0); diff --git a/softwareDirectory/AutoVerScheme/standard_deviceitem.ui b/softwareDirectory/AutoVerScheme/standard_deviceitem.ui index 4416771..ba62a28 100644 --- a/softwareDirectory/AutoVerScheme/standard_deviceitem.ui +++ b/softwareDirectory/AutoVerScheme/standard_deviceitem.ui @@ -32,7 +32,7 @@ - 1 + 0 @@ -180,6 +180,11 @@ Qt::RightToLeft + + background-color:rgb(3, 58, 132); +color:white; + + 查询 @@ -190,6 +195,11 @@ Qt::RightToLeft + + background-color:rgb(207, 132, 33); +color:white; + + 重置 diff --git a/softwareDirectory/AutoVerScheme/testdataitem.cpp b/softwareDirectory/AutoVerScheme/testdataitem.cpp index 5666404..08c3200 100644 --- a/softwareDirectory/AutoVerScheme/testdataitem.cpp +++ b/softwareDirectory/AutoVerScheme/testdataitem.cpp @@ -26,17 +26,17 @@ "background-color:white;" "}"); - ui->tableWidget->setRowCount(10); // 设置10行 - ui->tableWidget->setColumnCount(14); // 设置11列 + // ui->tableWidget->setRowCount(10); // 设置10行 + ui->tableWidget->setColumnCount(15); // 设置11列 ui->tableWidget->setColumnWidth(0, 80); // 设置第一列的宽度为100像素 ui->tableWidget->verticalHeader()->setParent(nullptr); //隐藏行头 - QTableWidgetItem *item = new QTableWidgetItem("测试数据"); - item->setTextAlignment(Qt::AlignCenter); - ui->tableWidget->setItem(0, 0, item); //设置数据 - + //QTableWidgetItem *item = new QTableWidgetItem("测试数据"); + //item->setTextAlignment(Qt::AlignCenter); + //ui->tableWidget->setItem(0, 0, item); //设置数据 + ui->tableWidget->setColumnWidth(0,0); //初始化TableWidget 设置列 QStringList headers; - headers << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" + headers <<"ID" << "序号" << "设备名称" << "型号规则" << "辅助字段" << "出厂编号" << "生产厂家"<<"委托单位" <<"使用部门"<< "检定员"<< "检定时间" <<"检定有效期"<<"计量标识"<<"限用说明"<<"操作"; ui->tableWidget->setHorizontalHeaderLabels(headers); @@ -59,5 +59,117 @@ } void TestDataItem::Load() { - //ShowMessageBox("检定","检定管理初始化完成"); + + + // ======================================================================================== + // 主页面初始化 检定管理初始化 + // ==================================================================================== + ui->tableWidget->setRowCount(0); + ui->stackedWidget->setCurrentIndex(0); + //先设置为行为0 + ui->tableWidget->setRowCount(0); + // 调用数据库管理器的函数获取数据 + int rowCount=0; + int row=0; + QList data = dbManager.getVerificationData(); + for (const VerificationData& item : data) { + rowCount = ui->tableWidget->rowCount(); + + ui->tableWidget->insertRow(rowCount); + ui->tableWidget->setItem(row, 0, new QTableWidgetItem(item.id)); + ui->tableWidget->setItem(row, 1, new QTableWidgetItem(QString::number(row+1))); + ui->tableWidget->setItem(row, 2, new QTableWidgetItem(item.sample_name)); + ui->tableWidget->setItem(row, 3, new QTableWidgetItem(item.model)); + ui->tableWidget->setItem(row, 4, new QTableWidgetItem(item.help_instruction)); + ui->tableWidget->setItem(row, 5, new QTableWidgetItem(item.manufacture_no)); + ui->tableWidget->setItem(row, 6, new QTableWidgetItem(item.manufacturer)); + ui->tableWidget->setItem(row, 7, new QTableWidgetItem(item.customer_name)); + ui->tableWidget->setItem(row, 8, new QTableWidgetItem(item.FULL_NAME)); + ui->tableWidget->setItem(row, 9, new QTableWidgetItem(item.NAME)); + ui->tableWidget->setItem(row, 10, new QTableWidgetItem(item.trace_date.toString())); + ui->tableWidget->setItem(row, 11, new QTableWidgetItem(item.measure_valid_date.toString())); + ui->tableWidget->setItem(row, 12, new QTableWidgetItem(item.meter_identify)); + ui->tableWidget->setItem(row, 13, new QTableWidgetItem(item.restriction_instruction)); + //实现单元格添加两个按钮 + // 创建一个QWidget作为单元格的容器 + QWidget *widget = new QWidget(); + QHBoxLayout *layout = new QHBoxLayout(widget); // 水平布局 + + + QPushButton *button = new QPushButton("详情"); + QPushButton *button2 = new QPushButton("预览"); + + //设置按钮1简单样式 + button->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button, &QPushButton::clicked, this, [this, button, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonSelectClicked(id); + } + + }); + //设置按钮2简单样式 + button2->setStyleSheet("QPushButton {" + " border: none; /* 无边框 */" + " color: green; /* 文本颜色 */" + " text-decoration: underline; /* 文本下划线 */" + "}"); + + // 设置鼠标悬停时的光标样式为小手图标 + button2->setCursor(Qt::PointingHandCursor); + // 连接按钮的 clicked 信号到自定义槽函数 + connect(button2, &QPushButton::clicked, this, [this, button2, row]() { + // 获取当前行第一列的 ID + QTableWidgetItem *idItem = this->ui->tableWidget->item(row, 0); + if (idItem) { + QString id = idItem->text(); + OnButtonPreViewtClicked(id); + } + + }); + //将按钮添加到布局控件 + layout->addWidget(button); + layout->addWidget(button2); + layout->setContentsMargins(5, 5, 0, 0); // 设置布局边距为0 + widget->setLayout(layout); + //将布局控件添加到 单元格 + ui->tableWidget->setCellWidget(row, 14, widget); + // 调整表格大小以适应内容 + //ui->tableWidget->resizeColumnsToContents(); + // ui->tableWidget->resizeRowsToContents(); + row++; + } +} +void TestDataItem::OnButtonSelectClicked(QString id) +{ + // ======================================================================================== + // 编辑按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} +void TestDataItem::OnButtonPreViewtClicked(QString id) +{ + // ======================================================================================== + // 预览按钮 点击事件 进入详情页面 + // ==================================================================================== + //DeviceInfoInit(id); + //ui->stackedWidget->setCurrentIndex(1); + QMessageBox::information(this, "ID",id); +} + +void TestDataItem::on_pushButton_clicked() +{ + ui->stackedWidget->setCurrentIndex(0); } diff --git a/softwareDirectory/AutoVerScheme/testdataitem.h b/softwareDirectory/AutoVerScheme/testdataitem.h index 2e0563c..4e5a793 100644 --- a/softwareDirectory/AutoVerScheme/testdataitem.h +++ b/softwareDirectory/AutoVerScheme/testdataitem.h @@ -20,6 +20,9 @@ void ShowMessageBox(QString title,QString value); //继承父类的Load方法 void Load() override; + void OnButtonSelectClicked(QString id); + void on_pushButton_clicked(); + void OnButtonPreViewtClicked(QString id); private: Ui::TestDataItem *ui; }; diff --git a/softwareDirectory/AutoVerScheme/testdataitem.ui b/softwareDirectory/AutoVerScheme/testdataitem.ui index 45f3532..bc42714 100644 --- a/softwareDirectory/AutoVerScheme/testdataitem.ui +++ b/softwareDirectory/AutoVerScheme/testdataitem.ui @@ -13,248 +13,984 @@ Form - + + + 0 + + + 0 + + + 0 + + + 0 + - - - - 0 - 0 - - + - background-color:white; + - - + + 0 - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 设备名称: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 型号规则: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 出厂编号: - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 委托单位: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 使用部门: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 检定员: - - - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - 检定日期: - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - Qt::RightToLeft - - - 查询 - - - - - - - Qt::RightToLeft - - - 重置 - - - - - - - - - - background-color:white; - - - - - - - - - - - - - - - - + + + + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 设备名称: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 型号规则: + + + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + 出厂编号: + + + + + + + + 0 + 0 + + + + + + + + 委托单位: + + + + + + + + + + 使用部门: + + + + + + + + + + 检定员: + + + + + + + + + + 检定日期: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::RightToLeft + + + background-color:rgb(3, 58, 132); +color:white; + + + + 查询 + + + + + + + Qt::RightToLeft + + + background-color:rgb(207, 132, 33); +color:white; + + + + 重置 + + + + + + + + + + background-color:white; + + + + + + + + + + + + + + + + + + + + + + + color:black; + + + + + + + 0 + 0 + + + + background-color:white; + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 20 + + + + + + + + Qt::Horizontal + + + + 60 + 20 + + + + + + + + Font-size:25px; + + + 检定数据详情 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; +color:white; + + + 编辑 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; +color:white; + + + 保存 + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + Qt::RightToLeft + + + background-color:grey; +color:white; + + + 返回 + + + + + + + + + + background-color:white; + + + + + + + + + background-color:white; + + + + + + + + + 设备基本信息: + + + + + + + 设备名称: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 型号规格: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 出厂编号: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定有效期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产国家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产厂家: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 生产日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 购进日期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用年限: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备单价: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 使用状态: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 质量状况: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 所属部门: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 负责人: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备供方: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 位置信息: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 标准类型: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 设备分类: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 重要等级: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 检定周期: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 对应开箱记录: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + + + + + 备注: + + + + + + + ForbiddenCursor + + + background-color: #f0f0f0; +color: grey; + + + XXX + + + 3 + + + false + + + Qt::LogicalMoveStyle + + + + + + + + + + + + + + + + 核查项目及核查点: + + + + + + + + + + + + + + 0 + 0 + + + + + 30 + 0 + + + + + + + + + + false + + + + 6 + + + 0 + + + 0 + + + 0 + + + 6 + + + + + 检定项备注: + + + + + + + background-color: #f0f0f0; +color: grey; + + + + + + + + + + +