diff --git a/App.vue b/App.vue index f4ed1f4..b98cbc4 100644 --- a/App.vue +++ b/App.vue @@ -37,5 +37,7 @@ page { background-color: #fff; min-height: 100%; height: auto; + white-space: pre-wrap; + word-wrap: break-word; } diff --git a/api/aqSafety.js b/api/aqSafety.js new file mode 100644 index 0000000..57c77f9 --- /dev/null +++ b/api/aqSafety.js @@ -0,0 +1,10 @@ +import request from '@/utils/request'; + +//获取库存列表 +export function getInventoryList(params) { + return request({ + url: '/app/inventory/getInventoryList', + method: 'get', + params + }); +} \ No newline at end of file diff --git a/api/login.js b/api/login.js index 54fb62c..6388ca1 100644 --- a/api/login.js +++ b/api/login.js @@ -1,33 +1,28 @@ -import request from '@/utils/request' +import request from '@/utils/request'; // 登录方法 -export function login(username, password, code, uuid) { - const data = { - username, - password, - code, - uuid - } +export function login(data) { return request({ - 'url': '/login', + url: '/login/appUserLogin', // login - ruoyi + headers: { + isToken: false, + 'Content-Type': 'application/x-www-form-urlencoded' + }, + method: 'post', + data + }); +} + +// 注册方法 +export function register(data) { + return request({ + url: '/register', headers: { isToken: false }, - 'method': 'post', - 'data': data - }) -} - -// 注册方法 -export function register(data) { - return request({ - url: '/register', - headers: { - isToken: false - }, - method: 'post', - data: data - }) + method: 'post', + data: data + }); } // 获取用户详细信息 @@ -35,7 +30,7 @@ export function getInfo() { return request({ 'url': '/getInfo', 'method': 'get' - }) + }); } // 退出方法 @@ -43,7 +38,7 @@ export function logout() { return request({ 'url': '/logout', 'method': 'post' - }) + }); } // 获取验证码 @@ -55,5 +50,5 @@ export function getCodeImg() { }, method: 'get', timeout: 20000 - }) -} + }); +} diff --git a/config.js b/config.js index 98e76bc..2f2bea3 100644 --- a/config.js +++ b/config.js @@ -1,11 +1,12 @@ // 应用全局配置 module.exports = { - baseUrl: 'https://vue.ruoyi.vip/prod-api', + // baseUrl: 'https://vue.ruoyi.vip/prod-api', + baseUrl: 'http://192.168.0.39:21995', baseUrl2: 'http://localhost:8080', // 应用信息 appInfo: { // 应用名称 - name: "ruoyi-app", + name: "gz_safety_app", // 应用版本 version: "1.1.0", // 应用logo diff --git a/main.js b/main.js index 92545fe..97514bc 100644 --- a/main.js +++ b/main.js @@ -4,8 +4,11 @@ import store from './store' // store import plugins from './plugins' // plugins import './permission' // permission import uView from "@/uni_modules/uview-ui"; +import Navbar from 'pages/components/Navbar' + Vue.use(plugins) Vue.use(uView); +Vue.component('Navbar', Navbar) Vue.config.productionTip = false Vue.prototype.$store = store diff --git a/pages.json b/pages.json index cc21e85..2362f54 100644 --- a/pages.json +++ b/pages.json @@ -80,6 +80,13 @@ { "navigationBarTitleText" : "库存查询" } + }, + { + "path" : "pages/returnInventory/index", + "style" : + { + "navigationStyle": "custom" + } }], "tabBar": { "color": "#000000", diff --git a/pages/components/Navbar.vue b/pages/components/Navbar.vue index ec00f75..1a4aa1c 100644 --- a/pages/components/Navbar.vue +++ b/pages/components/Navbar.vue @@ -39,6 +39,10 @@ export default { type: Boolean, default: false }, + showRightText: { + type: Boolean, + default: false + }, text: { type: String, default: '' @@ -72,17 +76,18 @@ export default { diff --git a/pages/login.vue b/pages/login.vue index 2c86fcc..fbd5c03 100644 --- a/pages/login.vue +++ b/pages/login.vue @@ -14,26 +14,26 @@ - + 登录 - - - 没有账号? - 立即注册 - - - 登录即代表同意 - 《用户协议》 - 《隐私协议》 - + + 没有账号? + 立即注册 + + + 登录即代表同意 + 《用户协议》 + 《隐私协议》 + + @@ -45,25 +45,25 @@ data() { return { codeUrl: "", - captchaEnabled: true, - // 用户注册开关 + captchaEnabled: true, + // 用户注册开关 register: false, globalConfig: getApp().globalData.config, loginForm: { - username: "admin", - password: "admin123", + username: "bns", // admin - admin123 + password: "1769fb2837e10e9d22c1c25add76355a", // bns - 1769fb2837e10e9d22c1c25add76355a code: "", uuid: '' } } }, created() { - this.getCode() + // this.getCode() }, - methods: { - // 用户注册 - handleUserRegister() { - this.$tab.redirectTo(`/pages/register`) + methods: { + // 用户注册 + handleUserRegister() { + this.$tab.redirectTo(`/pages/register`) }, // 隐私协议 handlePrivacy() { @@ -91,8 +91,8 @@ this.$modal.msgError("请输入您的账号") } else if (this.loginForm.password === "") { this.$modal.msgError("请输入您的密码") - } else if (this.loginForm.code === "" && this.captchaEnabled) { - this.$modal.msgError("请输入验证码") + // } else if (this.loginForm.code === "" && this.captchaEnabled) { + // this.$modal.msgError("请输入验证码") } else { this.$modal.loading("登录中,请耐心等待...") this.pwdLogin() @@ -101,12 +101,12 @@ // 密码登录 async pwdLogin() { this.$store.dispatch('Login', this.loginForm).then(() => { - this.$modal.closeLoading() + this.$modal.closeLoading() // 关闭加载框 this.loginSuccess() }).catch(() => { - if (this.captchaEnabled) { - this.getCode() - } + // if (this.captchaEnabled) { + // this.getCode() + // } }) }, // 登录成功后,处理函数 @@ -175,28 +175,28 @@ margin-top: 40px; height: 45px; } - - .reg { - margin-top: 15px; - } + + .reg { + margin-top: 15px; + } .xieyi { color: #333; margin-top: 20px; - } - - .login-code { - height: 38px; - float: right; - - .login-code-img { - height: 38px; - position: absolute; - margin-left: 10px; - width: 200rpx; - } + } + + .login-code { + height: 38px; + float: right; + + .login-code-img { + height: 38px; + position: absolute; + margin-left: 10px; + width: 200rpx; + } } } } - + diff --git a/pages/returnInventory/index.vue b/pages/returnInventory/index.vue new file mode 100644 index 0000000..252b0d4 --- /dev/null +++ b/pages/returnInventory/index.vue @@ -0,0 +1,478 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 您还没有选择退料的类型 + 需要选择类型后才能进行退料 + + + + + + + + + + + + + + 序号 + + + 名称 + + + 规格 + + + + * + 退回数量 + + + + + + + {{ index + 1 }} + + + {{ item.name }} + + + {{ item.code }} + + + + + + + + + + + + + + + + + + + + + + + + + + 选择退回的名称 + + + + + + 序号 + + + 名称 + + + 规格 + + + + * + 退回数量 + + + + + + + {{ index + 1 }} + + + {{ item.name }} + + + {{ item.code }} + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/images/no_data_icon.png b/static/images/no_data_icon.png new file mode 100644 index 0000000..125f984 Binary files /dev/null and b/static/images/no_data_icon.png differ diff --git a/store/modules/user.js b/store/modules/user.js index fb35f67..499129f 100644 --- a/store/modules/user.js +++ b/store/modules/user.js @@ -1,10 +1,10 @@ -import config from '@/config' -import storage from '@/utils/storage' -import constant from '@/utils/constant' -import { login, logout, getInfo } from '@/api/login' -import { getToken, setToken, removeToken } from '@/utils/auth' +import config from '@/config'; +import storage from '@/utils/storage'; +import constant from '@/utils/constant'; +import { login, logout, getInfo } from '@/api/login'; +import { getToken, setToken, removeToken } from '@/utils/auth'; -const baseUrl = config.baseUrl +const baseUrl = config.baseUrl; const user = { state: { @@ -17,82 +17,86 @@ const user = { mutations: { SET_TOKEN: (state, token) => { - state.token = token + state.token = token; }, SET_NAME: (state, name) => { - state.name = name - storage.set(constant.name, name) + state.name = name; + storage.set(constant.name, name); }, SET_AVATAR: (state, avatar) => { - state.avatar = avatar - storage.set(constant.avatar, avatar) + state.avatar = avatar; + storage.set(constant.avatar, avatar); }, SET_ROLES: (state, roles) => { - state.roles = roles - storage.set(constant.roles, roles) + state.roles = roles; + storage.set(constant.roles, roles); }, SET_PERMISSIONS: (state, permissions) => { - state.permissions = permissions - storage.set(constant.permissions, permissions) + state.permissions = permissions; + storage.set(constant.permissions, permissions); } }, actions: { // 登录 Login({ commit }, userInfo) { - const username = userInfo.username.trim() - const password = userInfo.password - const code = userInfo.code - const uuid = userInfo.uuid + const formData = { + username: userInfo.username.trim(), + password: userInfo.password, + // code: userInfo.code, + // uuid: userInfo.uuid + } return new Promise((resolve, reject) => { - login(username, password, code, uuid).then(res => { - setToken(res.token) - commit('SET_TOKEN', res.token) - resolve() + console.log('🚀 ~ login ~ formData11:', formData) + login(formData).then(res => { + console.log('🚀 ~ login ~ res:', res) + setToken(res.token); + commit('SET_TOKEN', res.token); + resolve(); }).catch(error => { - reject(error) - }) - }) + reject(error); + }); + }); }, // 获取用户信息 GetInfo({ commit, state }) { return new Promise((resolve, reject) => { getInfo().then(res => { - const user = res.user - const avatar = (user == null || user.avatar == "" || user.avatar == null) ? require("@/static/images/profile.jpg") : baseUrl + user.avatar - const username = (user == null || user.userName == "" || user.userName == null) ? "" : user.userName + const user = res.user; + const avatar = (user == null || user.avatar == "" || user.avatar == null) ? require("@/static/images/profile.jpg") : baseUrl + user.avatar; + const username = (user == null || user.userName == "" || user.userName == null) ? "" : user.userName; if (res.roles && res.roles.length > 0) { - commit('SET_ROLES', res.roles) - commit('SET_PERMISSIONS', res.permissions) + commit('SET_ROLES', res.roles); + commit('SET_PERMISSIONS', res.permissions); } else { - commit('SET_ROLES', ['ROLE_DEFAULT']) + commit('SET_ROLES', ['ROLE_DEFAULT']); } - commit('SET_NAME', username) - commit('SET_AVATAR', avatar) - resolve(res) + commit('SET_NAME', username); + commit('SET_AVATAR', avatar); + resolve(res); }).catch(error => { - reject(error) - }) - }) + reject(error); + }); + }); }, // 退出系统 LogOut({ commit, state }) { return new Promise((resolve, reject) => { logout(state.token).then(() => { - commit('SET_TOKEN', '') - commit('SET_ROLES', []) - commit('SET_PERMISSIONS', []) - removeToken() - storage.clean() - resolve() + commit('SET_TOKEN', ''); + commit('SET_ROLES', []); + commit('SET_PERMISSIONS', []); + removeToken(); + storage.clean(); + resolve(); }).catch(error => { - reject(error) - }) - }) + reject(error); + }); + }); } } -} +}; -export default user +export default user; diff --git a/utils/request.js b/utils/request.js index 8b19398..32c8a32 100644 --- a/utils/request.js +++ b/utils/request.js @@ -14,7 +14,7 @@ let baseUrl = config.baseUrl const request = config => { // 是否需要设置 token const isToken = (config.headers || {}).isToken === false - config.header = config.header || {} + config.header = config.headers || {} if (getToken() && !isToken) { config.header['Authorization'] = 'Bearer ' + getToken() }