@ -1,8 +0,0 @@
|
||||
# 默认忽略的文件
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# 基于编辑器的 HTTP 客户端请求
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
@ -1,8 +0,0 @@
|
||||
# 默认忽略的文件
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# 基于编辑器的 HTTP 客户端请求
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="openjdk-23" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/.idea.iml" filepath="$PROJECT_DIR$/.idea/.idea.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<module name="wms" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
</component>
|
||||
<component name="JavacSettings">
|
||||
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
|
||||
<module name="wms" options="-parameters" />
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@ -1,32 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||
<data-source source="LOCAL" name="localhost" uuid="4515b571-f9e4-4832-bb7b-3372a6c43624">
|
||||
<driver-ref>mysql</driver-ref>
|
||||
<synchronize>true</synchronize>
|
||||
<imported>true</imported>
|
||||
<remarks>$PROJECT_DIR$/springboot_vue_wms/wms/src/main/resources/application.yml</remarks>
|
||||
<jdbc-driver>com.mysql.jdbc.Driver</jdbc-driver>
|
||||
<jdbc-url>jdbc:mysql://localhost:3306/wms?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT</jdbc-url>
|
||||
<jdbc-additional-properties>
|
||||
<property name="com.intellij.clouds.kubernetes.db.host.port" />
|
||||
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
|
||||
<property name="com.intellij.clouds.kubernetes.db.container.port" />
|
||||
</jdbc-additional-properties>
|
||||
<working-dir>$ProjectFileDir$</working-dir>
|
||||
</data-source>
|
||||
<data-source source="LOCAL" name="study@localhost" uuid="4feef68c-b370-46df-a06e-48b5a0a998b4">
|
||||
<driver-ref>mysql</driver-ref>
|
||||
<synchronize>true</synchronize>
|
||||
<imported>true</imported>
|
||||
<jdbc-driver>com.mysql.jdbc.Driver</jdbc-driver>
|
||||
<jdbc-url>jdbc:mysql://localhost:3306/study</jdbc-url>
|
||||
<jdbc-additional-properties>
|
||||
<property name="com.intellij.clouds.kubernetes.db.host.port" />
|
||||
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
|
||||
<property name="com.intellij.clouds.kubernetes.db.container.port" />
|
||||
</jdbc-additional-properties>
|
||||
<working-dir>$ProjectFileDir$</working-dir>
|
||||
</data-source>
|
||||
</component>
|
||||
</project>
|
||||
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/springboot_vue_wms/wms/src/main/java" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,6 +0,0 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
</profile>
|
||||
</component>
|
||||
@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
||||
@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/springboot_vue_wms/wms/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
<option name="workspaceImportForciblyTurnedOn" value="true" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/springboot_vue_wms/wms/wms.iml" filepath="$PROJECT_DIR$/springboot_vue_wms/wms/wms.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/物流管系统.iml" filepath="$PROJECT_DIR$/.idea/物流管系统.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="SqlDialectMappings">
|
||||
<file url="file://$PROJECT_DIR$/springboot_vue_wms/wms/src/db/wms.sql" dialect="MySQL" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
@ -1 +0,0 @@
|
||||
Subproject commit a91eb78d8ef80df5f8a2531742985c33c37a6d61
|
||||
Binary file not shown.
@ -1,8 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
# 基于编辑器的 HTTP 客户端请求
|
||||
/httpRequests/
|
||||
@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="accountSettings">
|
||||
<option name="activeRegion" value="us-east-1" />
|
||||
<option name="recentlyUsedRegions">
|
||||
<list>
|
||||
<option value="us-east-1" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile default="true" name="Default" enabled="true" />
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<module name="wms" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
</component>
|
||||
<component name="JavacSettings">
|
||||
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
|
||||
<module name="wms" options="-parameters" />
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/../../../apache-maven/maven_repository/org/springframework/boot/spring-boot-starter-parent/2.6.7/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/wms/src/main/java" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GoogleJavaFormatSettings">
|
||||
<option name="enabled" value="false" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,204 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="JavaDocConfiguration">
|
||||
<GENERAL>
|
||||
<MODE>UPDATE</MODE>
|
||||
<OVERRIDDEN_METHODS>false</OVERRIDDEN_METHODS>
|
||||
<SPLITTED_CLASS_NAME>true</SPLITTED_CLASS_NAME>
|
||||
<LEVELS>
|
||||
<LEVEL>METHOD</LEVEL>
|
||||
<LEVEL>TYPE</LEVEL>
|
||||
<LEVEL>FIELD</LEVEL>
|
||||
</LEVELS>
|
||||
<VISIBILITIES>
|
||||
<VISIBILITY>PROTECTED</VISIBILITY>
|
||||
<VISIBILITY>PUBLIC</VISIBILITY>
|
||||
<VISIBILITY>DEFAULT</VISIBILITY>
|
||||
</VISIBILITIES>
|
||||
</GENERAL>
|
||||
<TEMPLATES>
|
||||
<CLASSES>
|
||||
<CLASS>
|
||||
<KEY>^.*(public|protected|private)*.+interface\s+\w+.*</KEY>
|
||||
<VALUE>/**\n
|
||||
* The interface ${name}.\n
|
||||
<#if element.typeParameters?has_content> * \n
|
||||
</#if>
|
||||
<#list element.typeParameters as typeParameter>
|
||||
* @param <${typeParameter.name}> the type parameter\n
|
||||
</#list>
|
||||
*/</VALUE>
|
||||
</CLASS>
|
||||
<CLASS>
|
||||
<KEY>^.*(public|protected|private)*.+enum\s+\w+.*</KEY>
|
||||
<VALUE>/**\n
|
||||
* The enum ${name}.\n
|
||||
*/</VALUE>
|
||||
</CLASS>
|
||||
<CLASS>
|
||||
<KEY>^.*(public|protected|private)*.+class\s+\w+.*</KEY>
|
||||
<VALUE>/**\n
|
||||
* The type ${name}.\n
|
||||
<#if element.typeParameters?has_content> * \n
|
||||
</#if>
|
||||
<#list element.typeParameters as typeParameter>
|
||||
* @param <${typeParameter.name}> the type parameter\n
|
||||
</#list>
|
||||
*/</VALUE>
|
||||
</CLASS>
|
||||
<CLASS>
|
||||
<KEY>.+</KEY>
|
||||
<VALUE>/**\n
|
||||
* The type ${name}.\n
|
||||
*/</VALUE>
|
||||
</CLASS>
|
||||
</CLASSES>
|
||||
<CONSTRUCTORS>
|
||||
<CONSTRUCTOR>
|
||||
<KEY>.+</KEY>
|
||||
<VALUE>/**\n
|
||||
* Instantiates a new ${name}.\n
|
||||
<#if element.parameterList.parameters?has_content>
|
||||
*\n
|
||||
</#if>
|
||||
<#list element.parameterList.parameters as parameter>
|
||||
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
|
||||
</#list>
|
||||
<#if element.throwsList.referenceElements?has_content>
|
||||
*\n
|
||||
</#if>
|
||||
<#list element.throwsList.referenceElements as exception>
|
||||
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
|
||||
</#list>
|
||||
*/</VALUE>
|
||||
</CONSTRUCTOR>
|
||||
</CONSTRUCTORS>
|
||||
<METHODS>
|
||||
<METHOD>
|
||||
<KEY>^.*(public|protected|private)*\s*.*(\w(\s*<.+>)*)+\s+get\w+\s*\(.*\).+</KEY>
|
||||
<VALUE>/**\n
|
||||
* Gets ${partName}.\n
|
||||
<#if element.typeParameters?has_content> * \n
|
||||
</#if>
|
||||
<#list element.typeParameters as typeParameter>
|
||||
* @param <${typeParameter.name}> the type parameter\n
|
||||
</#list>
|
||||
<#if element.parameterList.parameters?has_content>
|
||||
*\n
|
||||
</#if>
|
||||
<#list element.parameterList.parameters as parameter>
|
||||
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
|
||||
</#list>
|
||||
<#if isNotVoid>
|
||||
*\n
|
||||
* @return the ${partName}\n
|
||||
</#if>
|
||||
<#if element.throwsList.referenceElements?has_content>
|
||||
*\n
|
||||
</#if>
|
||||
<#list element.throwsList.referenceElements as exception>
|
||||
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
|
||||
</#list>
|
||||
*/</VALUE>
|
||||
</METHOD>
|
||||
<METHOD>
|
||||
<KEY>^.*(public|protected|private)*\s*.*(void|\w(\s*<.+>)*)+\s+set\w+\s*\(.*\).+</KEY>
|
||||
<VALUE>/**\n
|
||||
* Sets ${partName}.\n
|
||||
<#if element.typeParameters?has_content> * \n
|
||||
</#if>
|
||||
<#list element.typeParameters as typeParameter>
|
||||
* @param <${typeParameter.name}> the type parameter\n
|
||||
</#list>
|
||||
<#if element.parameterList.parameters?has_content>
|
||||
*\n
|
||||
</#if>
|
||||
<#list element.parameterList.parameters as parameter>
|
||||
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
|
||||
</#list>
|
||||
<#if isNotVoid>
|
||||
*\n
|
||||
* @return the ${partName}\n
|
||||
</#if>
|
||||
<#if element.throwsList.referenceElements?has_content>
|
||||
*\n
|
||||
</#if>
|
||||
<#list element.throwsList.referenceElements as exception>
|
||||
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
|
||||
</#list>
|
||||
*/</VALUE>
|
||||
</METHOD>
|
||||
<METHOD>
|
||||
<KEY>^.*((public\s+static)|(static\s+public))\s+void\s+main\s*\(\s*String\s*(\[\s*\]|\.\.\.)\s+\w+\s*\).+</KEY>
|
||||
<VALUE>/**\n
|
||||
* The entry point of application.\n
|
||||
|
||||
<#if element.parameterList.parameters?has_content>
|
||||
*\n
|
||||
</#if>
|
||||
* @param ${element.parameterList.parameters[0].name} the input arguments\n
|
||||
<#if element.throwsList.referenceElements?has_content>
|
||||
*\n
|
||||
</#if>
|
||||
<#list element.throwsList.referenceElements as exception>
|
||||
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
|
||||
</#list>
|
||||
*/</VALUE>
|
||||
</METHOD>
|
||||
<METHOD>
|
||||
<KEY>.+</KEY>
|
||||
<VALUE>/**\n
|
||||
* ${name}<#if isNotVoid> ${return}</#if>.\n
|
||||
<#if element.typeParameters?has_content> * \n
|
||||
</#if>
|
||||
<#list element.typeParameters as typeParameter>
|
||||
* @param <${typeParameter.name}> the type parameter\n
|
||||
</#list>
|
||||
<#if element.parameterList.parameters?has_content>
|
||||
*\n
|
||||
</#if>
|
||||
<#list element.parameterList.parameters as parameter>
|
||||
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
|
||||
</#list>
|
||||
<#if isNotVoid>
|
||||
*\n
|
||||
* @return the ${return}\n
|
||||
</#if>
|
||||
<#if element.throwsList.referenceElements?has_content>
|
||||
*\n
|
||||
</#if>
|
||||
<#list element.throwsList.referenceElements as exception>
|
||||
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
|
||||
</#list>
|
||||
*/</VALUE>
|
||||
</METHOD>
|
||||
</METHODS>
|
||||
<FIELDS>
|
||||
<FIELD>
|
||||
<KEY>^.*(public|protected|private)*.+static.*(\w\s\w)+.+</KEY>
|
||||
<VALUE>/**\n
|
||||
* The constant ${element.getName()}.\n
|
||||
*/</VALUE>
|
||||
</FIELD>
|
||||
<FIELD>
|
||||
<KEY>^.*(public|protected|private)*.*(\w\s\w)+.+</KEY>
|
||||
<VALUE>/**\n
|
||||
<#if element.parent.isInterface()>
|
||||
* The constant ${element.getName()}.\n
|
||||
<#else>
|
||||
* The ${name}.\n
|
||||
</#if> */</VALUE>
|
||||
</FIELD>
|
||||
<FIELD>
|
||||
<KEY>.+</KEY>
|
||||
<VALUE>/**\n
|
||||
<#if element.parent.isEnum()>
|
||||
*${name} ${typeName}.\n
|
||||
<#else>
|
||||
* The ${name}.\n
|
||||
</#if>*/</VALUE>
|
||||
</FIELD>
|
||||
</FIELDS>
|
||||
</TEMPLATES>
|
||||
</component>
|
||||
</project>
|
||||
@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="http://maven.aliyun.com/nexus/content/repositories/central/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
||||
@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="JavaScriptSettings">
|
||||
<option name="languageLevel" value="ES6" />
|
||||
</component>
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/wms/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="jpab" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/springboot_vue_wms.iml" filepath="$PROJECT_DIR$/.idea/springboot_vue_wms.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/wms/wms.iml" filepath="$PROJECT_DIR$/wms/wms.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/wms-web" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,4 +0,0 @@
|
||||
{
|
||||
"java.compile.nullAnalysis.mode": "automatic",
|
||||
"git.ignoreLimitWarning": true
|
||||
}
|
||||
@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "springboot_vue_wms",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {}
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="GENERAL_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
@ -1,23 +0,0 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
@ -1,24 +0,0 @@
|
||||
# wms-web
|
||||
|
||||
## Project setup
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
### Compiles and hot-reloads for development
|
||||
```
|
||||
npm run serve
|
||||
```
|
||||
|
||||
### Compiles and minifies for production
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
|
||||
### Lints and fixes files
|
||||
```
|
||||
npm run lint
|
||||
```
|
||||
|
||||
### Customize configuration
|
||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
||||
@ -1,5 +0,0 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
'@vue/cli-plugin-babel/preset'
|
||||
]
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"module": "esnext",
|
||||
"baseUrl": "./",
|
||||
"moduleResolution": "node",
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"src/*"
|
||||
]
|
||||
},
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"scripthost"
|
||||
]
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,48 +0,0 @@
|
||||
{
|
||||
"name": "wms-web",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^1.7.2",
|
||||
"core-js": "^3.8.3",
|
||||
"element-ui": "^2.15.14",
|
||||
"vue": "^2.6.14",
|
||||
"vue-router": "^3.6.5",
|
||||
"vuex": "^3.6.2",
|
||||
"vuex-persistedstate": "^4.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "^5.0.8",
|
||||
"@vue/cli-plugin-eslint": "^5.0.8",
|
||||
"@vue/cli-service": "^5.0.8",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-plugin-vue": "^8.0.3",
|
||||
"vue-template-compiler": "^2.6.11",
|
||||
"@babel/eslint-parser": "^7.12.16",
|
||||
"@babel/core": "^7.12.16"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"env": {
|
||||
"node": true
|
||||
},
|
||||
"extends": [
|
||||
"plugin:vue/essential",
|
||||
"eslint:recommended"
|
||||
],
|
||||
"parserOptions": {
|
||||
"parser": "@babel/eslint-parser"
|
||||
},
|
||||
"rules": {}
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions",
|
||||
"not dead"
|
||||
]
|
||||
}
|
||||
|
Before Width: | Height: | Size: 4.2 KiB |
@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||
</noscript>
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
</html>
|
||||
@ -1,37 +0,0 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<router-view/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
components: {},
|
||||
data(){
|
||||
return {
|
||||
user : JSON.parse(sessionStorage.getItem('CurUser')),
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
'$store.state.menu':{
|
||||
handler(val,old) {
|
||||
console.log(val,old)
|
||||
if(!old && this.user && this.user.no){
|
||||
this.$store.commit("setRouter",val)
|
||||
}
|
||||
},
|
||||
immediate:true
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
#app {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
@ -1,4 +0,0 @@
|
||||
*{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 24 KiB |
@ -1,62 +0,0 @@
|
||||
<template>
|
||||
<el-menu
|
||||
background-color="#545c64"
|
||||
text-color="#fff"
|
||||
active-text-color="#ffd04b"
|
||||
style="height: 100%;"
|
||||
default-active="/Home"
|
||||
:collapse="isCollapse"
|
||||
:collapse-transition="false"
|
||||
router
|
||||
>
|
||||
<el-menu-item index="/Home">
|
||||
<i class="el-icon-s-home"></i>
|
||||
<span slot="title">首页</span>
|
||||
</el-menu-item>
|
||||
|
||||
<el-menu-item :index="'/'+item.menuclick" v-for="(item,i) in menu" :key="i">
|
||||
<i :class="item.menuicon"></i>
|
||||
<span slot="title">{{item.menuname}}</span>
|
||||
</el-menu-item>
|
||||
|
||||
|
||||
</el-menu>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
// eslint-disable-next-line vue/multi-word-component-names
|
||||
name: "Aside",
|
||||
data(){
|
||||
return {
|
||||
//isCollapse:false
|
||||
|
||||
/* menu:[
|
||||
{
|
||||
menuClick:'Admin',
|
||||
menuName:'管路员管理',
|
||||
menuIcon:'el-icon-s-custom'
|
||||
},{
|
||||
menuClick:'User',
|
||||
menuName:'用户管理',
|
||||
menuIcon:'el-icon-user-solid'
|
||||
}
|
||||
]*/
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
"menu":{
|
||||
get(){
|
||||
return this.$store.state.menu
|
||||
}
|
||||
}
|
||||
},
|
||||
props:{
|
||||
isCollapse:Boolean
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@ -1,78 +0,0 @@
|
||||
<template>
|
||||
<div style="display: flex;line-height: 60px;">
|
||||
<div style="margin-top: 8px;">
|
||||
<i :class="icon" style="font-size: 20px;cursor: pointer;" @click="collapse"></i>
|
||||
</div>
|
||||
<div style="flex: 1;text-align: center;font-size: 34px;">
|
||||
<span>欢迎来到物流管理系统</span>
|
||||
</div>
|
||||
<el-dropdown>
|
||||
<span>{{user.name}}</span><i class="el-icon-arrow-down" style="margin-left: 5px;"></i>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="toUser">个人中心</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="logout">退出登录</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
// eslint-disable-next-line vue/multi-word-component-names
|
||||
name: "Header",
|
||||
data(){
|
||||
return {
|
||||
user : JSON.parse(sessionStorage.getItem('CurUser'))
|
||||
}
|
||||
},
|
||||
props:{
|
||||
icon:String
|
||||
},
|
||||
methods:{
|
||||
toUser(){
|
||||
console.log('to_user')
|
||||
|
||||
this.$router.push("/Home")
|
||||
},
|
||||
logout(){
|
||||
console.log('logout')
|
||||
|
||||
this.$confirm('您确定要退出登录吗?', '提示', {
|
||||
confirmButtonText: '确定', //确认按钮的文字显示
|
||||
type: 'warning',
|
||||
center: true, //文字居中显示
|
||||
|
||||
})
|
||||
.then(() => {
|
||||
this.$message({
|
||||
type:'success',
|
||||
message:'退出登录成功'
|
||||
})
|
||||
|
||||
this.$router.push("/")
|
||||
sessionStorage.clear()
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
type:'info',
|
||||
message:'已取消退出登录'
|
||||
})
|
||||
})
|
||||
|
||||
},
|
||||
collapse(){
|
||||
this.$emit('doCollapse')
|
||||
}
|
||||
|
||||
},
|
||||
created(){
|
||||
this.$router.push("/Home")
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@ -1,77 +0,0 @@
|
||||
<template>
|
||||
<div style="text-align: center;background-color: #f1f1f3;height: 100%;padding: 0px;margin: 0px;">
|
||||
<h1 style="font-size: 50px;">{{'欢迎你!'+user.name}}</h1>
|
||||
<el-descriptions title="个人中心" :column="2" size="40" border>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-s-custom"></i>
|
||||
账号
|
||||
</template>
|
||||
{{user.no}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-mobile-phone"></i>
|
||||
电话
|
||||
</template>
|
||||
{{user.phone}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-location-outline"></i>
|
||||
性别
|
||||
</template>
|
||||
<el-tag
|
||||
:type="user.sex === '1' ? 'primary' : 'danger'"
|
||||
disable-transitions><i :class="user.sex==1?'el-icon-male':'el-icon-female'"></i>{{user.sex==1?"男":"女"}}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-tickets"></i>
|
||||
角色
|
||||
</template>
|
||||
<el-tag
|
||||
type="success"
|
||||
disable-transitions>{{user.roleId==0?"超级管理员":(user.roleId==1?"管理员":"用户")}}</el-tag>
|
||||
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<DateUtils></DateUtils>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DateUtils from "./DateUtils";
|
||||
export default {
|
||||
// eslint-disable-next-line vue/multi-word-component-names
|
||||
name: "Home",
|
||||
components: {DateUtils},
|
||||
data() {
|
||||
|
||||
return {
|
||||
user:{}
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
|
||||
},
|
||||
methods:{
|
||||
init(){
|
||||
this.user = JSON.parse(sessionStorage.getItem('CurUser'))
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.init()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-descriptions{
|
||||
width:90%;
|
||||
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
@ -1,63 +0,0 @@
|
||||
<template>
|
||||
<el-container>
|
||||
<el-aside :width="aside_witdh" style="min-height: 80vh;background-color: rgb(238, 241, 246);margin-left: -1px;">
|
||||
<Aside :isCollapse="isCollapse"></Aside>
|
||||
</el-aside>
|
||||
|
||||
<el-container style="min-height: 98vh">
|
||||
<el-header style="text-align: right; font-size: 12px;height: 60px;border-bottom: rgba(168,168,168,0.3) 1px solid;">
|
||||
<Header @doCollapse="doCollapse" :icon="icon"></Header>
|
||||
</el-header>
|
||||
|
||||
<el-main style="height: 100%;">
|
||||
<!-- <Main></Main>-->
|
||||
<router-view/>
|
||||
</el-main>
|
||||
<el-footer
|
||||
style="display: flex;justify-content: center;align-items: center;height: 60px;background-color:chocolate;font-size: 20px;line-height: 40px;">
|
||||
Copyright @2025 物流管理代码.All rights reserved.
|
||||
</el-footer>
|
||||
</el-container>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Aside from "./Aside";
|
||||
import Header from "./Header";
|
||||
|
||||
export default {
|
||||
// eslint-disable-next-line vue/multi-word-component-names
|
||||
name: "Index",
|
||||
components:{Aside,Header},
|
||||
data(){
|
||||
return {
|
||||
isCollapse:false,
|
||||
aside_witdh:'200px',
|
||||
icon:'el-icon-s-fold'
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
doCollapse(){
|
||||
console.log(1111)
|
||||
|
||||
this.isCollapse = !this.isCollapse
|
||||
if(!this.isCollapse){// 展开
|
||||
this.aside_witdh='200px'
|
||||
this.icon='el-icon-s-fold'
|
||||
}else{//关起、关闭、收起
|
||||
this.aside_witdh='64px'
|
||||
this.icon='el-icon-s-unfold'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-main{
|
||||
padding: 5px;
|
||||
}
|
||||
.el-aside {
|
||||
color: #333;
|
||||
}
|
||||
</style>
|
||||
@ -1,352 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="margin-bottom: 5px;">
|
||||
<el-input v-model="name" placeholder="请输入名字" suffix-icon="el-icon-search" style="width: 200px;"
|
||||
@keyup.enter.native="loadPost"></el-input>
|
||||
<el-select v-model="sex" filterable placeholder="请选择性别" style="margin-left: 5px;">
|
||||
<el-option
|
||||
v-for="item in sexs"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button type="primary" style="margin-left: 5px;" @click="loadPost">查询</el-button>
|
||||
<el-button type="success" @click="resetParam">重置</el-button>
|
||||
|
||||
<el-button type="primary" style="margin-left: 5px;" @click="add">新增</el-button>
|
||||
</div>
|
||||
<el-table :data="tableData"
|
||||
:header-cell-style="{ background: '#f2f5fc', color: '#555555' }"
|
||||
border
|
||||
>
|
||||
<el-table-column prop="id" label="ID" width="60">
|
||||
</el-table-column>
|
||||
<el-table-column prop="no" label="账号" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="姓名" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="age" label="年龄" width="80">
|
||||
</el-table-column>
|
||||
<el-table-column prop="sex" label="性别" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-tag
|
||||
:type="scope.row.sex === 1 ? 'primary' : 'success'"
|
||||
disable-transitions>{{scope.row.sex === 1 ? '男' : '女'}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="roleId" label="角色" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-tag
|
||||
:type="scope.row.roleId === 0 ? 'danger' : (scope.row.roleId === 1 ? 'primary' : 'success')"
|
||||
disable-transitions>{{scope.row.roleId === 0 ? '超级管理员' :
|
||||
(scope.row.roleId === 1 ? '管理员' : '用户')}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="phone" label="电话" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="operate" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="small" type="success" @click="mod(scope.row)">编辑</el-button>
|
||||
<el-popconfirm
|
||||
title="确定删除吗?"
|
||||
@confirm="del(scope.row.id)"
|
||||
style="margin-left: 5px;"
|
||||
>
|
||||
<el-button slot="reference" size="small" type="danger" >删除</el-button>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pageNum"
|
||||
:page-sizes="[5, 10, 20,30]"
|
||||
:page-size="pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
|
||||
<el-dialog
|
||||
title="提示"
|
||||
:visible.sync="centerDialogVisible"
|
||||
width="30%"
|
||||
center>
|
||||
|
||||
<el-form ref="form" :rules="rules" :model="form" label-width="80px">
|
||||
<el-form-item label="账号" prop="no">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form.no"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="名字" prop="name">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form.name"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="密码" prop="password">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form.password"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="年龄" prop="age">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form.age"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="性别">
|
||||
<el-radio-group v-model="form.sex">
|
||||
<el-radio label="1">男</el-radio>
|
||||
<el-radio label="0">女</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="电话" prop="phone">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form.phone"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="centerDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="save">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
// eslint-disable-next-line vue/multi-word-component-names
|
||||
name: "Main",
|
||||
data() {
|
||||
let checkAge = (rule, value, callback) => {
|
||||
if(value>150){
|
||||
callback(new Error('年龄输入过大'));
|
||||
}else{
|
||||
callback();
|
||||
}
|
||||
};
|
||||
let checkDuplicate =(rule,value,callback)=>{
|
||||
if(this.form.id){
|
||||
return callback();
|
||||
}
|
||||
this.$axios.get(this.$httpUrl+"/user/findByNo?no="+this.form.no).then(res=>res.data).then(res=>{
|
||||
if(res.code!=200){
|
||||
|
||||
callback()
|
||||
}else{
|
||||
callback(new Error('账号已经存在'));
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
return {
|
||||
tableData: [],
|
||||
pageSize:10,
|
||||
pageNum:1,
|
||||
total:0,
|
||||
name:'',
|
||||
sex:'',
|
||||
sexs:[
|
||||
{
|
||||
value: '1',
|
||||
label: '男'
|
||||
}, {
|
||||
value: '0',
|
||||
label: '女'
|
||||
}
|
||||
],
|
||||
centerDialogVisible:false,
|
||||
form:{
|
||||
id:'',
|
||||
no:'',
|
||||
name:'',
|
||||
password:'',
|
||||
age:'',
|
||||
phone:'',
|
||||
sex:'0',
|
||||
roleId:'1'
|
||||
},
|
||||
rules: {
|
||||
no: [
|
||||
{required: true, message: '请输入账号', trigger: 'blur'},
|
||||
{min: 3, max: 8, message: '长度在 3 到 8 个字符', trigger: 'blur'},
|
||||
{validator:checkDuplicate,trigger: 'blur'}
|
||||
],
|
||||
name: [
|
||||
{required: true, message: '请输入名字', trigger: 'blur'}
|
||||
],
|
||||
password: [
|
||||
{required: true, message: '请输入密码', trigger: 'blur'},
|
||||
{min: 3, max: 8, message: '长度在 3 到 8 个字符', trigger: 'blur'}
|
||||
],
|
||||
age: [
|
||||
{required: true, message: '请输入年龄', trigger: 'blur'},
|
||||
{min: 1, max: 3, message: '长度在 1 到 3 个位', trigger: 'blur'},
|
||||
{pattern: /^([1-9][0-9]*){1,3}$/,message: '年龄必须为正整数字',trigger: "blur"},
|
||||
{validator:checkAge,trigger: 'blur'}
|
||||
],
|
||||
phone: [
|
||||
{required: true,message: "手机号不能为空",trigger: "blur"},
|
||||
{pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur"}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
resetForm() {
|
||||
this.$refs.form.resetFields();
|
||||
},
|
||||
del(id){
|
||||
console.log(id)
|
||||
|
||||
this.$axios.get(this.$httpUrl+'/user/del?id='+id).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.loadPost()
|
||||
}else{
|
||||
this.$message({
|
||||
message: '操作失败!',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
mod(row){
|
||||
console.log(row)
|
||||
|
||||
this.centerDialogVisible = true
|
||||
this.$nextTick(()=>{
|
||||
//赋值到表单
|
||||
this.form.id = row.id
|
||||
this.form.no = row.no
|
||||
this.form.name = row.name
|
||||
this.form.password = ''
|
||||
this.form.age = row.age +''
|
||||
this.form.sex = row.sex +''
|
||||
this.form.phone = row.phone
|
||||
this.form.roleId = row.roleId
|
||||
})
|
||||
},
|
||||
add(){
|
||||
|
||||
this.centerDialogVisible = true
|
||||
this.$nextTick(()=>{
|
||||
this.resetForm()
|
||||
})
|
||||
|
||||
},
|
||||
doSave(){
|
||||
this.$axios.post(this.$httpUrl+'/user/save',this.form).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.centerDialogVisible = false
|
||||
this.loadPost()
|
||||
this. resetForm()
|
||||
}else{
|
||||
this.$message({
|
||||
message: '操作失败!',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
doMod(){
|
||||
this.$axios.post(this.$httpUrl+'/user/update',this.form).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.centerDialogVisible = false
|
||||
this.loadPost()
|
||||
this. resetForm()
|
||||
}else{
|
||||
this.$message({
|
||||
message: '操作失败!',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
save(){
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
if(this.form.id){
|
||||
this.doMod();
|
||||
}else{
|
||||
this.doSave();
|
||||
}
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
console.log(`每页 ${val} 条`);
|
||||
this.pageNum=1
|
||||
this.pageSize=val
|
||||
this.loadPost()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
console.log(`当前页: ${val}`);
|
||||
this.pageNum=val
|
||||
this.loadPost()
|
||||
},
|
||||
loadGet(){
|
||||
this.$axios.get(this.$httpUrl+'/user/list').then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
resetParam(){
|
||||
this.name=''
|
||||
this.sex=''
|
||||
},
|
||||
loadPost(){
|
||||
this.$axios.post(this.$httpUrl+'/user/listPageC1',{
|
||||
pageSize:this.pageSize,
|
||||
pageNum:this.pageNum,
|
||||
param:{
|
||||
name:this.name,
|
||||
sex:this.sex
|
||||
}
|
||||
}).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
this.tableData=res.data
|
||||
this.total=res.total
|
||||
}else{
|
||||
alert('获取数据失败')
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
beforeMount() {
|
||||
//this.loadGet();
|
||||
this.loadPost()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@ -1,353 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="margin-bottom: 5px;text-align:center;">
|
||||
<el-input v-model="name" placeholder="请输入名字" suffix-icon="el-icon-search" style="width: 200px;"
|
||||
@keyup.enter.native="loadPost"></el-input>
|
||||
<el-select v-model="sex" filterable placeholder="请选择性别" style="margin-left: 5px;">
|
||||
<el-option
|
||||
v-for="item in sexs"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button type="primary" style="margin-left: 5px;" @click="loadPost">查询</el-button>
|
||||
<el-button type="success" @click="resetParam">重置</el-button>
|
||||
|
||||
<el-button type="primary" style="margin-left: 5px;" @click="add">新增</el-button>
|
||||
</div>
|
||||
<el-table :data="tableData"
|
||||
:header-cell-style="{ background: '#f2f5fc', color: '#555555' }"
|
||||
border
|
||||
>
|
||||
<el-table-column prop="id" label="ID" width="60">
|
||||
</el-table-column>
|
||||
<el-table-column prop="no" label="账号" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="姓名" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="age" label="年龄" width="80">
|
||||
</el-table-column>
|
||||
<el-table-column prop="sex" label="性别" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-tag
|
||||
:type="scope.row.sex === 1 ? 'primary' : 'success'"
|
||||
disable-transitions>{{scope.row.sex === 1 ? '男' : '女'}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="roleId" label="角色" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-tag
|
||||
:type="scope.row.roleId === 0 ? 'danger' : (scope.row.roleId === 1 ? 'primary' : 'success')"
|
||||
disable-transitions>{{scope.row.roleId === 0 ? '超级管理员' :
|
||||
(scope.row.roleId === 1 ? '管理员' : '用户')}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="phone" label="电话" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="operate" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="small" type="success" @click="mod(scope.row)">编辑</el-button>
|
||||
<el-popconfirm
|
||||
title="确定删除吗?"
|
||||
@confirm="del(scope.row.id)"
|
||||
style="margin-left: 5px;"
|
||||
>
|
||||
<el-button slot="reference" size="small" type="danger" >删除</el-button>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pageNum"
|
||||
:page-sizes="[5, 10, 20,30]"
|
||||
:page-size="pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
|
||||
<el-dialog
|
||||
title="提示"
|
||||
:visible.sync="centerDialogVisible"
|
||||
width="30%"
|
||||
center>
|
||||
|
||||
<el-form ref="form" :rules="rules" :model="form" label-width="80px">
|
||||
<el-form-item label="账号" prop="no">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form.no"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="名字" prop="name">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form.name"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="密码" prop="password">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form.password"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="年龄" prop="age">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form.age"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="性别">
|
||||
<el-radio-group v-model="form.sex">
|
||||
<el-radio label="1">男</el-radio>
|
||||
<el-radio label="0">女</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="电话" prop="phone">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form.phone"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="centerDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="save">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "AdminManage",
|
||||
data() {
|
||||
let checkAge = (rule, value, callback) => {
|
||||
if(value>150){
|
||||
callback(new Error('年龄输入过大'));
|
||||
}else{
|
||||
callback();
|
||||
}
|
||||
};
|
||||
let checkDuplicate =(rule,value,callback)=>{
|
||||
if(this.form.id){
|
||||
return callback();
|
||||
}
|
||||
this.$axios.get(this.$httpUrl+"/user/findByNo?no="+this.form.no).then(res=>res.data).then(res=>{
|
||||
if(res.code!=200){
|
||||
|
||||
callback()
|
||||
}else{
|
||||
callback(new Error('账号已经存在'));
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
return {
|
||||
tableData: [],
|
||||
pageSize:10,
|
||||
pageNum:1,
|
||||
total:0,
|
||||
name:'',
|
||||
sex:'',
|
||||
sexs:[
|
||||
{
|
||||
value: '1',
|
||||
label: '男'
|
||||
}, {
|
||||
value: '0',
|
||||
label: '女'
|
||||
}
|
||||
],
|
||||
centerDialogVisible:false,
|
||||
form:{
|
||||
id:'',
|
||||
no:'',
|
||||
name:'',
|
||||
password:'',
|
||||
age:'',
|
||||
phone:'',
|
||||
sex:'0',
|
||||
roleId:'1'
|
||||
},
|
||||
rules: {
|
||||
no: [
|
||||
{required: true, message: '请输入账号', trigger: 'blur'},
|
||||
{min: 3, max: 8, message: '长度在 3 到 8 个字符', trigger: 'blur'},
|
||||
{validator:checkDuplicate,trigger: 'blur'}
|
||||
],
|
||||
name: [
|
||||
{required: true, message: '请输入名字', trigger: 'blur'}
|
||||
],
|
||||
password: [
|
||||
{required: true, message: '请输入密码', trigger: 'blur'},
|
||||
{min: 3, max: 8, message: '长度在 3 到 8 个字符', trigger: 'blur'}
|
||||
],
|
||||
age: [
|
||||
{required: true, message: '请输入年龄', trigger: 'blur'},
|
||||
{min: 1, max: 3, message: '长度在 1 到 3 个位', trigger: 'blur'},
|
||||
{pattern: /^([1-9][0-9]*){1,3}$/,message: '年龄必须为正整数字',trigger: "blur"},
|
||||
{validator:checkAge,trigger: 'blur'}
|
||||
],
|
||||
phone: [
|
||||
{required: true,message: "手机号不能为空",trigger: "blur"},
|
||||
{pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur"}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
resetForm() {
|
||||
this.$refs.form.resetFields();
|
||||
this.form.id=''
|
||||
},
|
||||
del(id){
|
||||
console.log(id)
|
||||
|
||||
this.$axios.get(this.$httpUrl+'/user/del?id='+id).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.loadPost()
|
||||
}else{
|
||||
this.$message({
|
||||
message: '操作失败!',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
mod(row){
|
||||
console.log(row)
|
||||
|
||||
this.centerDialogVisible = true
|
||||
this.$nextTick(()=>{
|
||||
//赋值到表单
|
||||
this.form.id = row.id
|
||||
this.form.no = row.no
|
||||
this.form.name = row.name
|
||||
this.form.password = ''
|
||||
this.form.age = row.age +''
|
||||
this.form.sex = row.sex +''
|
||||
this.form.phone = row.phone
|
||||
this.form.roleId = row.roleId
|
||||
})
|
||||
},
|
||||
add(){
|
||||
|
||||
this.centerDialogVisible = true
|
||||
this.$nextTick(()=>{
|
||||
this.resetForm()
|
||||
})
|
||||
|
||||
},
|
||||
doSave(){
|
||||
this.$axios.post(this.$httpUrl+'/user/save',this.form).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.centerDialogVisible = false
|
||||
this.loadPost()
|
||||
this. resetForm()
|
||||
}else{
|
||||
this.$message({
|
||||
message: '操作失败!',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
doMod(){
|
||||
this.$axios.post(this.$httpUrl+'/user/update',this.form).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.centerDialogVisible = false
|
||||
this.loadPost()
|
||||
this. resetForm()
|
||||
}else{
|
||||
this.$message({
|
||||
message: '操作失败!',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
save(){
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
if(this.form.id){
|
||||
this.doMod();
|
||||
}else{
|
||||
this.doSave();
|
||||
}
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
console.log(`每页 ${val} 条`);
|
||||
this.pageNum=1
|
||||
this.pageSize=val
|
||||
this.loadPost()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
console.log(`当前页: ${val}`);
|
||||
this.pageNum=val
|
||||
this.loadPost()
|
||||
},
|
||||
loadGet(){
|
||||
this.$axios.get(this.$httpUrl+'/user/list').then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
resetParam(){
|
||||
this.name=''
|
||||
this.sex=''
|
||||
},
|
||||
loadPost(){
|
||||
this.$axios.post(this.$httpUrl+'/user/listPageC1',{
|
||||
pageSize:this.pageSize,
|
||||
pageNum:this.pageNum,
|
||||
param:{
|
||||
name:this.name,
|
||||
sex:this.sex,
|
||||
roleId:'1'
|
||||
}
|
||||
}).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
this.tableData=res.data
|
||||
this.total=res.total
|
||||
}else{
|
||||
alert('获取数据失败')
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
beforeMount() {
|
||||
//this.loadGet();
|
||||
this.loadPost()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@ -1,515 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="margin-bottom: 5px;text-align: center;">
|
||||
<el-input v-model="name" placeholder="请输入物品名" suffix-icon="el-icon-search" style="width: 200px;"
|
||||
@keyup.enter.native="loadPost"></el-input>
|
||||
<el-select v-model="storage" placeholder="请选择仓库" style="margin-left: 5px;">
|
||||
<el-option
|
||||
v-for="item in storageData"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select v-model="goodstype" placeholder="请选择分类" style="margin-left: 5px;">
|
||||
<el-option
|
||||
v-for="item in goodstypeData"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
<el-button type="primary" style="margin-left: 5px;" @click="loadPost">查询</el-button>
|
||||
<el-button type="success" @click="resetParam">重置</el-button>
|
||||
|
||||
<el-button type="primary" style="margin-left: 5px;" @click="add" v-if="user.roleId!=2">新增</el-button>
|
||||
<el-button type="primary" style="margin-left: 5px;" @click="inGoods" v-if="user.roleId!=2">入库</el-button>
|
||||
<el-button type="primary" style="margin-left: 5px;" @click="outGoods" v-if="user.roleId!=2">出库</el-button>
|
||||
</div>
|
||||
<el-table :data="tableData"
|
||||
:header-cell-style="{ background: '#f2f5fc', color: '#555555' }"
|
||||
border
|
||||
highlight-current-row
|
||||
@current-change="selectCurrentChange"
|
||||
>
|
||||
<el-table-column prop="id" label="ID" width="60">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="物品名" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="storage" label="仓库" width="180" :formatter="formatStorage">
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodstype" label="分类" width="180" :formatter="formatGoodstype">
|
||||
</el-table-column>
|
||||
<el-table-column prop="count" label="数量" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column prop="operate" label="操作" v-if="user.roleId!=2">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="small" type="success" @click="mod(scope.row)">编辑</el-button>
|
||||
<el-popconfirm
|
||||
title="确定删除吗?"
|
||||
@confirm="del(scope.row.id)"
|
||||
style="margin-left: 5px;"
|
||||
>
|
||||
<el-button slot="reference" size="small" type="danger" >删除</el-button>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pageNum"
|
||||
:page-sizes="[5, 10, 20,30]"
|
||||
:page-size="pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
|
||||
<el-dialog
|
||||
title="物品维护"
|
||||
:visible.sync="centerDialogVisible"
|
||||
width="30%"
|
||||
center>
|
||||
|
||||
<el-form ref="form" :rules="rules" :model="form" label-width="80px">
|
||||
<el-form-item label="物品名" prop="name">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form.name"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库" prop="storage">
|
||||
<el-col :span="20">
|
||||
<el-select v-model="form.storage" placeholder="请选择仓库" style="margin-left: 5px;">
|
||||
<el-option
|
||||
v-for="item in storageData"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="分类" prop="goodstype">
|
||||
<el-col :span="20">
|
||||
<el-select v-model="form.goodstype" placeholder="请选择分类" style="margin-left: 5px;">
|
||||
<el-option
|
||||
v-for="item in goodstypeData"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="数量" prop="count">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form.count"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-col :span="20">
|
||||
<el-input type="textarea" v-model="form.remark"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="centerDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="save">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
title="出入库"
|
||||
:visible.sync="inDialogVisible"
|
||||
width="30%"
|
||||
center>
|
||||
|
||||
<el-dialog
|
||||
width="75%"
|
||||
title="用户选择"
|
||||
:visible.sync="innerVisible"
|
||||
append-to-body>
|
||||
<SelectUser @doSelectUser="doSelectUser"></SelectUser>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="innerVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="confirmUser">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-form ref="form1" :rules="rules1" :model="form1" label-width="80px">
|
||||
<el-form-item label="物品名">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form1.goodsname" readonly></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="申请人">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form1.username" readonly @click.native="selectUser"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="数量" prop="count">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form1.count"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-col :span="20">
|
||||
<el-input type="textarea" v-model="form1.remark"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="inDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doInGoods">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import SelectUser from "../user/SelectUser";
|
||||
export default {
|
||||
name: "GoodsManage",
|
||||
components: {SelectUser},
|
||||
data() {
|
||||
let checkCount = (rule, value, callback) => {
|
||||
if(value>9999){
|
||||
callback(new Error('数量输入过大'));
|
||||
}else{
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
user : JSON.parse(sessionStorage.getItem('CurUser')),
|
||||
storageData:[],
|
||||
goodstypeData:[],
|
||||
tableData: [],
|
||||
pageSize:10,
|
||||
pageNum:1,
|
||||
total:0,
|
||||
name:'',
|
||||
storage:'',
|
||||
goodstype:'',
|
||||
centerDialogVisible:false,
|
||||
inDialogVisible:false,
|
||||
innerVisible:false,
|
||||
currentRow:{},
|
||||
tempUser:{},
|
||||
msg:'',
|
||||
form:{
|
||||
id:'',
|
||||
name:'',
|
||||
storage:'',
|
||||
goodstype:'',
|
||||
count:'',
|
||||
remark:''
|
||||
},
|
||||
form1:{
|
||||
goods:'',
|
||||
goodsname:'',
|
||||
count:10,
|
||||
username:'',
|
||||
userid:'',
|
||||
adminId:'',
|
||||
remark:'',
|
||||
action:'1'
|
||||
},
|
||||
rules1: {
|
||||
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入物品名', trigger: 'blur'}
|
||||
],
|
||||
storage:[
|
||||
{required: true, message: '请选择仓库', trigger: 'blur'}
|
||||
],
|
||||
goodstype:[
|
||||
{required: true, message: '请选择分类', trigger: 'blur'}
|
||||
],
|
||||
count: [
|
||||
{required: true, message: '请输入数量', trigger: 'blur'},
|
||||
{pattern: /^([1-9][0-9]*){1,4}$/,message: '数量必须为正整数字',trigger: "blur"},
|
||||
{validator:checkCount,trigger: 'blur'}
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
doSelectUser(val){
|
||||
console.log(val)
|
||||
this.tempUser = val
|
||||
},
|
||||
confirmUser(){
|
||||
this.form1.username = this.tempUser.name
|
||||
this.form1.userid = this.tempUser.id
|
||||
|
||||
this.innerVisible = false
|
||||
},
|
||||
selectCurrentChange(val) {
|
||||
this.currentRow = val;
|
||||
},
|
||||
formatStorage(row){
|
||||
let temp = this.storageData.find(item=>{
|
||||
return item.id == row.storage
|
||||
})
|
||||
|
||||
return temp && temp.name
|
||||
},
|
||||
formatGoodstype(row){
|
||||
let temp = this.goodstypeData.find(item=>{
|
||||
return item.id == row.goodstype
|
||||
})
|
||||
|
||||
return temp && temp.name
|
||||
},
|
||||
resetForm() {
|
||||
this.$refs.form.resetFields();
|
||||
this.form.id=''
|
||||
},
|
||||
resetInForm(){
|
||||
this.$refs.form1.resetFields();
|
||||
},
|
||||
del(id){
|
||||
console.log(id)
|
||||
|
||||
this.$axios.get(this.$httpUrl+'/goods/del?id='+id).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.loadPost()
|
||||
}else{
|
||||
this.$message({
|
||||
message: '操作失败!',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
mod(row){
|
||||
this.centerDialogVisible = true
|
||||
this.$nextTick(()=>{
|
||||
//赋值到表单
|
||||
this.form.id = row.id
|
||||
this.form.name = row.name
|
||||
this.form.storage = row.storage
|
||||
this.form.goodstype = row.goodstype
|
||||
this.form.count = row.count
|
||||
this.form.remark = row.remark
|
||||
})
|
||||
},
|
||||
add(){
|
||||
|
||||
this.centerDialogVisible = true
|
||||
this.$nextTick(()=>{
|
||||
this.resetForm()
|
||||
|
||||
this.form.id = ''
|
||||
})
|
||||
|
||||
},
|
||||
inGoods(){
|
||||
if(!this.currentRow.id){
|
||||
alert('请选择记录');
|
||||
return;
|
||||
}
|
||||
this.inDialogVisible = true
|
||||
this.$nextTick(()=>{
|
||||
this.resetInForm()
|
||||
})
|
||||
|
||||
this.form1.goodsname = this.currentRow.name
|
||||
this.form1.goods = this.currentRow.id
|
||||
this.form1.adminId=this.user.id
|
||||
this.form1.action='1'
|
||||
},
|
||||
outGoods(){
|
||||
if(!this.currentRow.id){
|
||||
alert('请选择记录');
|
||||
return;
|
||||
}
|
||||
this.inDialogVisible = true
|
||||
this.$nextTick(()=>{
|
||||
this.resetInForm()
|
||||
})
|
||||
|
||||
this.form1.goodsname = this.currentRow.name
|
||||
this.form1.goods = this.currentRow.id
|
||||
this.form1.adminId=this.user.id
|
||||
this.form1.action='2'
|
||||
|
||||
},
|
||||
selectUser(){
|
||||
this.innerVisible=true
|
||||
},
|
||||
doSave(){
|
||||
this.$axios.post(this.$httpUrl+'/goods/save',this.form).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.centerDialogVisible = false
|
||||
this.loadPost()
|
||||
this. resetForm()
|
||||
}else{
|
||||
this.$message({
|
||||
message: '操作失败!',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
doMod(){
|
||||
this.$axios.post(this.$httpUrl+'/goods/update',this.form).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.centerDialogVisible = false
|
||||
this.loadPost()
|
||||
this. resetForm()
|
||||
}else{
|
||||
this.$message({
|
||||
message: '操作失败!',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
save(){
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
if(this.form.id){
|
||||
this.doMod();
|
||||
}else{
|
||||
this.doSave();
|
||||
}
|
||||
} else {
|
||||
|
||||
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
doInGoods(){
|
||||
this.$axios.post(this.$httpUrl+'/record/save',this.form1).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.inDialogVisible = false
|
||||
this.loadPost()
|
||||
this. resetInForm()
|
||||
}else{
|
||||
this.msg=res.msg;
|
||||
if(res.msg!=null){
|
||||
this.$message({
|
||||
message:`${this.msg}`,
|
||||
type: 'wanring'
|
||||
});
|
||||
}else{
|
||||
this.$message({
|
||||
message: '操作失败!',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
console.log(`每页 ${val} 条`);
|
||||
this.pageNum=1
|
||||
this.pageSize=val
|
||||
this.loadPost()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
console.log(`当前页: ${val}`);
|
||||
this.pageNum=val
|
||||
this.loadPost()
|
||||
},
|
||||
resetParam(){
|
||||
this.name=''
|
||||
this.storage=''
|
||||
this.goodstype=''
|
||||
},
|
||||
loadPost(){
|
||||
this.$axios.post(this.$httpUrl+'/goods/listPage',{
|
||||
pageSize:this.pageSize,
|
||||
pageNum:this.pageNum,
|
||||
param:{
|
||||
name:this.name,
|
||||
goodstype:this.goodstype+'',
|
||||
storage:this.storage+''
|
||||
}
|
||||
}).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
this.tableData=res.data
|
||||
this.total=res.total
|
||||
}else{
|
||||
alert('获取数据失败')
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
loadStorage(){
|
||||
this.$axios.get(this.$httpUrl+'/storage/list').then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
this.storageData=res.data
|
||||
}else{
|
||||
alert('获取数据失败')
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
loadGoodstype(){
|
||||
this.$axios.get(this.$httpUrl+'/goodstype/list').then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
this.goodstypeData=res.data
|
||||
}else{
|
||||
alert('获取数据失败')
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
beforeMount() {
|
||||
this.loadStorage()
|
||||
this.loadGoodstype()
|
||||
this.loadPost()
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@ -1,234 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="margin-bottom: 5px;text-align: center;">
|
||||
<el-input v-model="name" placeholder="请输入分类名" suffix-icon="el-icon-search" style="width: 200px;"
|
||||
@keyup.enter.native="loadPost"></el-input>
|
||||
<el-button type="primary" style="margin-left: 5px;" @click="loadPost">查询</el-button>
|
||||
<el-button type="success" @click="resetParam">重置</el-button>
|
||||
|
||||
<el-button type="primary" style="margin-left: 5px;" @click="add">新增</el-button>
|
||||
</div>
|
||||
<el-table :data="tableData"
|
||||
:header-cell-style="{ background: '#f2f5fc', color: '#555555' }"
|
||||
border
|
||||
>
|
||||
<el-table-column prop="id" label="ID" width="60">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="分类名" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column prop="operate" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="small" type="success" @click="mod(scope.row)">编辑</el-button>
|
||||
<el-popconfirm
|
||||
title="确定删除吗?"
|
||||
@confirm="del(scope.row.id)"
|
||||
style="margin-left: 5px;"
|
||||
>
|
||||
<el-button slot="reference" size="small" type="danger" >删除</el-button>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pageNum"
|
||||
:page-sizes="[5, 10, 20,30]"
|
||||
:page-size="pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
|
||||
<el-dialog
|
||||
title="提示"
|
||||
:visible.sync="centerDialogVisible"
|
||||
width="30%"
|
||||
center>
|
||||
|
||||
<el-form ref="form" :rules="rules" :model="form" label-width="80px">
|
||||
<el-form-item label="分类名" prop="name">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form.name"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-col :span="20">
|
||||
<el-input type="textarea" v-model="form.remark"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="centerDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="save">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "GoodstypeManage",
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
pageSize:10,
|
||||
pageNum:1,
|
||||
total:0,
|
||||
name:'',
|
||||
centerDialogVisible:false,
|
||||
form:{
|
||||
id:'',
|
||||
name:'',
|
||||
remark:''
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入分类名', trigger: 'blur'}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
resetForm() {
|
||||
this.$refs.form.resetFields();
|
||||
this.form.id=''
|
||||
},
|
||||
del(id){
|
||||
console.log(id)
|
||||
|
||||
this.$axios.get(this.$httpUrl+'/goodstype/del?id='+id).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.loadPost()
|
||||
}else{
|
||||
this.$message({
|
||||
message: '操作失败!',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
mod(row){
|
||||
this.centerDialogVisible = true
|
||||
this.$nextTick(()=>{
|
||||
//赋值到表单
|
||||
this.form.id = row.id
|
||||
this.form.name = row.name
|
||||
this.form.remark = row.remark
|
||||
})
|
||||
},
|
||||
add(){
|
||||
|
||||
this.centerDialogVisible = true
|
||||
this.$nextTick(()=>{
|
||||
this.resetForm()
|
||||
})
|
||||
|
||||
},
|
||||
doSave(){
|
||||
this.$axios.post(this.$httpUrl+'/goodstype/save',this.form).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.centerDialogVisible = false
|
||||
this.loadPost()
|
||||
this. resetForm()
|
||||
}else{
|
||||
this.$message({
|
||||
message: '操作失败!',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
doMod(){
|
||||
this.$axios.post(this.$httpUrl+'/goodstype/update',this.form).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.centerDialogVisible = false
|
||||
this.loadPost()
|
||||
this. resetForm()
|
||||
}else{
|
||||
this.$message({
|
||||
message: '操作失败!',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
save(){
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
if(this.form.id){
|
||||
this.doMod();
|
||||
}else{
|
||||
this.doSave();
|
||||
}
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
console.log(`每页 ${val} 条`);
|
||||
this.pageNum=1
|
||||
this.pageSize=val
|
||||
this.loadPost()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
console.log(`当前页: ${val}`);
|
||||
this.pageNum=val
|
||||
this.loadPost()
|
||||
},
|
||||
resetParam(){
|
||||
this.name=''
|
||||
},
|
||||
loadPost(){
|
||||
this.$axios.post(this.$httpUrl+'/goodstype/listPage',{
|
||||
pageSize:this.pageSize,
|
||||
pageNum:this.pageNum,
|
||||
param:{
|
||||
name:this.name
|
||||
}
|
||||
}).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
this.tableData=res.data
|
||||
this.total=res.total
|
||||
}else{
|
||||
alert('获取数据失败')
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
beforeMount() {
|
||||
this.loadPost()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@ -1,181 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="margin-bottom: 5px;text-align: center;">
|
||||
<el-input v-model="name" placeholder="请输入物品名" suffix-icon="el-icon-search" style="width: 200px;"
|
||||
@keyup.enter.native="loadPost"></el-input>
|
||||
<el-select v-model="storage" placeholder="请选择仓库" style="margin-left: 5px;">
|
||||
<el-option
|
||||
v-for="item in storageData"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select v-model="goodstype" placeholder="请选择分类" style="margin-left: 5px;">
|
||||
<el-option
|
||||
v-for="item in goodstypeData"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
<el-button type="primary" style="margin-left: 5px;" @click="loadPost">查询</el-button>
|
||||
<el-button type="success" @click="resetParam">重置</el-button>
|
||||
|
||||
|
||||
</div>
|
||||
<el-table :data="tableData"
|
||||
:header-cell-style="{ background: '#f2f5fc', color: '#555555' }"
|
||||
border
|
||||
>
|
||||
<el-table-column prop="id" label="ID" width="60">
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodsname" label="物品名" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="storagename" label="仓库" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodstypename" label="分类" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="adminname" label="操作人" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="username" label="申请人" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="count" label="数量" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="createtime" label="操作时间" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pageNum"
|
||||
:page-sizes="[5, 10, 20,30]"
|
||||
:page-size="pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "RecordManage",
|
||||
data() {
|
||||
|
||||
return {
|
||||
user : JSON.parse(sessionStorage.getItem('CurUser')),
|
||||
storageData:[],
|
||||
goodstypeData:[],
|
||||
tableData: [],
|
||||
pageSize:10,
|
||||
pageNum:1,
|
||||
total:0,
|
||||
name:'',
|
||||
storage:'',
|
||||
goodstype:'',
|
||||
centerDialogVisible:false,
|
||||
form:{
|
||||
id:'',
|
||||
name:'',
|
||||
storage:'',
|
||||
goodstype:'',
|
||||
count:'',
|
||||
remark:''
|
||||
},
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
formatStorage(row){
|
||||
let temp = this.storageData.find(item=>{
|
||||
return item.id == row.storage
|
||||
})
|
||||
|
||||
return temp && temp.name
|
||||
},
|
||||
formatGoodstype(row){
|
||||
let temp = this.goodstypeData.find(item=>{
|
||||
return item.id == row.goodstype
|
||||
})
|
||||
|
||||
return temp && temp.name
|
||||
},
|
||||
resetForm() {
|
||||
this.$refs.form.resetFields();
|
||||
this.form.id=''
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
console.log(`每页 ${val} 条`);
|
||||
this.pageNum=1
|
||||
this.pageSize=val
|
||||
this.loadPost()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
console.log(`当前页: ${val}`);
|
||||
this.pageNum=val
|
||||
this.loadPost()
|
||||
},
|
||||
resetParam(){
|
||||
this.name=''
|
||||
this.storage=''
|
||||
this.goodstype=''
|
||||
},
|
||||
loadStorage(){
|
||||
this.$axios.get(this.$httpUrl+'/storage/list').then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
this.storageData=res.data
|
||||
}else{
|
||||
alert('获取数据失败')
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
loadGoodstype(){
|
||||
this.$axios.get(this.$httpUrl+'/goodstype/list').then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
this.goodstypeData=res.data
|
||||
}else{
|
||||
alert('获取数据失败')
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
loadPost(){
|
||||
this.$axios.post(this.$httpUrl+'/record/listPage',{
|
||||
pageSize:this.pageSize,
|
||||
pageNum:this.pageNum,
|
||||
param:{
|
||||
name:this.name,
|
||||
goodstype:this.goodstype+'',
|
||||
storage:this.storage+'',
|
||||
roleId:this.user.roleId+'',
|
||||
userId:this.user.id+''
|
||||
}
|
||||
}).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
this.tableData=res.data
|
||||
this.total=res.total
|
||||
}else{
|
||||
alert('获取数据失败')
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
},
|
||||
beforeMount() {
|
||||
this.loadStorage()
|
||||
this.loadGoodstype()
|
||||
this.loadPost()
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@ -1,234 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="margin-bottom: 5px;text-align: center;">
|
||||
<el-input v-model="name" placeholder="请输入仓库名" suffix-icon="el-icon-search" style="width: 200px;"
|
||||
@keyup.enter.native="loadPost"></el-input>
|
||||
<el-button type="primary" style="margin-left: 5px;" @click="loadPost">查询</el-button>
|
||||
<el-button type="success" @click="resetParam">重置</el-button>
|
||||
|
||||
<el-button type="primary" style="margin-left: 5px;" @click="add">新增</el-button>
|
||||
</div>
|
||||
<el-table :data="tableData"
|
||||
:header-cell-style="{ background: '#f2f5fc', color: '#555555' }"
|
||||
border
|
||||
>
|
||||
<el-table-column prop="id" label="ID" width="60">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="仓库名" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column prop="operate" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="small" type="success" @click="mod(scope.row)">编辑</el-button>
|
||||
<el-popconfirm
|
||||
title="确定删除吗?"
|
||||
@confirm="del(scope.row.id)"
|
||||
style="margin-left: 5px;"
|
||||
>
|
||||
<el-button slot="reference" size="small" type="danger" >删除</el-button>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pageNum"
|
||||
:page-sizes="[5, 10, 20,30]"
|
||||
:page-size="pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
|
||||
<el-dialog
|
||||
title="提示"
|
||||
:visible.sync="centerDialogVisible"
|
||||
width="30%"
|
||||
center>
|
||||
|
||||
<el-form ref="form" :rules="rules" :model="form" label-width="80px">
|
||||
<el-form-item label="仓库名" prop="name">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form.name"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-col :span="20">
|
||||
<el-input type="textarea" v-model="form.remark"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="centerDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="save">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "StorageManage",
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
pageSize:10,
|
||||
pageNum:1,
|
||||
total:0,
|
||||
name:'',
|
||||
centerDialogVisible:false,
|
||||
form:{
|
||||
id:'',
|
||||
name:'',
|
||||
remark:''
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入仓库名', trigger: 'blur'}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
resetForm() {
|
||||
this.$refs.form.resetFields();
|
||||
this.form.id=''
|
||||
},
|
||||
del(id){
|
||||
console.log(id)
|
||||
|
||||
this.$axios.get(this.$httpUrl+'/storage/del?id='+id).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.loadPost()
|
||||
}else{
|
||||
this.$message({
|
||||
message: '操作失败!',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
mod(row){
|
||||
this.centerDialogVisible = true
|
||||
this.$nextTick(()=>{
|
||||
//赋值到表单
|
||||
this.form.id = row.id
|
||||
this.form.name = row.name
|
||||
this.form.remark = row.remark
|
||||
})
|
||||
},
|
||||
add(){
|
||||
|
||||
this.centerDialogVisible = true
|
||||
this.$nextTick(()=>{
|
||||
this.resetForm()
|
||||
})
|
||||
|
||||
},
|
||||
doSave(){
|
||||
this.$axios.post(this.$httpUrl+'/storage/save',this.form).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.centerDialogVisible = false
|
||||
this.loadPost()
|
||||
this. resetForm()
|
||||
}else{
|
||||
this.$message({
|
||||
message: '操作失败!',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
doMod(){
|
||||
this.$axios.post(this.$httpUrl+'/storage/update',this.form).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.centerDialogVisible = false
|
||||
this.loadPost()
|
||||
this. resetForm()
|
||||
}else{
|
||||
this.$message({
|
||||
message: '操作失败!',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
save(){
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
if(this.form.id){
|
||||
this.doMod();
|
||||
}else{
|
||||
this.doSave();
|
||||
}
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
console.log(`每页 ${val} 条`);
|
||||
this.pageNum=1
|
||||
this.pageSize=val
|
||||
this.loadPost()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
console.log(`当前页: ${val}`);
|
||||
this.pageNum=val
|
||||
this.loadPost()
|
||||
},
|
||||
resetParam(){
|
||||
this.name=''
|
||||
},
|
||||
loadPost(){
|
||||
this.$axios.post(this.$httpUrl+'/storage/listPage',{
|
||||
pageSize:this.pageSize,
|
||||
pageNum:this.pageNum,
|
||||
param:{
|
||||
name:this.name
|
||||
}
|
||||
}).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
this.tableData=res.data
|
||||
this.total=res.total
|
||||
}else{
|
||||
alert('获取数据失败')
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
beforeMount() {
|
||||
this.loadPost()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@ -1,346 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="margin-bottom: 5px;">
|
||||
<el-input v-model="name" placeholder="请输入名字" suffix-icon="el-icon-search" style="width: 200px;"
|
||||
@keyup.enter.native="loadPost"></el-input>
|
||||
<el-select v-model="sex" filterable placeholder="请选择性别" style="margin-left: 5px;">
|
||||
<el-option
|
||||
v-for="item in sexs"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button type="primary" style="margin-left: 5px;" @click="loadPost">查询</el-button>
|
||||
<el-button type="success" @click="resetParam">重置</el-button>
|
||||
|
||||
</div>
|
||||
<el-table :data="tableData"
|
||||
:header-cell-style="{ background: '#f2f5fc', color: '#555555' }"
|
||||
border
|
||||
highlight-current-row
|
||||
@current-change="selectCurrentChange"
|
||||
>
|
||||
<el-table-column prop="id" label="ID" width="60">
|
||||
</el-table-column>
|
||||
<el-table-column prop="no" label="账号" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="姓名" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="age" label="年龄" width="80">
|
||||
</el-table-column>
|
||||
<el-table-column prop="sex" label="性别" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-tag
|
||||
:type="scope.row.sex === 1 ? 'primary' : 'success'"
|
||||
disable-transitions>{{scope.row.sex === 1 ? '男' : '女'}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="roleId" label="角色" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-tag
|
||||
:type="scope.row.roleId === 0 ? 'danger' : (scope.row.roleId === 1 ? 'primary' : 'success')"
|
||||
disable-transitions>{{scope.row.roleId === 0 ? '超级管理员' :
|
||||
(scope.row.roleId === 1 ? '管理员' : '用户')}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="phone" label="电话">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pageNum"
|
||||
:page-sizes="[5, 10, 20,30]"
|
||||
:page-size="pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
|
||||
<el-dialog
|
||||
title="提示"
|
||||
:visible.sync="centerDialogVisible"
|
||||
width="30%"
|
||||
center>
|
||||
|
||||
<el-form ref="form" :rules="rules" :model="form" label-width="80px">
|
||||
<el-form-item label="账号" prop="no">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form.no"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="名字" prop="name">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form.name"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="密码" prop="password">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form.password"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="年龄" prop="age">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form.age"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="性别">
|
||||
<el-radio-group v-model="form.sex">
|
||||
<el-radio label="1">男</el-radio>
|
||||
<el-radio label="0">女</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="电话" prop="phone">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form.phone"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="centerDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="save">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "SelectUser",
|
||||
data() {
|
||||
let checkAge = (rule, value, callback) => {
|
||||
if(value>150){
|
||||
callback(new Error('年龄输入过大'));
|
||||
}else{
|
||||
callback();
|
||||
}
|
||||
};
|
||||
let checkDuplicate =(rule,value,callback)=>{
|
||||
if(this.form.id){
|
||||
return callback();
|
||||
}
|
||||
this.$axios.get(this.$httpUrl+"/user/findByNo?no="+this.form.no).then(res=>res.data).then(res=>{
|
||||
if(res.code!=200){
|
||||
|
||||
callback()
|
||||
}else{
|
||||
callback(new Error('账号已经存在'));
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
return {
|
||||
tableData: [],
|
||||
pageSize:10,
|
||||
pageNum:1,
|
||||
total:0,
|
||||
name:'',
|
||||
sex:'',
|
||||
sexs:[
|
||||
{
|
||||
value: '1',
|
||||
label: '男'
|
||||
}, {
|
||||
value: '0',
|
||||
label: '女'
|
||||
}
|
||||
],
|
||||
centerDialogVisible:false,
|
||||
form:{
|
||||
id:'',
|
||||
no:'',
|
||||
name:'',
|
||||
password:'',
|
||||
age:'',
|
||||
phone:'',
|
||||
sex:'0',
|
||||
roleId:'2'
|
||||
},
|
||||
rules: {
|
||||
no: [
|
||||
{required: true, message: '请输入账号', trigger: 'blur'},
|
||||
{min: 3, max: 8, message: '长度在 3 到 8 个字符', trigger: 'blur'},
|
||||
{validator:checkDuplicate,trigger: 'blur'}
|
||||
],
|
||||
name: [
|
||||
{required: true, message: '请输入名字', trigger: 'blur'}
|
||||
],
|
||||
password: [
|
||||
{required: true, message: '请输入密码', trigger: 'blur'},
|
||||
{min: 3, max: 8, message: '长度在 3 到 8 个字符', trigger: 'blur'}
|
||||
],
|
||||
age: [
|
||||
{required: true, message: '请输入年龄', trigger: 'blur'},
|
||||
{min: 1, max: 3, message: '长度在 1 到 3 个位', trigger: 'blur'},
|
||||
{pattern: /^([1-9][0-9]*){1,3}$/,message: '年龄必须为正整数字',trigger: "blur"},
|
||||
{validator:checkAge,trigger: 'blur'}
|
||||
],
|
||||
phone: [
|
||||
{required: true,message: "手机号不能为空",trigger: "blur"},
|
||||
{pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur"}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
resetForm() {
|
||||
this.$refs.form.resetFields();
|
||||
this.form.id=''
|
||||
},
|
||||
del(id){
|
||||
console.log(id)
|
||||
|
||||
this.$axios.get(this.$httpUrl+'/user/del?id='+id).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.loadPost()
|
||||
}else{
|
||||
this.$message({
|
||||
message: '操作失败!',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
mod(row){
|
||||
console.log(row)
|
||||
|
||||
this.centerDialogVisible = true
|
||||
this.$nextTick(()=>{
|
||||
//赋值到表单
|
||||
this.form.id = row.id
|
||||
this.form.no = row.no
|
||||
this.form.name = row.name
|
||||
this.form.password = ''
|
||||
this.form.age = row.age +''
|
||||
this.form.sex = row.sex +''
|
||||
this.form.phone = row.phone
|
||||
this.form.roleId = row.roleId
|
||||
})
|
||||
},
|
||||
add(){
|
||||
|
||||
this.centerDialogVisible = true
|
||||
this.$nextTick(()=>{
|
||||
this.resetForm()
|
||||
})
|
||||
|
||||
},
|
||||
doSave(){
|
||||
this.$axios.post(this.$httpUrl+'/user/save',this.form).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.centerDialogVisible = false
|
||||
this.loadPost()
|
||||
this. resetForm()
|
||||
}else{
|
||||
this.$message({
|
||||
message: '操作失败!',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
doMod(){
|
||||
this.$axios.post(this.$httpUrl+'/user/update',this.form).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.centerDialogVisible = false
|
||||
this.loadPost()
|
||||
this. resetForm()
|
||||
}else{
|
||||
this.$message({
|
||||
message: '操作失败!',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
save(){
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
if(this.form.id){
|
||||
this.doMod();
|
||||
}else{
|
||||
this.doSave();
|
||||
}
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
console.log(`每页 ${val} 条`);
|
||||
this.pageNum=1
|
||||
this.pageSize=val
|
||||
this.loadPost()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
console.log(`当前页: ${val}`);
|
||||
this.pageNum=val
|
||||
this.loadPost()
|
||||
},
|
||||
loadGet(){
|
||||
this.$axios.get(this.$httpUrl+'/user/list').then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
resetParam(){
|
||||
this.name=''
|
||||
this.sex=''
|
||||
},
|
||||
selectCurrentChange(val) {
|
||||
//this.currentRow = val;
|
||||
this.$emit("doSelectUser",val)
|
||||
},
|
||||
loadPost(){
|
||||
this.$axios.post(this.$httpUrl+'/user/listPageC1',{
|
||||
pageSize:this.pageSize,
|
||||
pageNum:this.pageNum,
|
||||
param:{
|
||||
name:this.name,
|
||||
sex:this.sex,
|
||||
roleId:'2'
|
||||
}
|
||||
}).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
this.tableData=res.data
|
||||
this.total=res.total
|
||||
}else{
|
||||
alert('获取数据失败')
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
beforeMount() {
|
||||
//this.loadGet();
|
||||
this.loadPost()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@ -1,353 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="margin-bottom: 5px;text-align: center;">
|
||||
<el-input v-model="name" placeholder="请输入名字" suffix-icon="el-icon-search" style="width: 200px;"
|
||||
@keyup.enter.native="loadPost"></el-input>
|
||||
<el-select v-model="sex" filterable placeholder="请选择性别" style="margin-left: 5px;">
|
||||
<el-option
|
||||
v-for="item in sexs"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button type="primary" style="margin-left: 5px;" @click="loadPost">查询</el-button>
|
||||
<el-button type="success" @click="resetParam">重置</el-button>
|
||||
|
||||
<el-button type="primary" style="margin-left: 5px;" @click="add">新增</el-button>
|
||||
</div>
|
||||
<el-table :data="tableData"
|
||||
:header-cell-style="{ background: '#f2f5fc', color: '#555555' }"
|
||||
border
|
||||
>
|
||||
<el-table-column prop="id" label="ID" width="60">
|
||||
</el-table-column>
|
||||
<el-table-column prop="no" label="账号" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="姓名" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="age" label="年龄" width="80">
|
||||
</el-table-column>
|
||||
<el-table-column prop="sex" label="性别" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-tag
|
||||
:type="scope.row.sex === 1 ? 'primary' : 'success'"
|
||||
disable-transitions>{{scope.row.sex === 1 ? '男' : '女'}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="roleId" label="角色" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-tag
|
||||
:type="scope.row.roleId === 0 ? 'danger' : (scope.row.roleId === 1 ? 'primary' : 'success')"
|
||||
disable-transitions>{{scope.row.roleId === 0 ? '超级管理员' :
|
||||
(scope.row.roleId === 1 ? '管理员' : '用户')}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="phone" label="电话" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="operate" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="small" type="success" @click="mod(scope.row)">编辑</el-button>
|
||||
<el-popconfirm
|
||||
title="确定删除吗?"
|
||||
@confirm="del(scope.row.id)"
|
||||
style="margin-left: 5px;"
|
||||
>
|
||||
<el-button slot="reference" size="small" type="danger" >删除</el-button>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pageNum"
|
||||
:page-sizes="[5, 10, 20,30]"
|
||||
:page-size="pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
|
||||
<el-dialog
|
||||
title="提示"
|
||||
:visible.sync="centerDialogVisible"
|
||||
width="30%"
|
||||
center>
|
||||
|
||||
<el-form ref="form" :rules="rules" :model="form" label-width="80px">
|
||||
<el-form-item label="账号" prop="no">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form.no"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="名字" prop="name">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form.name"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="密码" prop="password">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form.password"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="年龄" prop="age">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form.age"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="性别">
|
||||
<el-radio-group v-model="form.sex">
|
||||
<el-radio label="1">男</el-radio>
|
||||
<el-radio label="0">女</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="电话" prop="phone">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="form.phone"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="centerDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="save">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "UserManage",
|
||||
data() {
|
||||
let checkAge = (rule, value, callback) => {
|
||||
if(value>150){
|
||||
callback(new Error('年龄输入过大'));
|
||||
}else{
|
||||
callback();
|
||||
}
|
||||
};
|
||||
let checkDuplicate =(rule,value,callback)=>{
|
||||
if(this.form.id){
|
||||
return callback();
|
||||
}
|
||||
this.$axios.get(this.$httpUrl+"/user/findByNo?no="+this.form.no).then(res=>res.data).then(res=>{
|
||||
if(res.code!=200){
|
||||
|
||||
callback()
|
||||
}else{
|
||||
callback(new Error('账号已经存在'));
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
return {
|
||||
tableData: [],
|
||||
pageSize:10,
|
||||
pageNum:1,
|
||||
total:0,
|
||||
name:'',
|
||||
sex:'',
|
||||
sexs:[
|
||||
{
|
||||
value: '1',
|
||||
label: '男'
|
||||
}, {
|
||||
value: '0',
|
||||
label: '女'
|
||||
}
|
||||
],
|
||||
centerDialogVisible:false,
|
||||
form:{
|
||||
id:'',
|
||||
no:'',
|
||||
name:'',
|
||||
password:'',
|
||||
age:'',
|
||||
phone:'',
|
||||
sex:'0',
|
||||
roleId:'2'
|
||||
},
|
||||
rules: {
|
||||
no: [
|
||||
{required: true, message: '请输入账号', trigger: 'blur'},
|
||||
{min: 3, max: 8, message: '长度在 3 到 8 个字符', trigger: 'blur'},
|
||||
{validator:checkDuplicate,trigger: 'blur'}
|
||||
],
|
||||
name: [
|
||||
{required: true, message: '请输入名字', trigger: 'blur'}
|
||||
],
|
||||
password: [
|
||||
{required: true, message: '请输入密码', trigger: 'blur'},
|
||||
{min: 3, max: 8, message: '长度在 3 到 8 个字符', trigger: 'blur'}
|
||||
],
|
||||
age: [
|
||||
{required: true, message: '请输入年龄', trigger: 'blur'},
|
||||
{min: 1, max: 3, message: '长度在 1 到 3 个位', trigger: 'blur'},
|
||||
{pattern: /^([1-9][0-9]*){1,3}$/,message: '年龄必须为正整数字',trigger: "blur"},
|
||||
{validator:checkAge,trigger: 'blur'}
|
||||
],
|
||||
phone: [
|
||||
{required: true,message: "手机号不能为空",trigger: "blur"},
|
||||
{pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur"}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
resetForm() {
|
||||
this.$refs.form.resetFields();
|
||||
this.form.id=''
|
||||
},
|
||||
del(id){
|
||||
console.log(id)
|
||||
|
||||
this.$axios.get(this.$httpUrl+'/user/del?id='+id).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.loadPost()
|
||||
}else{
|
||||
this.$message({
|
||||
message: '操作失败!',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
mod(row){
|
||||
console.log(row)
|
||||
|
||||
this.centerDialogVisible = true
|
||||
this.$nextTick(()=>{
|
||||
//赋值到表单
|
||||
this.form.id = row.id
|
||||
this.form.no = row.no
|
||||
this.form.name = row.name
|
||||
this.form.password = ''
|
||||
this.form.age = row.age +''
|
||||
this.form.sex = row.sex +''
|
||||
this.form.phone = row.phone
|
||||
this.form.roleId = row.roleId
|
||||
})
|
||||
},
|
||||
add(){
|
||||
|
||||
this.centerDialogVisible = true
|
||||
this.$nextTick(()=>{
|
||||
this.resetForm()
|
||||
})
|
||||
|
||||
},
|
||||
doSave(){
|
||||
this.$axios.post(this.$httpUrl+'/user/save',this.form).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.centerDialogVisible = false
|
||||
this.loadPost()
|
||||
this. resetForm()
|
||||
}else{
|
||||
this.$message({
|
||||
message: '操作失败!',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
doMod(){
|
||||
this.$axios.post(this.$httpUrl+'/user/update',this.form).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
|
||||
this.$message({
|
||||
message: '操作成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.centerDialogVisible = false
|
||||
this.loadPost()
|
||||
this. resetForm()
|
||||
}else{
|
||||
this.$message({
|
||||
message: '操作失败!',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
save(){
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
if(this.form.id){
|
||||
this.doMod();
|
||||
}else{
|
||||
this.doSave();
|
||||
}
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
console.log(`每页 ${val} 条`);
|
||||
this.pageNum=1
|
||||
this.pageSize=val
|
||||
this.loadPost()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
console.log(`当前页: ${val}`);
|
||||
this.pageNum=val
|
||||
this.loadPost()
|
||||
},
|
||||
loadGet(){
|
||||
this.$axios.get(this.$httpUrl+'/user/list').then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
resetParam(){
|
||||
this.name=''
|
||||
this.sex=''
|
||||
},
|
||||
loadPost(){
|
||||
this.$axios.post(this.$httpUrl+'/user/listPageC1',{
|
||||
pageSize:this.pageSize,
|
||||
pageNum:this.pageNum,
|
||||
param:{
|
||||
name:this.name,
|
||||
sex:this.sex,
|
||||
roleId:'2'
|
||||
}
|
||||
}).then(res=>res.data).then(res=>{
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
this.tableData=res.data
|
||||
this.total=res.total
|
||||
}else{
|
||||
alert('获取数据失败')
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
beforeMount() {
|
||||
//this.loadGet();
|
||||
this.loadPost()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@ -1,20 +0,0 @@
|
||||
import Vue from 'vue'
|
||||
import App from './App.vue'
|
||||
import ElementUI from 'element-ui';
|
||||
import 'element-ui/lib/theme-chalk/index.css';
|
||||
import './assets/global.css';
|
||||
import axios from "axios";
|
||||
import VueRouter from 'vue-router';
|
||||
import router from './router';
|
||||
import store from './store';
|
||||
Vue.prototype.$axios=axios;
|
||||
Vue.prototype.$httpUrl='http://localhost:8090'
|
||||
Vue.config.productionTip = false
|
||||
//Vue.use(ElementUI);
|
||||
Vue.use(VueRouter);
|
||||
Vue.use(ElementUI,{size:'small'});
|
||||
new Vue({
|
||||
router,
|
||||
store,
|
||||
render: h => h(App),
|
||||
}).$mount('#app')
|
||||
@ -1,63 +0,0 @@
|
||||
|
||||
import VueRouter from 'vue-router';
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path:'/',
|
||||
name:'login',
|
||||
component:()=>import('../components/Login')
|
||||
},
|
||||
{
|
||||
path: "/Register",
|
||||
name: "register",
|
||||
component: () => import("../components/Register"),
|
||||
},
|
||||
{
|
||||
path:'/Index',
|
||||
name:'index',
|
||||
component:()=>import('../components/Index'),
|
||||
children:[
|
||||
{
|
||||
path:'/Home',
|
||||
name:'home',
|
||||
meta:{
|
||||
title:'首页'
|
||||
},
|
||||
component:()=>import('../components/Home')
|
||||
},
|
||||
/*{
|
||||
path:'/Admin',
|
||||
name:'admin',
|
||||
meta:{
|
||||
title:'管理员管理'
|
||||
},
|
||||
component:()=>import('../components/admin/AdminManage.vue')
|
||||
},
|
||||
{
|
||||
path:'/User',
|
||||
name:'user',
|
||||
meta:{
|
||||
title:'用户管理'
|
||||
},
|
||||
component:()=>import('../components/user/UserManage.vue')
|
||||
},*/
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
const router = new VueRouter({
|
||||
mode:'history',
|
||||
routes
|
||||
})
|
||||
|
||||
export function resetRouter() {
|
||||
router.matcher = new VueRouter({
|
||||
mode:'history',
|
||||
routes: []
|
||||
}).matcher
|
||||
}
|
||||
const VueRouterPush = VueRouter.prototype.push
|
||||
VueRouter.prototype.push = function push (to) {
|
||||
return VueRouterPush.call(this, to).catch(err => err)
|
||||
}
|
||||
export default router;
|
||||
@ -1,54 +0,0 @@
|
||||
import vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
import router,{resetRouter} from "../router";
|
||||
import createPersistedState from "vuex-persistedstate";
|
||||
vue.use(Vuex)
|
||||
|
||||
function addNewRoute(menuList) {
|
||||
console.log(menuList)
|
||||
let routes = router.options.routes
|
||||
console.log(routes)
|
||||
routes.forEach(routeItem=>{
|
||||
if(routeItem.path=="/Index"){
|
||||
menuList.forEach(menu=>{
|
||||
let childRoute = {
|
||||
path:'/'+menu.menuclick,
|
||||
name:menu.menuname,
|
||||
meta:{
|
||||
title:menu.menuname
|
||||
},
|
||||
component:()=>import('../components/'+menu.menucomponent)
|
||||
}
|
||||
|
||||
routeItem.children.push(childRoute)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
resetRouter()
|
||||
router.addRoutes(routes)
|
||||
}
|
||||
|
||||
export default new Vuex.Store({
|
||||
state: {
|
||||
menu: []
|
||||
},
|
||||
mutations: {
|
||||
setMenu(state,menuList) {
|
||||
state.menu = menuList;
|
||||
|
||||
addNewRoute(menuList)
|
||||
|
||||
},
|
||||
setRouter(state,menuList) {
|
||||
|
||||
addNewRoute(menuList)
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
getMenu(state) {
|
||||
return state.menu;
|
||||
}
|
||||
},
|
||||
plugins:[createPersistedState()]
|
||||
})
|
||||
@ -1,4 +0,0 @@
|
||||
const { defineConfig } = require('@vue/cli-service')
|
||||
module.exports = defineConfig({
|
||||
transpileDependencies: true
|
||||
})
|
||||
Binary file not shown.
@ -1,33 +0,0 @@
|
||||
HELP.md
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
Binary file not shown.
@ -1,2 +0,0 @@
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.5/apache-maven-3.8.5-bin.zip
|
||||
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
|
||||
@ -1,308 +0,0 @@
|
||||
#!/bin/sh
|
||||
# ----------------------------------------------------------------------------
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Apache Maven Wrapper startup batch script, version 3.2.0
|
||||
#
|
||||
# Required ENV vars:
|
||||
# ------------------
|
||||
# JAVA_HOME - location of a JDK home dir
|
||||
#
|
||||
# Optional ENV vars
|
||||
# -----------------
|
||||
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
# e.g. to debug Maven itself, use
|
||||
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
if [ -z "$MAVEN_SKIP_RC" ] ; then
|
||||
|
||||
if [ -f /usr/local/etc/mavenrc ] ; then
|
||||
. /usr/local/etc/mavenrc
|
||||
fi
|
||||
|
||||
if [ -f /etc/mavenrc ] ; then
|
||||
. /etc/mavenrc
|
||||
fi
|
||||
|
||||
if [ -f "$HOME/.mavenrc" ] ; then
|
||||
. "$HOME/.mavenrc"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# OS specific support. $var _must_ be set to either true or false.
|
||||
cygwin=false;
|
||||
darwin=false;
|
||||
mingw=false
|
||||
case "$(uname)" in
|
||||
CYGWIN*) cygwin=true ;;
|
||||
MINGW*) mingw=true;;
|
||||
Darwin*) darwin=true
|
||||
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
|
||||
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
if [ -x "/usr/libexec/java_home" ]; then
|
||||
JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME
|
||||
else
|
||||
JAVA_HOME="/Library/Java/Home"; export JAVA_HOME
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
if [ -r /etc/gentoo-release ] ; then
|
||||
JAVA_HOME=$(java-config --jre-home)
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
||||
if $cygwin ; then
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=$(cygpath --unix "$JAVA_HOME")
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=$(cygpath --path --unix "$CLASSPATH")
|
||||
fi
|
||||
|
||||
# For Mingw, ensure paths are in UNIX format before anything is touched
|
||||
if $mingw ; then
|
||||
[ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] &&
|
||||
JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); pwd)"
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
javaExecutable="$(which javac)"
|
||||
if [ -n "$javaExecutable" ] && ! [ "$(expr "\"$javaExecutable\"" : '\([^ ]*\)')" = "no" ]; then
|
||||
# readlink(1) is not available as standard on Solaris 10.
|
||||
readLink=$(which readlink)
|
||||
if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then
|
||||
if $darwin ; then
|
||||
javaHome="$(dirname "\"$javaExecutable\"")"
|
||||
javaExecutable="$(cd "\"$javaHome\"" && pwd -P)/javac"
|
||||
else
|
||||
javaExecutable="$(readlink -f "\"$javaExecutable\"")"
|
||||
fi
|
||||
javaHome="$(dirname "\"$javaExecutable\"")"
|
||||
javaHome=$(expr "$javaHome" : '\(.*\)/bin')
|
||||
JAVA_HOME="$javaHome"
|
||||
export JAVA_HOME
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$JAVACMD" ] ; then
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
else
|
||||
JAVACMD="$(\unset -f command 2>/dev/null; \command -v java)"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
echo "Error: JAVA_HOME is not defined correctly." >&2
|
||||
echo " We cannot execute $JAVACMD" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
echo "Warning: JAVA_HOME environment variable is not set."
|
||||
fi
|
||||
|
||||
# traverses directory structure from process work directory to filesystem root
|
||||
# first directory with .mvn subdirectory is considered project base directory
|
||||
find_maven_basedir() {
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "Path not specified to find_maven_basedir"
|
||||
return 1
|
||||
fi
|
||||
|
||||
basedir="$1"
|
||||
wdir="$1"
|
||||
while [ "$wdir" != '/' ] ; do
|
||||
if [ -d "$wdir"/.mvn ] ; then
|
||||
basedir=$wdir
|
||||
break
|
||||
fi
|
||||
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
|
||||
if [ -d "${wdir}" ]; then
|
||||
wdir=$(cd "$wdir/.." || exit 1; pwd)
|
||||
fi
|
||||
# end of workaround
|
||||
done
|
||||
printf '%s' "$(cd "$basedir" || exit 1; pwd)"
|
||||
}
|
||||
|
||||
# concatenates all lines of a file
|
||||
concat_lines() {
|
||||
if [ -f "$1" ]; then
|
||||
# Remove \r in case we run on Windows within Git Bash
|
||||
# and check out the repository with auto CRLF management
|
||||
# enabled. Otherwise, we may read lines that are delimited with
|
||||
# \r\n and produce $'-Xarg\r' rather than -Xarg due to word
|
||||
# splitting rules.
|
||||
tr -s '\r\n' ' ' < "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
log() {
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
printf '%s\n' "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
BASE_DIR=$(find_maven_basedir "$(dirname "$0")")
|
||||
if [ -z "$BASE_DIR" ]; then
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR
|
||||
log "$MAVEN_PROJECTBASEDIR"
|
||||
|
||||
##########################################################################################
|
||||
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||
# This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||
##########################################################################################
|
||||
wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar"
|
||||
if [ -r "$wrapperJarPath" ]; then
|
||||
log "Found $wrapperJarPath"
|
||||
else
|
||||
log "Couldn't find $wrapperJarPath, downloading it ..."
|
||||
|
||||
if [ -n "$MVNW_REPOURL" ]; then
|
||||
wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
|
||||
else
|
||||
wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
|
||||
fi
|
||||
while IFS="=" read -r key value; do
|
||||
# Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' )
|
||||
safeValue=$(echo "$value" | tr -d '\r')
|
||||
case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;;
|
||||
esac
|
||||
done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
|
||||
log "Downloading from: $wrapperUrl"
|
||||
|
||||
if $cygwin; then
|
||||
wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath")
|
||||
fi
|
||||
|
||||
if command -v wget > /dev/null; then
|
||||
log "Found wget ... using wget"
|
||||
[ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet"
|
||||
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||
wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
|
||||
else
|
||||
wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
|
||||
fi
|
||||
elif command -v curl > /dev/null; then
|
||||
log "Found curl ... using curl"
|
||||
[ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent"
|
||||
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||
curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
|
||||
else
|
||||
curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
|
||||
fi
|
||||
else
|
||||
log "Falling back to using Java to download"
|
||||
javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java"
|
||||
javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class"
|
||||
# For Cygwin, switch paths to Windows format before running javac
|
||||
if $cygwin; then
|
||||
javaSource=$(cygpath --path --windows "$javaSource")
|
||||
javaClass=$(cygpath --path --windows "$javaClass")
|
||||
fi
|
||||
if [ -e "$javaSource" ]; then
|
||||
if [ ! -e "$javaClass" ]; then
|
||||
log " - Compiling MavenWrapperDownloader.java ..."
|
||||
("$JAVA_HOME/bin/javac" "$javaSource")
|
||||
fi
|
||||
if [ -e "$javaClass" ]; then
|
||||
log " - Running MavenWrapperDownloader.java ..."
|
||||
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
##########################################################################################
|
||||
# End of extension
|
||||
##########################################################################################
|
||||
|
||||
# If specified, validate the SHA-256 sum of the Maven wrapper jar file
|
||||
wrapperSha256Sum=""
|
||||
while IFS="=" read -r key value; do
|
||||
case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;;
|
||||
esac
|
||||
done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
|
||||
if [ -n "$wrapperSha256Sum" ]; then
|
||||
wrapperSha256Result=false
|
||||
if command -v sha256sum > /dev/null; then
|
||||
if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then
|
||||
wrapperSha256Result=true
|
||||
fi
|
||||
elif command -v shasum > /dev/null; then
|
||||
if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then
|
||||
wrapperSha256Result=true
|
||||
fi
|
||||
else
|
||||
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available."
|
||||
echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties."
|
||||
exit 1
|
||||
fi
|
||||
if [ $wrapperSha256Result = false ]; then
|
||||
echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2
|
||||
echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2
|
||||
echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin; then
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME")
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=$(cygpath --path --windows "$CLASSPATH")
|
||||
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
|
||||
MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR")
|
||||
fi
|
||||
|
||||
# Provide a "standardized" way to retrieve the CLI args that will
|
||||
# work with both Windows and non-Windows executions.
|
||||
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*"
|
||||
export MAVEN_CMD_LINE_ARGS
|
||||
|
||||
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
# shellcheck disable=SC2086 # safe args
|
||||
exec "$JAVACMD" \
|
||||
$MAVEN_OPTS \
|
||||
$MAVEN_DEBUG_OPTS \
|
||||
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
|
||||
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
||||
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
|
||||
@ -1,205 +0,0 @@
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Licensed to the Apache Software Foundation (ASF) under one
|
||||
@REM or more contributor license agreements. See the NOTICE file
|
||||
@REM distributed with this work for additional information
|
||||
@REM regarding copyright ownership. The ASF licenses this file
|
||||
@REM to you under the Apache License, Version 2.0 (the
|
||||
@REM "License"); you may not use this file except in compliance
|
||||
@REM with the License. You may obtain a copy of the License at
|
||||
@REM
|
||||
@REM https://www.apache.org/licenses/LICENSE-2.0
|
||||
@REM
|
||||
@REM Unless required by applicable law or agreed to in writing,
|
||||
@REM software distributed under the License is distributed on an
|
||||
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
@REM KIND, either express or implied. See the License for the
|
||||
@REM specific language governing permissions and limitations
|
||||
@REM under the License.
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Apache Maven Wrapper startup batch script, version 3.2.0
|
||||
@REM
|
||||
@REM Required ENV vars:
|
||||
@REM JAVA_HOME - location of a JDK home dir
|
||||
@REM
|
||||
@REM Optional ENV vars
|
||||
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
|
||||
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
|
||||
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
@REM e.g. to debug Maven itself, use
|
||||
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
|
||||
@echo off
|
||||
@REM set title of command window
|
||||
title %0
|
||||
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
|
||||
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
|
||||
|
||||
@REM set %HOME% to equivalent of $HOME
|
||||
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
|
||||
|
||||
@REM Execute a user defined script before this one
|
||||
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
|
||||
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
|
||||
if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
|
||||
:skipRcPre
|
||||
|
||||
@setlocal
|
||||
|
||||
set ERROR_CODE=0
|
||||
|
||||
@REM To isolate internal variables from possible post scripts, we use another setlocal
|
||||
@setlocal
|
||||
|
||||
@REM ==== START VALIDATION ====
|
||||
if not "%JAVA_HOME%" == "" goto OkJHome
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME not found in your environment. >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
:OkJHome
|
||||
if exist "%JAVA_HOME%\bin\java.exe" goto init
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
||||
echo JAVA_HOME = "%JAVA_HOME%" >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
@REM ==== END VALIDATION ====
|
||||
|
||||
:init
|
||||
|
||||
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
|
||||
@REM Fallback to current working directory if not found.
|
||||
|
||||
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
|
||||
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
|
||||
|
||||
set EXEC_DIR=%CD%
|
||||
set WDIR=%EXEC_DIR%
|
||||
:findBaseDir
|
||||
IF EXIST "%WDIR%"\.mvn goto baseDirFound
|
||||
cd ..
|
||||
IF "%WDIR%"=="%CD%" goto baseDirNotFound
|
||||
set WDIR=%CD%
|
||||
goto findBaseDir
|
||||
|
||||
:baseDirFound
|
||||
set MAVEN_PROJECTBASEDIR=%WDIR%
|
||||
cd "%EXEC_DIR%"
|
||||
goto endDetectBaseDir
|
||||
|
||||
:baseDirNotFound
|
||||
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
|
||||
cd "%EXEC_DIR%"
|
||||
|
||||
:endDetectBaseDir
|
||||
|
||||
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
|
||||
|
||||
@setlocal EnableExtensions EnableDelayedExpansion
|
||||
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
|
||||
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
|
||||
|
||||
:endReadAdditionalConfig
|
||||
|
||||
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
||||
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
|
||||
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
|
||||
|
||||
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
|
||||
IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B
|
||||
)
|
||||
|
||||
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||
if exist %WRAPPER_JAR% (
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Found %WRAPPER_JAR%
|
||||
)
|
||||
) else (
|
||||
if not "%MVNW_REPOURL%" == "" (
|
||||
SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
|
||||
)
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Couldn't find %WRAPPER_JAR%, downloading it ...
|
||||
echo Downloading from: %WRAPPER_URL%
|
||||
)
|
||||
|
||||
powershell -Command "&{"^
|
||||
"$webclient = new-object System.Net.WebClient;"^
|
||||
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
|
||||
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
|
||||
"}"^
|
||||
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^
|
||||
"}"
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Finished downloading %WRAPPER_JAR%
|
||||
)
|
||||
)
|
||||
@REM End of extension
|
||||
|
||||
@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file
|
||||
SET WRAPPER_SHA_256_SUM=""
|
||||
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
|
||||
IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B
|
||||
)
|
||||
IF NOT %WRAPPER_SHA_256_SUM%=="" (
|
||||
powershell -Command "&{"^
|
||||
"$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^
|
||||
"If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^
|
||||
" Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^
|
||||
" Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^
|
||||
" Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^
|
||||
" exit 1;"^
|
||||
"}"^
|
||||
"}"
|
||||
if ERRORLEVEL 1 goto error
|
||||
)
|
||||
|
||||
@REM Provide a "standardized" way to retrieve the CLI args that will
|
||||
@REM work with both Windows and non-Windows executions.
|
||||
set MAVEN_CMD_LINE_ARGS=%*
|
||||
|
||||
%MAVEN_JAVA_EXE% ^
|
||||
%JVM_CONFIG_MAVEN_PROPS% ^
|
||||
%MAVEN_OPTS% ^
|
||||
%MAVEN_DEBUG_OPTS% ^
|
||||
-classpath %WRAPPER_JAR% ^
|
||||
"-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
|
||||
%WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
|
||||
if ERRORLEVEL 1 goto error
|
||||
goto end
|
||||
|
||||
:error
|
||||
set ERROR_CODE=1
|
||||
|
||||
:end
|
||||
@endlocal & set ERROR_CODE=%ERROR_CODE%
|
||||
|
||||
if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
|
||||
@REM check for post script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
|
||||
if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
|
||||
:skipRcPost
|
||||
|
||||
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
|
||||
if "%MAVEN_BATCH_PAUSE%"=="on" pause
|
||||
|
||||
if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
|
||||
|
||||
cmd /C exit /B %ERROR_CODE%
|
||||
Binary file not shown.
@ -1,13 +0,0 @@
|
||||
package com.wms;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class WmsApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(WmsApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,20 +0,0 @@
|
||||
package com.wms.common;
|
||||
|
||||
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||
import org.apache.ibatis.reflection.MetaObject;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Component
|
||||
public class AutoFillMetaInfoHandler implements MetaObjectHandler {
|
||||
@Override
|
||||
public void insertFill(MetaObject metaObject) {
|
||||
this.setFieldValByName("createtime", LocalDateTime.now(),metaObject);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFill(MetaObject metaObject) {
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,44 +0,0 @@
|
||||
package com.wms.common;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class CodeCreate {
|
||||
/**
|
||||
* 生成随机字符验证码
|
||||
*
|
||||
* @param length 验证码长度
|
||||
* @return 随机字符验证码
|
||||
*/
|
||||
public static String RandomStringCode(int length) {
|
||||
String characters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
// String characters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
||||
Random random = new Random();
|
||||
StringBuilder code = new StringBuilder();
|
||||
|
||||
for (int i = 0; i < length; i++) {
|
||||
int index = random.nextInt(characters.length());
|
||||
code.append(characters.charAt(index));
|
||||
}
|
||||
|
||||
return code.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成随机数字验证码
|
||||
*
|
||||
* @param length 验证码长度
|
||||
* @return 随机数字验证码
|
||||
*/
|
||||
public static String RandomNumberCode(int length) {
|
||||
String characters = "0123456789";
|
||||
Random random = new Random();
|
||||
StringBuilder code = new StringBuilder();
|
||||
|
||||
for (int i = 0; i < length; i++) {
|
||||
int index = random.nextInt(characters.length());
|
||||
code.append(characters.charAt(index));
|
||||
}
|
||||
|
||||
return code.toString();
|
||||
}
|
||||
}
|
||||
@ -1,22 +0,0 @@
|
||||
package com.wms.common;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
// 案例 一
|
||||
@Configuration
|
||||
public class CorsConfig implements WebMvcConfigurer {
|
||||
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry.addMapping("/**")
|
||||
//是否发送Cookie
|
||||
.allowCredentials(true)
|
||||
//放行哪些原始域
|
||||
.allowedOriginPatterns("*")
|
||||
.allowedMethods(new String[]{"GET", "POST", "PUT", "DELETE"})
|
||||
.allowedHeaders("*")
|
||||
.exposedHeaders("*");
|
||||
}
|
||||
}
|
||||
@ -1,36 +0,0 @@
|
||||
package com.wms.common;
|
||||
import com.google.code.kaptcha.impl.DefaultKaptcha;
|
||||
import com.google.code.kaptcha.util.Config;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
@Configuration
|
||||
public class KaptchaConfig {
|
||||
|
||||
/**
|
||||
* 配置验证码生成器
|
||||
*/
|
||||
@Bean
|
||||
DefaultKaptcha producer() {
|
||||
// 创建属性对象,用于配置验证码生成器
|
||||
Properties properties = new Properties();
|
||||
properties.put("kaptcha.border", "no"); // 设置边框样式为无边框
|
||||
properties.put("kaptcha.textproducer.font.color", "black"); // 设置验证码文字颜色为黑色
|
||||
properties.put("kaptcha.textproducer.char.space", "4"); // 设置验证码字符间距为4个像素
|
||||
properties.put("kaptcha.image.height", "40"); // 设置验证码图片高度为40像素
|
||||
properties.put("kaptcha.image.width", "120"); // 设置验证码图片宽度为120像素
|
||||
properties.put("kaptcha.textproducer.font.size", "30"); // 设置验证码文字大小为30像素
|
||||
|
||||
// 创建配置对象,使用上述属性初始化
|
||||
Config config = new Config(properties);
|
||||
|
||||
// 创建默认的验证码生成器
|
||||
DefaultKaptcha defaultKaptcha = new DefaultKaptcha();
|
||||
defaultKaptcha.setConfig(config); // 将配置对象设置到验证码生成器中
|
||||
|
||||
return defaultKaptcha; // 返回配置好的验证码生成器
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
package com.wms.common;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.DbType;
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class MybatisPlusConfig {
|
||||
|
||||
@Bean
|
||||
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
|
||||
return interceptor;
|
||||
}
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
package com.wms.common;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@Data
|
||||
public class QueryPageParam {
|
||||
//默认
|
||||
private static int PAGE_SIZE=20;
|
||||
private static int PAGE_NUM=1;
|
||||
|
||||
private int pageSize=PAGE_SIZE;
|
||||
private int pageNum=PAGE_NUM;
|
||||
|
||||
private HashMap param = new HashMap();
|
||||
|
||||
}
|
||||
@ -1,40 +0,0 @@
|
||||
package com.wms.common;
|
||||
|
||||
import lombok.Data;
|
||||
@Data
|
||||
public class Result {
|
||||
|
||||
private int code;//编码 200/400
|
||||
private String msg;//成功/失败
|
||||
private Long total;//总记录数
|
||||
private Object data;//数据
|
||||
|
||||
public static Result fail(){
|
||||
return result(400,"失败",0L,null);
|
||||
}
|
||||
public static Result fail(String msg){
|
||||
return result(400,msg,0L,null);
|
||||
}
|
||||
|
||||
public static Result suc(){
|
||||
return result(200,"成功",0L,null);
|
||||
}
|
||||
|
||||
public static Result suc(Object data){
|
||||
return result(200,"成功",0L,data);
|
||||
}
|
||||
|
||||
public static Result suc(Object data,Long total){
|
||||
return result(200,"成功",total,data);
|
||||
}
|
||||
|
||||
private static Result result(int code,String msg,Long total,Object data){
|
||||
Result res = new Result();
|
||||
res.setData(data);
|
||||
res.setMsg(msg);
|
||||
res.setCode(code);
|
||||
res.setTotal(total);
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,73 +0,0 @@
|
||||
package com.wms.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wms.common.QueryPageParam;
|
||||
import com.wms.common.Result;
|
||||
import com.wms.entity.Goods;
|
||||
import com.wms.entity.Goods;
|
||||
import com.wms.service.GoodsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author wms
|
||||
* @since 2022-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/goods")
|
||||
public class GoodsController {
|
||||
|
||||
@Autowired
|
||||
private GoodsService goodsService;
|
||||
//新增
|
||||
@PostMapping("/save")
|
||||
public Result save(@RequestBody Goods goods){
|
||||
return goodsService.save(goods)?Result.suc():Result.fail();
|
||||
}
|
||||
//更新
|
||||
@PostMapping("/update")
|
||||
public Result update(@RequestBody Goods goods){
|
||||
return goodsService.updateById(goods)?Result.suc():Result.fail();
|
||||
}
|
||||
//删除
|
||||
@GetMapping("/del")
|
||||
public Result del(@RequestParam String id){
|
||||
return goodsService.removeById(id)?Result.suc():Result.fail();
|
||||
}
|
||||
|
||||
@PostMapping("/listPage")
|
||||
public Result listPage(@RequestBody QueryPageParam query){
|
||||
HashMap param = query.getParam();
|
||||
String name = (String)param.get("name");
|
||||
String goodstype = (String)param.get("goodstype");
|
||||
String storage = (String)param.get("storage");
|
||||
|
||||
Page<Goods> page = new Page();
|
||||
page.setCurrent(query.getPageNum());
|
||||
page.setSize(query.getPageSize());
|
||||
|
||||
LambdaQueryWrapper<Goods> lambdaQueryWrapper = new LambdaQueryWrapper();
|
||||
if(StringUtils.isNotBlank(name) && !"null".equals(name)){
|
||||
lambdaQueryWrapper.like(Goods::getName,name);
|
||||
}
|
||||
if(StringUtils.isNotBlank(goodstype) && !"null".equals(goodstype)){
|
||||
lambdaQueryWrapper.eq(Goods::getGoodstype,goodstype);
|
||||
}
|
||||
if(StringUtils.isNotBlank(storage) && !"null".equals(storage)){
|
||||
lambdaQueryWrapper.eq(Goods::getStorage,storage);
|
||||
}
|
||||
|
||||
IPage result = goodsService.pageCC(page,lambdaQueryWrapper);
|
||||
return Result.suc(result.getRecords(),result.getTotal());
|
||||
}
|
||||
}
|
||||
@ -1,70 +0,0 @@
|
||||
package com.wms.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wms.common.QueryPageParam;
|
||||
import com.wms.common.Result;
|
||||
import com.wms.entity.Goodstype;
|
||||
import com.wms.entity.Goodstype;
|
||||
import com.wms.service.GoodstypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author wms
|
||||
* @since 2022-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/goodstype")
|
||||
public class GoodstypeController {
|
||||
@Autowired
|
||||
private GoodstypeService goodstypeService;
|
||||
//新增
|
||||
@PostMapping("/save")
|
||||
public Result save(@RequestBody Goodstype goodstype){
|
||||
return goodstypeService.save(goodstype)?Result.suc():Result.fail();
|
||||
}
|
||||
//更新
|
||||
@PostMapping("/update")
|
||||
public Result update(@RequestBody Goodstype goodstype){
|
||||
return goodstypeService.updateById(goodstype)?Result.suc():Result.fail();
|
||||
}
|
||||
//删除
|
||||
@GetMapping("/del")
|
||||
public Result del(@RequestParam String id){
|
||||
return goodstypeService.removeById(id)?Result.suc():Result.fail();
|
||||
}
|
||||
|
||||
@PostMapping("/listPage")
|
||||
public Result listPage(@RequestBody QueryPageParam query){
|
||||
HashMap param = query.getParam();
|
||||
String name = (String)param.get("name");
|
||||
|
||||
Page<Goodstype> page = new Page();
|
||||
page.setCurrent(query.getPageNum());
|
||||
page.setSize(query.getPageSize());
|
||||
|
||||
LambdaQueryWrapper<Goodstype> lambdaQueryWrapper = new LambdaQueryWrapper();
|
||||
if(StringUtils.isNotBlank(name) && !"null".equals(name)){
|
||||
lambdaQueryWrapper.like(Goodstype::getName,name);
|
||||
}
|
||||
|
||||
IPage result = goodstypeService.pageCC(page,lambdaQueryWrapper);
|
||||
return Result.suc(result.getRecords(),result.getTotal());
|
||||
}
|
||||
@GetMapping("/list")
|
||||
public Result list(){
|
||||
List list = goodstypeService.list();
|
||||
return Result.suc(list);
|
||||
}
|
||||
}
|
||||
@ -1,40 +0,0 @@
|
||||
package com.wms.controller;
|
||||
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import com.google.code.kaptcha.Producer;
|
||||
import com.wms.common.CodeCreate;
|
||||
import com.wms.common.Result;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import sun.misc.BASE64Encoder;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
@RestController
|
||||
public class KaptchaController {
|
||||
@Resource
|
||||
Producer producer;
|
||||
|
||||
@GetMapping("/captcha")
|
||||
public Result captcha() throws IOException {
|
||||
String code = CodeCreate.RandomStringCode(4);
|
||||
BufferedImage image = producer.createImage(code);
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
ImageIO.write(image, "jpg", outputStream);
|
||||
BASE64Encoder encoder = new BASE64Encoder();
|
||||
String str = "data:image/jpeg;base64,";
|
||||
String base64Img = str + encoder.encode(outputStream.toByteArray());
|
||||
System.out.println(code);
|
||||
return Result.suc(
|
||||
MapUtil.builder()
|
||||
.put("captchaImg", base64Img)
|
||||
.put("rcode",code)
|
||||
.build()
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,36 +0,0 @@
|
||||
package com.wms.controller;
|
||||
|
||||
|
||||
import com.wms.common.Result;
|
||||
import com.wms.entity.Menu;
|
||||
import com.wms.entity.User;
|
||||
import com.wms.service.MenuService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author wms
|
||||
* @since 2022-10-04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/menu")
|
||||
public class MenuController {
|
||||
|
||||
@Autowired
|
||||
private MenuService menuService;
|
||||
@GetMapping("/list")
|
||||
public Result list(@RequestParam String roleId){
|
||||
List list = menuService.lambdaQuery().like(Menu::getMenuright,roleId).list();
|
||||
return Result.suc(list);
|
||||
}
|
||||
}
|
||||
@ -1,98 +0,0 @@
|
||||
package com.wms.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wms.common.QueryPageParam;
|
||||
import com.wms.common.Result;
|
||||
import com.wms.entity.Goods;
|
||||
import com.wms.entity.Record;
|
||||
import com.wms.service.GoodsService;
|
||||
import com.wms.service.RecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author wms
|
||||
* @since 2022-10-16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/record")
|
||||
public class RecordController {
|
||||
|
||||
@Autowired
|
||||
private RecordService recordService;
|
||||
|
||||
@Autowired
|
||||
private GoodsService goodsService;
|
||||
@PostMapping("/listPage")
|
||||
public Result listPage(@RequestBody QueryPageParam query){
|
||||
HashMap param = query.getParam();
|
||||
String name = (String)param.get("name");
|
||||
String goodstype = (String)param.get("goodstype");
|
||||
String storage = (String)param.get("storage");
|
||||
String roleId = (String)param.get("roleId");
|
||||
String userId = (String)param.get("userId");
|
||||
|
||||
Page<Record> page = new Page();
|
||||
page.setCurrent(query.getPageNum());
|
||||
page.setSize(query.getPageSize());
|
||||
|
||||
QueryWrapper<Record> queryWrapper = new QueryWrapper();
|
||||
queryWrapper.apply(" a.goods=b.id and b.storage=c.id and b.goodsType=d.id ");
|
||||
|
||||
if("2".equals(roleId)){
|
||||
// queryWrapper.eq(Record::getUserid,userId);
|
||||
queryWrapper.apply(" a.userId= "+userId);
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(name) && !"null".equals(name)){
|
||||
queryWrapper.like("b.name",name);
|
||||
}
|
||||
if(StringUtils.isNotBlank(goodstype) && !"null".equals(goodstype)){
|
||||
queryWrapper.eq("d.id",goodstype);
|
||||
}
|
||||
if(StringUtils.isNotBlank(storage) && !"null".equals(storage)){
|
||||
queryWrapper.eq("c.id",storage);
|
||||
}
|
||||
|
||||
IPage result = recordService.pageCC(page,queryWrapper);
|
||||
return Result.suc(result.getRecords(),result.getTotal());
|
||||
}
|
||||
//新增
|
||||
//新增
|
||||
@PostMapping("/save")
|
||||
public Result save(@RequestBody Record record) {
|
||||
System.out.println(record);
|
||||
Goods goods = goodsService.getById(record.getGoods());
|
||||
int n = record.getCount();
|
||||
//出库
|
||||
if ("2".equals(record.getAction())) {
|
||||
n = -n;
|
||||
record.setCount(n);
|
||||
}
|
||||
System.out.println(goods.getCount() + n);
|
||||
if ((goods.getCount() + n) < 0)
|
||||
return Result.fail("仓库物品剩余"+goods.getCount()+"件");
|
||||
else {
|
||||
int num = goods.getCount() + n;
|
||||
goods.setCount(num);
|
||||
goodsService.updateById(goods);
|
||||
return recordService.save(record) ? Result.suc() : Result.fail();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,72 +0,0 @@
|
||||
package com.wms.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wms.common.QueryPageParam;
|
||||
import com.wms.common.Result;
|
||||
import com.wms.entity.Menu;
|
||||
import com.wms.entity.Storage;
|
||||
import com.wms.service.StorageService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author wms
|
||||
* @since 2022-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/storage")
|
||||
public class StorageController {
|
||||
|
||||
@Autowired
|
||||
private StorageService storageService;
|
||||
//新增
|
||||
@PostMapping("/save")
|
||||
public Result save(@RequestBody Storage storage){
|
||||
return storageService.save(storage)?Result.suc():Result.fail();
|
||||
}
|
||||
//更新
|
||||
@PostMapping("/update")
|
||||
public Result update(@RequestBody Storage storage){
|
||||
return storageService.updateById(storage)?Result.suc():Result.fail();
|
||||
}
|
||||
//删除
|
||||
@GetMapping("/del")
|
||||
public Result del(@RequestParam String id){
|
||||
return storageService.removeById(id)?Result.suc():Result.fail();
|
||||
}
|
||||
|
||||
@PostMapping("/listPage")
|
||||
public Result listPage(@RequestBody QueryPageParam query){
|
||||
HashMap param = query.getParam();
|
||||
String name = (String)param.get("name");
|
||||
|
||||
Page<Storage> page = new Page();
|
||||
page.setCurrent(query.getPageNum());
|
||||
page.setSize(query.getPageSize());
|
||||
|
||||
LambdaQueryWrapper<Storage> lambdaQueryWrapper = new LambdaQueryWrapper();
|
||||
if(StringUtils.isNotBlank(name) && !"null".equals(name)){
|
||||
lambdaQueryWrapper.like(Storage::getName,name);
|
||||
}
|
||||
|
||||
IPage result = storageService.pageCC(page,lambdaQueryWrapper);
|
||||
return Result.suc(result.getRecords(),result.getTotal());
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
public Result list(){
|
||||
List list = storageService.list();
|
||||
return Result.suc(list);
|
||||
}
|
||||
}
|
||||
@ -1,198 +0,0 @@
|
||||
package com.wms.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wms.common.QueryPageParam;
|
||||
import com.wms.common.Result;
|
||||
import com.wms.entity.Menu;
|
||||
import com.wms.entity.User;
|
||||
import com.wms.service.MenuService;
|
||||
import com.wms.service.UserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author wms
|
||||
* @since 2022-07-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user")
|
||||
public class UserController {
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
@Autowired
|
||||
private MenuService menuService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public List<User> list(){
|
||||
return userService.list();
|
||||
}
|
||||
@GetMapping("/findByNo")
|
||||
public Result findByNo(@RequestParam String no){
|
||||
List list = userService.lambdaQuery().eq(User::getNo,no).list();
|
||||
return list.size()>0?Result.suc(list):Result.fail();
|
||||
}
|
||||
//新增
|
||||
@PostMapping("/save")
|
||||
public Result save(@RequestBody User user){
|
||||
return userService.save(user)?Result.suc():Result.fail();
|
||||
}
|
||||
|
||||
@PostMapping("/register")
|
||||
public Result register(@RequestBody User user){
|
||||
System.out.println(
|
||||
user.getRoleId()
|
||||
);
|
||||
user.setIsvalid("Y");
|
||||
return userService.save(user)?Result.suc():Result.fail();
|
||||
}
|
||||
|
||||
//更新
|
||||
@PostMapping("/update")
|
||||
public Result update(@RequestBody User user){
|
||||
return userService.updateById(user)?Result.suc():Result.fail();
|
||||
}
|
||||
//删除
|
||||
@GetMapping("/del")
|
||||
public Result del(@RequestParam String id){
|
||||
return userService.removeById(id)?Result.suc():Result.fail();
|
||||
}
|
||||
|
||||
//登录
|
||||
@PostMapping("/login")
|
||||
public Result login(@RequestBody User user){
|
||||
List list = userService.lambdaQuery()
|
||||
.eq(User::getNo,user.getNo())
|
||||
.eq(User::getPassword,user.getPassword()).list();
|
||||
|
||||
|
||||
if(list.size()>0){
|
||||
User user1 = (User)list.get(0);
|
||||
List menuList = menuService.lambdaQuery().like(Menu::getMenuright,user1.getRoleId()).list();
|
||||
HashMap res = new HashMap();
|
||||
res.put("user",user1);
|
||||
res.put("menu",menuList);
|
||||
return Result.suc(res);
|
||||
}
|
||||
return Result.fail();
|
||||
}
|
||||
|
||||
//修改
|
||||
@PostMapping("/mod")
|
||||
public boolean mod(@RequestBody User user){
|
||||
return userService.updateById(user);
|
||||
}
|
||||
//新增或修改
|
||||
@PostMapping("/saveOrMod")
|
||||
public boolean saveOrMod(@RequestBody User user){
|
||||
return userService.saveOrUpdate(user);
|
||||
}
|
||||
//删除
|
||||
@GetMapping("/delete")
|
||||
public boolean delete(Integer id){
|
||||
return userService.removeById(id);
|
||||
}
|
||||
|
||||
//查询(模糊、匹配)
|
||||
@PostMapping("/listP")
|
||||
public Result listP(@RequestBody User user){
|
||||
LambdaQueryWrapper<User> lambdaQueryWrapper = new LambdaQueryWrapper();
|
||||
if(StringUtils.isNotBlank(user.getName())){
|
||||
lambdaQueryWrapper.like(User::getName,user.getName());
|
||||
}
|
||||
|
||||
return Result.suc(userService.list(lambdaQueryWrapper));
|
||||
}
|
||||
|
||||
@PostMapping("/listPage")
|
||||
// public List<User> listPage(@RequestBody HashMap map){
|
||||
public List<User> listPage(@RequestBody QueryPageParam query){
|
||||
HashMap param = query.getParam();
|
||||
String name = (String)param.get("name");
|
||||
System.out.println("name==="+(String)param.get("name"));
|
||||
/*System.out.println("no==="+(String)param.get("no"));*/
|
||||
/*LambdaQueryWrapper<User> lambdaQueryWrapper = new LambdaQueryWrapper();
|
||||
lambdaQueryWrapper.eq(User::getName,user.getName());
|
||||
|
||||
return userService.list(lambdaQueryWrapper);*/
|
||||
|
||||
Page<User> page = new Page();
|
||||
page.setCurrent(query.getPageNum());
|
||||
page.setSize(query.getPageSize());
|
||||
|
||||
LambdaQueryWrapper<User> lambdaQueryWrapper = new LambdaQueryWrapper();
|
||||
lambdaQueryWrapper.like(User::getName,name);
|
||||
|
||||
|
||||
IPage result = userService.page(page,lambdaQueryWrapper);
|
||||
|
||||
System.out.println("total=="+result.getTotal());
|
||||
|
||||
return result.getRecords();
|
||||
}
|
||||
|
||||
@PostMapping("/listPageC")
|
||||
public List<User> listPageC(@RequestBody QueryPageParam query){
|
||||
HashMap param = query.getParam();
|
||||
String name = (String)param.get("name");
|
||||
System.out.println("name==="+(String)param.get("name"));
|
||||
|
||||
|
||||
|
||||
Page<User> page = new Page();
|
||||
page.setCurrent(query.getPageNum());
|
||||
page.setSize(query.getPageSize());
|
||||
|
||||
LambdaQueryWrapper<User> lambdaQueryWrapper = new LambdaQueryWrapper();
|
||||
lambdaQueryWrapper.like(User::getName,name);
|
||||
|
||||
|
||||
//IPage result = userService.pageC(page);
|
||||
IPage result = userService.pageCC(page,lambdaQueryWrapper);
|
||||
|
||||
System.out.println("total=="+result.getTotal());
|
||||
|
||||
return result.getRecords();
|
||||
}
|
||||
|
||||
@PostMapping("/listPageC1")
|
||||
public Result listPageC1(@RequestBody QueryPageParam query){
|
||||
HashMap param = query.getParam();
|
||||
String name = (String)param.get("name");
|
||||
String sex = (String)param.get("sex");
|
||||
String roleId = (String)param.get("roleId");
|
||||
|
||||
Page<User> page = new Page();
|
||||
page.setCurrent(query.getPageNum());
|
||||
page.setSize(query.getPageSize());
|
||||
|
||||
LambdaQueryWrapper<User> lambdaQueryWrapper = new LambdaQueryWrapper();
|
||||
if(StringUtils.isNotBlank(name) && !"null".equals(name)){
|
||||
lambdaQueryWrapper.like(User::getName,name);
|
||||
}
|
||||
if(StringUtils.isNotBlank(sex)){
|
||||
lambdaQueryWrapper.eq(User::getSex,sex);
|
||||
}
|
||||
if(StringUtils.isNotBlank(roleId)){
|
||||
lambdaQueryWrapper.eq(User::getRoleId,roleId);
|
||||
}
|
||||
|
||||
//IPage result = userService.pageC(page);
|
||||
IPage result = userService.pageCC(page,lambdaQueryWrapper);
|
||||
|
||||
System.out.println("total=="+result.getTotal());
|
||||
|
||||
return Result.suc(result.getRecords(),result.getTotal());
|
||||
}
|
||||
}
|
||||
@ -1,48 +0,0 @@
|
||||
package com.wms.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author wms
|
||||
* @since 2022-10-15
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="Goods对象", description="")
|
||||
public class Goods implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "货名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "仓库")
|
||||
private Integer storage;
|
||||
|
||||
@ApiModelProperty(value = "分类")
|
||||
@TableField("goodsType")
|
||||
private Integer goodstype;
|
||||
|
||||
@ApiModelProperty(value = "数量")
|
||||
private Integer count;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@ -1,39 +0,0 @@
|
||||
package com.wms.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author wms
|
||||
* @since 2022-10-15
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("goodsType")
|
||||
@ApiModel(value="Goodstype对象", description="")
|
||||
public class Goodstype implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "分类名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@ -1,58 +0,0 @@
|
||||
package com.wms.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author wms
|
||||
* @since 2022-10-16
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="Record对象", description="")
|
||||
public class Record implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "货品id")
|
||||
private Integer goods;
|
||||
|
||||
@ApiModelProperty(value = "取货人/补货人")
|
||||
@TableField("userId")
|
||||
private Integer userid;
|
||||
|
||||
@ApiModelProperty(value = "操作人id")
|
||||
private Integer adminId;
|
||||
|
||||
@ApiModelProperty(value = "数量")
|
||||
private Integer count;
|
||||
|
||||
@ApiModelProperty(value = "操作时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createtime;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String action;
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
package com.wms.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RecordRes extends Record{
|
||||
|
||||
private String username;
|
||||
private String adminname;
|
||||
private String goodsname;
|
||||
private String storagename;
|
||||
private String goodstypename;
|
||||
}
|
||||
@ -1,37 +0,0 @@
|
||||
package com.wms.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author wms
|
||||
* @since 2022-10-15
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="Storage对象", description="")
|
||||
public class Storage implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "仓库名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
package com.wms.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.wms.entity.Goods;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.wms.entity.Storage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author wms
|
||||
* @since 2022-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface GoodsMapper extends BaseMapper<Goods> {
|
||||
IPage pageCC(IPage<Goods> page, @Param(Constants.WRAPPER) Wrapper wrapper);
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
package com.wms.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.wms.entity.Goodstype;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.wms.entity.Storage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author wms
|
||||
* @since 2022-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface GoodstypeMapper extends BaseMapper<Goodstype> {
|
||||
IPage pageCC(IPage<Goodstype> page, @Param(Constants.WRAPPER) Wrapper wrapper);
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
package com.wms.mapper;
|
||||
|
||||
import com.wms.entity.Menu;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author wms
|
||||
* @since 2022-10-04
|
||||
*/
|
||||
@Mapper
|
||||
public interface MenuMapper extends BaseMapper<Menu> {
|
||||
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
package com.wms.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.wms.entity.Goods;
|
||||
import com.wms.entity.Record;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author wms
|
||||
* @since 2022-10-16
|
||||
*/
|
||||
@Mapper
|
||||
public interface RecordMapper extends BaseMapper<Record> {
|
||||
IPage pageCC(IPage<Record> page, @Param(Constants.WRAPPER) Wrapper wrapper);
|
||||
}
|
||||
@ -1,24 +0,0 @@
|
||||
package com.wms.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.wms.entity.Storage;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.wms.entity.User;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author wms
|
||||
* @since 2022-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface StorageMapper extends BaseMapper<Storage> {
|
||||
|
||||
IPage pageCC(IPage<Storage> page, @Param(Constants.WRAPPER) Wrapper wrapper);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue