手持机-制定出库页面
This commit is contained in:
52
RuoYi-App-master/api/out/appointOut.js
Normal file
52
RuoYi-App-master/api/out/appointOut.js
Normal file
@@ -0,0 +1,52 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 根据托盘码查询库存物料信息
|
||||
* GET /out/handAllotStock/list
|
||||
* @param {Object} params - { trayCode: '托盘码' }
|
||||
* 返回字段:trayCode, stockId, productId, productName, quantity, spare1(规格), spare3(单位),
|
||||
* spare4(型号), cargoSpaceId, cargoSpaceName, warehouseId, inDate, lotNo 等
|
||||
*/
|
||||
export function queryTrayInfo(params) {
|
||||
return request({
|
||||
url: '/out/handAllotStock/list',
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取出口列表(portType=2 为出口)
|
||||
* GET /bas/warehousePort/list
|
||||
* @param {Object} params - { portType: '2', warehouseId: '' }
|
||||
*/
|
||||
export function getExitPortList(params) {
|
||||
return request({
|
||||
url: '/bas/warehousePort/list',
|
||||
method: 'get',
|
||||
params: { portType: '2', ...params }
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定货位出库 - 生成出库作业
|
||||
* POST /job/outmydoJob/pointOut
|
||||
* @param {Array} stockIds - 库存ID数组,如 ['KC202601220164']
|
||||
* @param {String} exitId - 出口ID
|
||||
* @param {String} type - 出库类型(传 '2')
|
||||
*
|
||||
* 注意:后端用 @RequestParam String[] stockIds,Spring 要求重复同名参数:
|
||||
* stockIds=A&stockIds=B
|
||||
* axios 默认序列化数组会带方括号(stockIds[]=A),需手动拼 URL 避免 400 报错。
|
||||
*/
|
||||
export function pointOut(stockIds, exitId, type) {
|
||||
// 把数组拼成重复参数:stockIds=A&stockIds=B&exitId=1&type=2
|
||||
const idPart = (Array.isArray(stockIds) ? stockIds : [stockIds])
|
||||
.map(id => `stockIds=${encodeURIComponent(id)}`)
|
||||
.join('&')
|
||||
const url = `/job/outmydoJob/pointOut?${idPart}&exitId=${encodeURIComponent(exitId)}&type=${encodeURIComponent(type)}`
|
||||
return request({
|
||||
url,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
@@ -2,15 +2,33 @@ import Vue from 'vue'
|
||||
import App from './App'
|
||||
import store from './store' // store
|
||||
import plugins from './plugins' // plugins
|
||||
import VueI18n from 'vue-i18n'
|
||||
import './permission' // permission
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
import enUS from './locales/en-US.json'
|
||||
import zhCN from './locales/zh-CN.json'
|
||||
|
||||
Vue.use(plugins)
|
||||
Vue.use(VueI18n)
|
||||
Vue.config.productionTip = false
|
||||
Vue.prototype.$store = store
|
||||
|
||||
// <20><><EFBFBD><EFBFBD>i18nʵ<6E><CAB5>
|
||||
const i18n = new VueI18n({
|
||||
locale: uni.getStorageSync('language') || 'zh-CN', // Ĭ<><C4AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
messages: {
|
||||
'en-US': enUS,
|
||||
'zh-CN': zhCN
|
||||
}
|
||||
})
|
||||
|
||||
Vue.prototype._i18n = i18n
|
||||
|
||||
App.mpType = 'app'
|
||||
|
||||
const app = new Vue({
|
||||
i18n,
|
||||
...App
|
||||
})
|
||||
|
||||
|
||||
@@ -192,6 +192,13 @@
|
||||
"navigationBarTitleText" : "异常出库"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/out/appointOut",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "指定出库"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/pandian/confirm",
|
||||
"style" :
|
||||
|
||||
@@ -64,6 +64,15 @@
|
||||
<text class="desc">空托盘出入库</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="function-item" @click="navigateTo('/pages/out/appointOut')">
|
||||
<view class="icon-box green">
|
||||
<image src="/static/images/tabbar/trayout.png" mode="aspectFit" class="icon-image" style="width: 40rpx; height: 40rpx;"></image>
|
||||
</view>
|
||||
<view class="function-text">
|
||||
<text class="title">指定出库</text>
|
||||
<text class="desc">扫托盘码生成出库作业</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="function-item" @click="navigateTo('/pages/charts/spaceAnalysis')">
|
||||
<view class="icon-box orange">
|
||||
|
||||
@@ -1,307 +1,412 @@
|
||||
<template>
|
||||
<div class="login">
|
||||
<div class="login-wrapper">
|
||||
<h3 class="title">{{ $t('login.title') }}</h3>
|
||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
|
||||
<div class="form-title">{{ $t('login.accountLogin') }}</div>
|
||||
<lang-select class="set-language"/>
|
||||
<el-form-item prop="username">
|
||||
<el-input
|
||||
v-model="loginForm.username"
|
||||
type="text"
|
||||
auto-complete="off"
|
||||
:placeholder="$t('login.username')"
|
||||
>
|
||||
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon"/>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<el-input
|
||||
v-model="loginForm.password"
|
||||
type="password"
|
||||
auto-complete="off"
|
||||
:placeholder="$t('login.password')"
|
||||
@keyup.enter.native="handleLogin"
|
||||
>
|
||||
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon"/>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="code" v-if="captchaEnabled">
|
||||
<el-input
|
||||
v-model="loginForm.code"
|
||||
auto-complete="off"
|
||||
:placeholder="$t('login.code')"
|
||||
style="width: 63%"
|
||||
@keyup.enter.native="handleLogin"
|
||||
>
|
||||
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon"/>
|
||||
</el-input>
|
||||
<div class="login-code">
|
||||
<img :src="codeUrl" @click="getCode" class="login-code-img"/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">{{
|
||||
$t('login.rememberMe')
|
||||
}}
|
||||
</el-checkbox>
|
||||
<el-form-item style="width:100%;">
|
||||
<el-button
|
||||
:loading="loading"
|
||||
size="medium"
|
||||
type="primary"
|
||||
style="width:100%;height: 45px;font-size: 16px;"
|
||||
@click.native.prevent="handleLogin"
|
||||
>
|
||||
<span v-if="!loading">{{ $t('login.logIn') }}</span>
|
||||
<span v-else>登 录 中...</span>
|
||||
</el-button>
|
||||
<div style="float: right;" v-if="register">
|
||||
<router-link class="link-type" :to="'/register'">立即注册</router-link>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<!-- 激活授权码按钮 -->
|
||||
<el-form-item style="width:100%;">
|
||||
<el-button
|
||||
size="medium"
|
||||
type="warning"
|
||||
style="width:100%;"
|
||||
@click.native.prevent="openLicenseDialog"
|
||||
>激活授权码
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 激活授权码弹窗 -->
|
||||
<el-dialog title="激活授权码" :visible.sync="licenseDialogVisible" width="420px" append-to-body>
|
||||
<el-input v-model="licenseCode" type="textarea" :rows="4" placeholder="请输入授权码"/>
|
||||
<span slot="footer">
|
||||
<el-button @click="licenseDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" :loading="licenseLoading" @click="handleActiveLicense">激 活</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</el-form>
|
||||
</div>
|
||||
<!-- 底部 -->
|
||||
<div class="el-login-footer">
|
||||
<span>{{ $t('login.bottom') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<view class="normal-login-container">
|
||||
<view class="logo-content align-center justify-center flex">
|
||||
<image style="width: 100rpx;height: 100rpx;" :src="globalConfig.appInfo.logo" mode="widthFix">
|
||||
</image>
|
||||
<text class="title">{{ $t('login.appTitle') }}</text>
|
||||
</view>
|
||||
<view class="login-form-content">
|
||||
<view class="input-item flex align-center">
|
||||
<view class="iconfont icon-user icon"></view>
|
||||
<input v-model="loginForm.username" class="input" type="text" :placeholder="$t('login.usernamePlaceholder')" maxlength="30" @focus="showAccountList = true" @input="handleUsernameInput" />
|
||||
<view class="history-accounts" v-if="showAccountList && historyAccounts.length > 0">
|
||||
<view v-for="(account, index) in historyAccounts" :key="index" class="account-item" @click="selectAccount(account)">
|
||||
{{ account }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="input-item flex align-center">
|
||||
<view class="iconfont icon-password icon"></view>
|
||||
<input v-model="loginForm.password" type="password" class="input" :placeholder="$t('login.passwordPlaceholder')" maxlength="20" />
|
||||
</view>
|
||||
<view class="remember-account flex align-center">
|
||||
<checkbox :checked="rememberAccount" @click="toggleRememberAccount" style="transform:scale(0.7)" />
|
||||
<text class="text-grey1" >{{ $t('login.rememberAccount') }}</text>
|
||||
</view>
|
||||
<view class="action-btn">
|
||||
<button @click="handleLogin" class="login-btn cu-btn block bg-blue lg round">{{ $t('login.login') }}</button>
|
||||
<button @click="goToSettings" class="settings-btn cu-btn block lg round">{{ $t('login.serverSettings') }}</button>
|
||||
</view>
|
||||
<!-- <view class="reg text-center" v-if="register">
|
||||
<text class="text-grey1">没有账号?</text>
|
||||
<text @click="handleUserRegister" class="text-blue">立即注册</text>
|
||||
</view> -->
|
||||
<!-- <view class="xieyi text-center">
|
||||
<text class="text-grey1">登录即代表同意</text>
|
||||
<text @click="handleUserAgrement" class="text-blue">《用户协议》</text>
|
||||
<text @click="handlePrivacy" class="text-blue">《隐私协议》</text>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="copyright-section text-center">
|
||||
<text class="version">{{ $t('login.version') }}</text>
|
||||
<text class="copyright">{{ $t('login.copyright') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import LangSelect from '@/components/LangSelect'
|
||||
import {getCodeImg} from "@/api/login";
|
||||
import Cookies from "js-cookie";
|
||||
import {encrypt, decrypt} from '@/utils/jsencrypt'
|
||||
// 新增 import
|
||||
import { activeLicense } from "@/api/license"
|
||||
|
||||
export default {
|
||||
name: "Login",
|
||||
components: {LangSelect},
|
||||
data() {
|
||||
return {
|
||||
codeUrl: "",
|
||||
globalConfig: getApp().globalData.config,
|
||||
rememberAccount: false,
|
||||
historyAccounts: [],
|
||||
showAccountList: false,
|
||||
loginForm: {
|
||||
username: "",
|
||||
password: "",
|
||||
rememberMe: false,
|
||||
code: "",
|
||||
uuid: ""
|
||||
},
|
||||
loginRules: {
|
||||
username: [
|
||||
{required: true, trigger: "blur", message: "请输入您的账号"}
|
||||
],
|
||||
password: [
|
||||
{required: true, trigger: "blur", message: "请输入您的密码"}
|
||||
],
|
||||
code: [{required: true, trigger: "change", message: "请输入验证码"}]
|
||||
},
|
||||
loading: false,
|
||||
// 验证码开关
|
||||
captchaEnabled: true,
|
||||
// 注册开关
|
||||
register: false,
|
||||
redirect: undefined,
|
||||
// 新增 data 字段
|
||||
licenseDialogVisible: false,
|
||||
licenseCode: '',
|
||||
licenseLoading: false
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
$route: {
|
||||
handler: function (route) {
|
||||
this.redirect = route.query && route.query.redirect;
|
||||
},
|
||||
immediate: true
|
||||
password: ""
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getCode();
|
||||
this.getCookie();
|
||||
// 检查服务器配置
|
||||
const serverSettings = uni.getStorageSync('serverSettings')
|
||||
console.log(serverSettings)
|
||||
if (!serverSettings) {
|
||||
// 如果没有服务器配置,跳转到设置页面
|
||||
uni.reLaunch({
|
||||
url: '/pages/setting'
|
||||
})
|
||||
return
|
||||
}
|
||||
// 获取历史账号列表
|
||||
const accounts = uni.getStorageSync('historyAccounts')
|
||||
|
||||
if (accounts) {
|
||||
this.historyAccounts = JSON.parse(accounts)
|
||||
}
|
||||
// 添加点击事件监听器
|
||||
uni.onWindowResize(() => {
|
||||
this.showAccountList = false
|
||||
})
|
||||
},
|
||||
mounted() {
|
||||
// 添加全局点击事件监听
|
||||
document.addEventListener('click', this.handleGlobalClick)
|
||||
},
|
||||
beforeDestroy() {
|
||||
// 移除全局点击事件监听
|
||||
document.removeEventListener('click', this.handleGlobalClick)
|
||||
},
|
||||
methods: {
|
||||
// 新增方法
|
||||
openLicenseDialog() {
|
||||
this.licenseCode = ''
|
||||
this.licenseDialogVisible = true
|
||||
},
|
||||
handleActiveLicense() {
|
||||
if (!this.licenseCode.trim()) {
|
||||
this.$message.warning('请输入授权码')
|
||||
return
|
||||
// 登录方法
|
||||
async handleLogin() {
|
||||
|
||||
|
||||
if (this.loginForm.username === "") {
|
||||
this.$modal.msgError(this.$t('login.usernameRequired'))
|
||||
} else if (this.loginForm.password === "") {
|
||||
this.$modal.msgError(this.$t('login.passwordRequired'))
|
||||
} else {
|
||||
this.$modal.loading(this.$t('login.loggingIn'))
|
||||
this.pwdLogin()
|
||||
}
|
||||
this.licenseLoading = true
|
||||
activeLicense(this.licenseCode.trim()).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message.success(res.msg || '授权码激活成功')
|
||||
this.licenseDialogVisible = false
|
||||
} else {
|
||||
this.$message.error(res.msg || '授权码激活失败')
|
||||
}
|
||||
},
|
||||
// 密码登录
|
||||
async pwdLogin() {
|
||||
this.$store.dispatch('Login', this.loginForm).then(() => {
|
||||
this.$modal.closeLoading()
|
||||
this.loginSuccess()
|
||||
}).catch(() => {
|
||||
this.$message.error('授权码激活失败')
|
||||
}).finally(() => {
|
||||
this.licenseLoading = false
|
||||
if (this.captchaEnabled) {
|
||||
this.getCode()
|
||||
}
|
||||
})
|
||||
},
|
||||
getCode() {
|
||||
getCodeImg().then(res => {
|
||||
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled;
|
||||
if (this.captchaEnabled) {
|
||||
this.codeUrl = "data:image/gif;base64," + res.img;
|
||||
this.loginForm.uuid = res.uuid;
|
||||
}
|
||||
});
|
||||
},
|
||||
getCookie() {
|
||||
const username = Cookies.get("username");
|
||||
const password = Cookies.get("password");
|
||||
const rememberMe = Cookies.get('rememberMe')
|
||||
this.loginForm = {
|
||||
username: username === undefined ? this.loginForm.username : username,
|
||||
password: password === undefined ? this.loginForm.password : decrypt(password),
|
||||
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe)
|
||||
};
|
||||
},
|
||||
handleLogin() {
|
||||
this.$refs.loginForm.validate(valid => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
if (this.loginForm.rememberMe) {
|
||||
Cookies.set("username", this.loginForm.username, {expires: 30});
|
||||
Cookies.set("password", encrypt(this.loginForm.password), {expires: 30});
|
||||
Cookies.set('rememberMe', this.loginForm.rememberMe, {expires: 30});
|
||||
} else {
|
||||
Cookies.remove("username");
|
||||
Cookies.remove("password");
|
||||
Cookies.remove('rememberMe');
|
||||
// 登录成功后,处理函数
|
||||
loginSuccess(result) {
|
||||
// 如果勾选了记住账号,保存到本地存储
|
||||
if (this.rememberAccount && this.loginForm.username) {
|
||||
let accounts = this.historyAccounts || []
|
||||
if (!accounts.includes(this.loginForm.username)) {
|
||||
accounts.unshift(this.loginForm.username)
|
||||
if (accounts.length > 5) {
|
||||
accounts = accounts.slice(0, 5)
|
||||
}
|
||||
this.$store.dispatch("Login", this.loginForm).then(() => {
|
||||
this.$router.push({path: this.redirect || "/"}).catch(() => {
|
||||
});
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
if (this.captchaEnabled) {
|
||||
this.getCode();
|
||||
}
|
||||
});
|
||||
uni.setStorageSync('historyAccounts', JSON.stringify(accounts))
|
||||
this.historyAccounts = accounts
|
||||
}
|
||||
});
|
||||
} else if (!this.rememberAccount && this.loginForm.username) {
|
||||
// 如果未勾选记住账号,从历史账号列表中删除当前账号
|
||||
const updatedAccounts = this.historyAccounts.filter(account => account !== this.loginForm.username)
|
||||
uni.setStorageSync('historyAccounts', JSON.stringify(updatedAccounts))
|
||||
this.historyAccounts = updatedAccounts
|
||||
this.showAccountList = false
|
||||
}
|
||||
|
||||
// 设置用户信息
|
||||
this.$store.dispatch('GetInfo').then(res => {
|
||||
if (res) {
|
||||
uni.switchTab({
|
||||
url: '/pages/index',
|
||||
success: () => {
|
||||
console.log('页面跳转成功')
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('页面跳转失败:', err)
|
||||
this.$modal.msgError('页面跳转失败,请重试')
|
||||
}
|
||||
})
|
||||
}
|
||||
}).catch(err => {
|
||||
console.error('获取用户信息失败:', err)
|
||||
this.$modal.msgError('获取用户信息失败,请重试')
|
||||
})
|
||||
},
|
||||
//选择历史账号
|
||||
selectAccount(account) {
|
||||
this.loginForm.username = account
|
||||
this.showAccountList = false
|
||||
},
|
||||
// 切换记住账号状态
|
||||
toggleRememberAccount() {
|
||||
this.rememberAccount = !this.rememberAccount
|
||||
},
|
||||
// 处理用户名输入
|
||||
handleUsernameInput() {
|
||||
if (!this.loginForm.username) {
|
||||
this.showAccountList = false
|
||||
return
|
||||
}
|
||||
// 检查输入是否与任何历史账号匹配
|
||||
const hasMatch = this.historyAccounts.some(account =>
|
||||
account.startsWith(this.loginForm.username)
|
||||
)
|
||||
this.showAccountList = hasMatch
|
||||
},
|
||||
// 处理全局点击事件
|
||||
handleGlobalClick(event) {
|
||||
const loginForm = document.querySelector('.login-form-content')
|
||||
if (loginForm && !loginForm.contains(event.target)) {
|
||||
this.showAccountList = false
|
||||
}
|
||||
},
|
||||
// 跳转到设置页面
|
||||
goToSettings() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/setting'
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss">
|
||||
.login {
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #f8f9fa;
|
||||
}
|
||||
|
||||
.normal-login-container {
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
background-image: url("../assets/images/login-background.jpg");
|
||||
background-size: cover;
|
||||
}
|
||||
padding: 20px;
|
||||
|
||||
.login-wrapper {
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
border-radius: 20px;
|
||||
padding: 40px;
|
||||
padding-top: 50px;
|
||||
width: 480px;
|
||||
height: 500px;
|
||||
}
|
||||
.logo-content {
|
||||
width: 100%;
|
||||
font-size: 24px;
|
||||
text-align: center;
|
||||
padding-top: 10%;
|
||||
margin-bottom: 40px;
|
||||
animation: fadeInDown 0.8s ease;
|
||||
|
||||
.title {
|
||||
margin: 0px auto 30px auto;
|
||||
text-align: center;
|
||||
font-size: 28px;
|
||||
font-weight: 600;
|
||||
color: #696a6d;
|
||||
}
|
||||
image {
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
transition: transform 0.3s ease;
|
||||
|
||||
.login-form {
|
||||
border-radius: 4px;
|
||||
background: #ffffff;
|
||||
width: 400px;
|
||||
padding: 30px 30px 15px 30px;
|
||||
&:hover {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
}
|
||||
|
||||
.el-input {
|
||||
height: 38px;
|
||||
|
||||
input {
|
||||
height: 38px;
|
||||
.title {
|
||||
margin-left: 15px;
|
||||
font-weight: 600;
|
||||
color: #2c3e50;
|
||||
}
|
||||
}
|
||||
|
||||
.input-icon {
|
||||
height: 39px;
|
||||
width: 14px;
|
||||
margin-left: 2px;
|
||||
.login-form-content {
|
||||
text-align: center;
|
||||
margin: 20px auto;
|
||||
width: 85%;
|
||||
max-width: 400px;
|
||||
background: #ffffff;
|
||||
padding: 30px 20px;
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
|
||||
animation: fadeInUp 0.8s ease;
|
||||
|
||||
.input-item {
|
||||
margin: 25px auto;
|
||||
background-color: #f8f9fa;
|
||||
height: 50px;
|
||||
border-radius: 25px;
|
||||
position: relative;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:focus-within {
|
||||
background-color: #fff;
|
||||
box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
|
||||
}
|
||||
|
||||
.icon {
|
||||
font-size: 20px;
|
||||
margin-left: 20px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.input {
|
||||
width: 100%;
|
||||
font-size: 15px;
|
||||
line-height: 20px;
|
||||
text-align: left;
|
||||
padding-left: 15px;
|
||||
color: #333;
|
||||
|
||||
&::placeholder {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.history-accounts {
|
||||
position: absolute;
|
||||
top: 110%;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
|
||||
z-index: 100;
|
||||
overflow: hidden;
|
||||
|
||||
.account-item {
|
||||
padding: 12px 20px;
|
||||
text-align: left;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
transition: background-color 0.2s ease;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.remember-account {
|
||||
width: 100%;
|
||||
padding: 0 25px;
|
||||
margin-top: -5px;
|
||||
justify-content: flex-start;
|
||||
|
||||
.text-grey1 {
|
||||
font-size: 14px;
|
||||
margin-left: 8px;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
.login-btn {
|
||||
margin-top: 35px;
|
||||
height: 50px;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 1px;
|
||||
background: linear-gradient(135deg, #4285f4, #34a853);
|
||||
border: none;
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||
|
||||
&:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
}
|
||||
|
||||
.settings-btn {
|
||||
margin-top: 15px;
|
||||
height: 50px;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 1px;
|
||||
background: #f8f9fa;
|
||||
color: #666;
|
||||
border: 1px solid #ddd;
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||
|
||||
&:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
}
|
||||
|
||||
.reg {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.xieyi {
|
||||
color: #666;
|
||||
margin-top: 25px;
|
||||
font-size: 14px;
|
||||
|
||||
.text-blue {
|
||||
color: #4285f4;
|
||||
margin: 0 4px;
|
||||
transition: color 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
color: #2b579a;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.copyright-section {
|
||||
position: fixed;
|
||||
bottom: 20px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
padding: 15px;
|
||||
|
||||
.version {
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.copyright {
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.login-tip {
|
||||
font-size: 13px;
|
||||
text-align: center;
|
||||
color: #bfbfbf;
|
||||
}
|
||||
|
||||
.login-code {
|
||||
width: 33%;
|
||||
height: 38px;
|
||||
float: right;
|
||||
|
||||
img {
|
||||
cursor: pointer;
|
||||
vertical-align: middle;
|
||||
@keyframes fadeInDown {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(-20px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.el-login-footer {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-family: Arial;
|
||||
font-size: 12px;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.login-code-img {
|
||||
height: 38px;
|
||||
}
|
||||
|
||||
.form-title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #818181;
|
||||
text-align: left;
|
||||
margin-bottom: 20px;
|
||||
border-right: 3px solid #bebaba;
|
||||
@keyframes fadeInUp {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(20px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
287
RuoYi-App-master/pages/out/appointOut.vue
Normal file
287
RuoYi-App-master/pages/out/appointOut.vue
Normal file
@@ -0,0 +1,287 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="form-card">
|
||||
<uni-forms label-width="160rpx">
|
||||
<!-- 托盘码输入 -->
|
||||
<uni-forms-item label="托盘码">
|
||||
<view class="input-row">
|
||||
<uni-easyinput
|
||||
v-model="trayCode"
|
||||
placeholder="请扫描或输入托盘码"
|
||||
:clearable="true"
|
||||
class="tray-input"
|
||||
@confirm="handleQuery"
|
||||
/>
|
||||
<button class="query-btn" :loading="querying" hover-class="button-hover" @click="handleQuery">查询</button>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
|
||||
<!-- 查询结果信息展示 -->
|
||||
<template v-if="materialInfo">
|
||||
<uni-forms-item label="物料编码">
|
||||
<view class="info-field"><text class="info-value">{{ materialInfo.productId || '-' }}</text></view>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物料名称">
|
||||
<view class="info-field"><text class="info-value">{{ materialInfo.productName || '-' }}</text></view>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="库存数量">
|
||||
<view class="info-field"><text class="info-value">{{ (materialInfo.quantity || '0') + ' ' + (materialInfo.spare3 || '') }}</text></view>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="部门">
|
||||
<view class="info-field"><text class="info-value">{{ materialInfo.deptName || '-' }}</text></view>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="所在货位">
|
||||
<view class="info-field"><text class="info-value">{{ materialInfo.cargoSpaceName || materialInfo.cargoSpaceId || '-' }}</text></view>
|
||||
</uni-forms-item>
|
||||
|
||||
|
||||
<!-- 三个出库按钮(带权限控制)-->
|
||||
<view class="btn-group">
|
||||
<!-- 出来看看:exitId=1, type=2 权限: job:outmydoJob:pointOut -->
|
||||
<button
|
||||
v-if="$auth.hasPermi('job:outmydoJob:pointOut')"
|
||||
class="submit-button btn-primary"
|
||||
:loading="submitting === 'out'"
|
||||
hover-class="button-hover"
|
||||
@click="handleOut('out')"
|
||||
>出来看看</button>
|
||||
|
||||
<!-- 出库端出库:exitId=2, type=2 权限: job:outmydoJob:pointOut1 -->
|
||||
<button
|
||||
v-if="$auth.hasPermi('job:outmydoJob:pointOut1')"
|
||||
class="submit-button btn-warning"
|
||||
:loading="submitting === 'out1'"
|
||||
hover-class="button-hover"
|
||||
@click="handleOut('out1')"
|
||||
>出库端出库</button>
|
||||
|
||||
<!-- 入库端出库:exitId=1, type=2 权限: job:outmydoJob:pointOut2 -->
|
||||
<button
|
||||
v-if="$auth.hasPermi('job:outmydoJob:pointOut2')"
|
||||
class="submit-button btn-danger"
|
||||
:loading="submitting === 'out2'"
|
||||
hover-class="button-hover"
|
||||
@click="handleOut('out2')"
|
||||
>入库端出库</button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<!-- 空状态 -->
|
||||
<view v-if="queried && !materialInfo" class="empty-tip">
|
||||
<uni-icons type="info" size="30" color="#ccc"></uni-icons>
|
||||
<text class="empty-text">未查询到该托盘的物料信息</text>
|
||||
</view>
|
||||
</uni-forms>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { queryTrayInfo, pointOut } from '@/api/out/appointOut.js'
|
||||
|
||||
/**
|
||||
* 三种出库方式(对应 pointOut.vue 逻辑)
|
||||
* out → 出来看看 exitId=1 type=2 权限: job:outmydoJob:pointOut
|
||||
* out1 → 出库端出库 exitId=2 type=2 权限: job:outmydoJob:pointOut1
|
||||
* out2 → 入库端出库 exitId=1 type=2 权限: job:outmydoJob:pointOut2
|
||||
*/
|
||||
const TYPE_MAP = {
|
||||
out: { exitId: '1', type: '2', label: '出来看看', permi: 'job:outmydoJob:pointOut' },
|
||||
out1: { exitId: '2', type: '2', label: '出库端出库', permi: 'job:outmydoJob:pointOut1' },
|
||||
out2: { exitId: '1', type: '2', label: '入库端出库', permi: 'job:outmydoJob:pointOut2' }
|
||||
}
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
trayCode: '',
|
||||
querying: false,
|
||||
queried: false,
|
||||
materialInfo: null,
|
||||
submitting: '' // 当前提交中的按钮 key:'out' | 'out1' | 'out2' | ''
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
// ─── 查询托盘 ─────────────────────────────────────────────
|
||||
async handleQuery() {
|
||||
const code = this.trayCode.trim()
|
||||
if (!code) {
|
||||
uni.showToast({ title: '请输入托盘码', icon: 'none' })
|
||||
return
|
||||
}
|
||||
this.querying = true
|
||||
this.materialInfo = null
|
||||
this.queried = false
|
||||
try {
|
||||
const res = await queryTrayInfo({ trayCode: code })
|
||||
this.queried = true
|
||||
if (res.code === 200 && res.rows && res.rows.length > 0) {
|
||||
this.materialInfo = res.rows[0]
|
||||
} else {
|
||||
uni.showToast({ title: res.msg || '未查询到物料信息', icon: 'none' })
|
||||
}
|
||||
} catch (e) {
|
||||
this.queried = true
|
||||
uni.showToast({ title: '查询失败,请重试', icon: 'none' })
|
||||
} finally {
|
||||
this.querying = false
|
||||
}
|
||||
},
|
||||
|
||||
// ─── 出库(三种方式共用) ──────────────────────────────────
|
||||
handleOut(btnKey) {
|
||||
if (!this.materialInfo) {
|
||||
uni.showToast({ title: '请先查询托盘信息', icon: 'none' })
|
||||
return
|
||||
}
|
||||
const cfg = TYPE_MAP[btnKey]
|
||||
const stockId = this.materialInfo.stockId || this.materialInfo.trayCode
|
||||
|
||||
uni.showModal({
|
||||
title: '出库确认',
|
||||
content: `托盘:${this.materialInfo.trayCode}\n物料:${this.materialInfo.productName || this.materialInfo.productId}\n方式:${cfg.label}`,
|
||||
success: async (modal) => {
|
||||
if (!modal.confirm) return
|
||||
this.submitting = btnKey
|
||||
try {
|
||||
const res = await pointOut(stockId, cfg.exitId, cfg.type)
|
||||
if (res.code === 200) {
|
||||
uni.showToast({ title: '出库作业已生成', icon: 'success', duration: 2000 })
|
||||
setTimeout(() => {
|
||||
this.trayCode = ''
|
||||
this.materialInfo = null
|
||||
this.queried = false
|
||||
}, 1500)
|
||||
} else {
|
||||
uni.showToast({ title: res.msg || '出库失败', icon: 'none' })
|
||||
}
|
||||
} catch (e) {
|
||||
uni.showToast({ title: '出库操作失败,请重试', icon: 'none' })
|
||||
} finally {
|
||||
this.submitting = ''
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.container {
|
||||
padding: 30rpx;
|
||||
background-color: #f5f5f5;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.form-card {
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
padding: 40rpx 30rpx;
|
||||
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
:deep(.uni-forms-item) {
|
||||
padding-bottom: 30rpx;
|
||||
|
||||
// label 固定宽度,不换行
|
||||
.uni-forms-item__label {
|
||||
width: 160rpx !important;
|
||||
min-width: 160rpx !important;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
white-space: nowrap;
|
||||
overflow: visible;
|
||||
}
|
||||
}
|
||||
|
||||
// ── 物料信息只读展示行(替代 disabled input,颜色完全自控)──
|
||||
.info-field {
|
||||
width: 100%;
|
||||
min-height: 72rpx;
|
||||
background-color: #f5f7fa;
|
||||
border-radius: 8rpx;
|
||||
padding: 0 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
font-size: 28rpx;
|
||||
color: #222;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
// ── 托盘码输入行 ───────────────────────────────────
|
||||
.input-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.tray-input {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.query-btn {
|
||||
flex-shrink: 0;
|
||||
width: 140rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
font-size: 28rpx;
|
||||
background-color: #3B7FFF;
|
||||
color: #fff;
|
||||
border-radius: 8rpx;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
// ── 三按钮组 ──────────────────────────────────────
|
||||
.btn-group {
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.submit-button {
|
||||
flex: 1;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
font-size: 28rpx;
|
||||
border-radius: 44rpx;
|
||||
color: #fff;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background-color: #3B7FFF;
|
||||
}
|
||||
|
||||
.btn-warning {
|
||||
background-color: #fa8c16;
|
||||
}
|
||||
|
||||
.btn-danger {
|
||||
background-color: #f5222d;
|
||||
}
|
||||
|
||||
.button-hover {
|
||||
opacity: 0.8;
|
||||
transform: translateY(2rpx);
|
||||
}
|
||||
|
||||
// ── 空状态 ────────────────────────────────────────
|
||||
.empty-tip {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 60rpx 0 20rpx;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
font-size: 28rpx;
|
||||
color: #bbb;
|
||||
}
|
||||
</style>
|
||||
@@ -55,6 +55,15 @@
|
||||
<text class="desc">点对点搬运</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="function-item" @click="navigateTo('/pages/out/appointOut')">
|
||||
<view class="icon-box green">
|
||||
<image src="/static/images/tabbar/trayout.png" mode="aspectFit" class="icon-image" style="width: 40rpx; height: 40rpx;"></image>
|
||||
</view>
|
||||
<view class="function-text">
|
||||
<text class="title">指定出库</text>
|
||||
<text class="desc">扫托盘码生成出库作业</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -122,6 +131,11 @@ export default {
|
||||
box-shadow: 0 6rpx 16rpx rgba(64, 158, 255, 0.25);
|
||||
}
|
||||
|
||||
&.green {
|
||||
background: linear-gradient(135deg, #52c41a, #3a9d0f);
|
||||
box-shadow: 0 6rpx 16rpx rgba(82, 196, 26, 0.25);
|
||||
}
|
||||
|
||||
&:hover {
|
||||
transform: rotate(15deg) scale(1.1);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ const CompressionPlugin = require('compression-webpack-plugin')
|
||||
|
||||
const name = process.env.VUE_APP_TITLE || '若依管理系统' // 网页标题
|
||||
|
||||
const baseUrl = 'http://localhost:8080' // 后端接口
|
||||
const baseUrl = 'http://localhost:8081' // 后端接口
|
||||
|
||||
const port = process.env.port || process.env.npm_config_port || 80 // 端口
|
||||
|
||||
|
||||
Reference in New Issue
Block a user