项目初始化

This commit is contained in:
刘汗青
2026-06-10 10:03:08 +08:00
commit a3c023a8d3
1255 changed files with 194055 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
<template>
<view>
<uni-card class="view-title" :title="title">
<text class="uni-body view-content">{{ content }}</text>
</uni-card>
</view>
</template>
<script>
export default {
data() {
return {
title: '',
content: ''
}
},
onLoad(options) {
this.title = options.title
this.content = options.content
uni.setNavigationBarTitle({
title: options.title
})
}
}
</script>
<style scoped>
page {
background-color: #ffffff;
}
.view-title {
font-weight: bold;
}
.view-content {
font-size: 26rpx;
padding: 12px 5px 0;
color: #333;
line-height: 24px;
font-weight: normal;
}
</style>

View File

@@ -0,0 +1,34 @@
<template>
<view v-if="params.url">
<web-view :webview-styles="webviewStyles" :src="`${params.url}`"></web-view>
</view>
</template>
<script>
export default {
data() {
return {
params: {},
webviewStyles: {
progress: {
color: "#FF3333"
}
}
}
},
props: {
src: {
type: [String],
default: null
}
},
onLoad(event) {
this.params = event
if (event.title) {
uni.setNavigationBarTitle({
title: event.title
})
}
}
}
</script>

226
pda/pages/index.vue Normal file
View File

@@ -0,0 +1,226 @@
<template>
<view class="page-container">
<!-- 顶部区域 -->
<view class="header">
<view class="header-info">
<image class="logo" src="@/static/logo.png" mode="aspectFit"></image>
<view class="header-text">
<text class="app-name">WMS 仓储管理</text>
<text class="welcome-text">欢迎使用仓库管理系统</text>
</view>
</view>
</view>
<!-- 功能入口 -->
<view class="menu-section">
<view class="menu-grid">
<view class="menu-item" @click="navigateTo('/pages/warehouse/inbound/index')">
<view class="menu-icon inbound">
<uni-icons type="download" size="28" color="#fff"></uni-icons>
</view>
<text class="menu-label">入库管理</text>
<text class="menu-desc">入库绑盘 / 补料入库</text>
</view>
<view class="menu-item" @click="navigateTo('/pages/warehouse/outbound/index')">
<view class="menu-icon outbound">
<uni-icons type="upload" size="28" color="#fff"></uni-icons>
</view>
<text class="menu-label">出库管理</text>
<text class="menu-desc">出库确认 / 异常确认</text>
</view>
<view class="menu-item" @click="navigateTo('/pages/warehouse/inventory/index')">
<view class="menu-icon inventory">
<uni-icons type="search" size="28" color="#fff"></uni-icons>
</view>
<text class="menu-label">盘点管理</text>
<text class="menu-desc">库存盘点</text>
</view>
<view class="menu-item" @click="navigateTo('/pages/warehouse/stock/index')">
<view class="menu-icon stock">
<uni-icons type="bars" size="28" color="#fff"></uni-icons>
</view>
<text class="menu-label">库存统计</text>
<text class="menu-desc">库存数据总览</text>
</view>
</view>
</view>
<!-- 快捷操作 -->
<view class="quick-section">
<text class="section-title">快捷操作</text>
<view class="quick-grid">
<view class="quick-item" @click="navigateTo('/pages/warehouse/inbound/bindTray')">
<uni-icons type="scan" size="22" color="#1890ff"></uni-icons>
<text class="quick-label">入库绑盘</text>
</view>
<view class="quick-item" @click="navigateTo('/pages/warehouse/inbound/supply')">
<uni-icons type="plus" size="22" color="#52c41a"></uni-icons>
<text class="quick-label">补料入库</text>
</view>
<view class="quick-item" @click="navigateTo('/pages/warehouse/outbound/confirm')">
<uni-icons type="checkmarkempty" size="22" color="#fa8c16"></uni-icons>
<text class="quick-label">出库确认</text>
</view>
<view class="quick-item" @click="navigateTo('/pages/warehouse/outbound/exception')">
<uni-icons type="info" size="22" color="#f5222d"></uni-icons>
<text class="quick-label">出库异常</text>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {}
},
methods: {
navigateTo(url) {
this.$tab.navigateTo(url)
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f5f7fa;
min-height: 100%;
}
.page-container {
padding: 24rpx;
}
.header {
background: linear-gradient(135deg, #1890ff, #096dd9);
border-radius: 20rpx;
padding: 40rpx 36rpx;
margin-bottom: 32rpx;
}
.header-info {
display: flex;
align-items: center;
}
.logo {
width: 80rpx;
height: 80rpx;
border-radius: 16rpx;
margin-right: 24rpx;
}
.header-text {
display: flex;
flex-direction: column;
}
.app-name {
font-size: 36rpx;
font-weight: 500;
color: #fff;
margin-bottom: 8rpx;
}
.welcome-text {
font-size: 24rpx;
color: rgba(255, 255, 255, 0.8);
}
.menu-section {
margin-bottom: 32rpx;
}
.menu-grid {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.menu-item {
width: 48%;
background: #fff;
border-radius: 20rpx;
padding: 36rpx 24rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
display: flex;
flex-direction: column;
align-items: flex-start;
}
.menu-icon {
width: 88rpx;
height: 88rpx;
border-radius: 20rpx;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20rpx;
}
.menu-icon.inbound {
background: linear-gradient(135deg, #1890ff, #40a9ff);
}
.menu-icon.outbound {
background: linear-gradient(135deg, #fa8c16, #ffa940);
}
.menu-icon.inventory {
background: linear-gradient(135deg, #52c41a, #73d13d);
}
.menu-icon.stock {
background: linear-gradient(135deg, #722ed1, #9254de);
}
.menu-label {
font-size: 32rpx;
font-weight: 500;
color: #333;
margin-bottom: 8rpx;
}
.menu-desc {
font-size: 24rpx;
color: #999;
}
.quick-section {
background: #fff;
border-radius: 20rpx;
padding: 32rpx 24rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
}
.section-title {
font-size: 30rpx;
font-weight: 500;
color: #333;
margin-bottom: 28rpx;
}
.quick-grid {
display: flex;
justify-content: space-between;
}
.quick-item {
display: flex;
flex-direction: column;
align-items: center;
padding: 16rpx 24rpx;
}
.quick-label {
font-size: 24rpx;
color: #666;
margin-top: 12rpx;
}
</style>

210
pda/pages/login.vue Normal file
View File

@@ -0,0 +1,210 @@
<template>
<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">若依移动端登录</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="请输入账号" maxlength="30" />
</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="请输入密码" maxlength="20" />
</view>
<view class="input-item flex align-center" style="width: 60%;margin: 0px;" v-if="captchaEnabled">
<view class="iconfont icon-code icon"></view>
<input v-model="loginForm.code" type="number" class="input" placeholder="请输入验证码" maxlength="4" />
<view class="login-code">
<image :src="codeUrl" @click="getCode" class="login-code-img"></image>
</view>
</view>
<view class="action-btn">
<button @click="handleLogin" class="login-btn cu-btn block bg-blue lg round">登录</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>
</template>
<script>
import { getCodeImg } from '@/api/login'
import { getToken } from '@/utils/auth'
export default {
data() {
return {
codeUrl: "",
captchaEnabled: true,
// 用户注册开关
register: false,
globalConfig: getApp().globalData.config,
loginForm: {
username: "admin",
password: "admin123",
code: "",
uuid: ""
}
}
},
created() {
this.getCode()
},
onLoad() {
//#ifdef H5
if (getToken()) {
this.$tab.reLaunch('/pages/index')
}
//#endif
},
methods: {
// 用户注册
handleUserRegister() {
this.$tab.redirectTo(`/pages/register`)
},
// 隐私协议
handlePrivacy() {
let site = this.globalConfig.appInfo.agreements[0]
this.$tab.navigateTo(`/pages/common/webview/index?title=${site.title}&url=${site.url}`)
},
// 用户协议
handleUserAgrement() {
let site = this.globalConfig.appInfo.agreements[1]
this.$tab.navigateTo(`/pages/common/webview/index?title=${site.title}&url=${site.url}`)
},
// 获取图形验证码
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
}
})
},
// 登录方法
async handleLogin() {
if (this.loginForm.username === "") {
this.$modal.msgError("请输入账号")
} else if (this.loginForm.password === "") {
this.$modal.msgError("请输入密码")
} else if (this.loginForm.code === "" && this.captchaEnabled) {
this.$modal.msgError("请输入验证码")
} else {
this.$modal.loading("登录中,请耐心等待...")
this.pwdLogin()
}
},
// 密码登录
async pwdLogin() {
this.$store.dispatch('Login', this.loginForm).then(() => {
this.$modal.closeLoading()
this.loginSuccess()
}).catch(() => {
if (this.captchaEnabled) {
this.getCode()
}
})
},
// 登录成功后,处理函数
loginSuccess(result) {
// 设置用户信息
this.$store.dispatch('GetInfo').then(res => {
this.$tab.reLaunch('/pages/index')
})
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #ffffff;
}
.normal-login-container {
width: 100%;
.logo-content {
width: 100%;
font-size: 21px;
text-align: center;
padding-top: 15%;
image {
border-radius: 4px;
}
.title {
margin-left: 10px;
}
}
.login-form-content {
text-align: center;
margin: 20px auto;
margin-top: 15%;
width: 80%;
.input-item {
margin: 20px auto;
background-color: #f5f6f7;
height: 45px;
border-radius: 20px;
.icon {
font-size: 38rpx;
margin-left: 10px;
color: #999;
}
.input {
width: 100%;
font-size: 14px;
line-height: 20px;
text-align: left;
padding-left: 15px;
}
}
.login-btn {
margin-top: 40px;
height: 45px;
}
.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;
}
}
}
}
</style>

View File

@@ -0,0 +1,75 @@
<template>
<view class="about-container">
<view class="header-section text-center">
<image style="width: 150rpx;height: 150rpx;" src="/static/logo200.png" mode="widthFix">
</image>
<uni-title type="h2" title="若依移动端"></uni-title>
</view>
<view class="content-section">
<view class="menu-list">
<view class="list-cell list-cell-arrow">
<view class="menu-item-box">
<view>版本信息</view>
<view class="text-right">v{{version}}</view>
</view>
</view>
<view class="list-cell list-cell-arrow">
<view class="menu-item-box">
<view>官方邮箱</view>
<view class="text-right">ruoyi@xx.com</view>
</view>
</view>
<view class="list-cell list-cell-arrow">
<view class="menu-item-box">
<view>服务热线</view>
<view class="text-right">400-999-9999</view>
</view>
</view>
<view class="list-cell list-cell-arrow">
<view class="menu-item-box">
<view>公司网站</view>
<view class="text-right">
<uni-link :href="url" :text="url" showUnderLine="false"></uni-link>
</view>
</view>
</view>
</view>
</view>
<view class="copyright">
<view>Copyright &copy; 2025 ruoyi.vip All Rights Reserved.</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
url: getApp().globalData.config.appInfo.site_url,
version: getApp().globalData.config.appInfo.version
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f8f8f8;
}
.copyright {
margin-top: 50rpx;
text-align: center;
line-height: 60rpx;
color: #999;
}
.header-section {
display: flex;
padding: 30rpx 0 0;
flex-direction: column;
align-items: center;
}
</style>

View File

@@ -0,0 +1,618 @@
<template>
<view class="container">
<view class="page-body uni-content-info">
<view class='cropper-content'>
<view v-if="isShowImg" class="uni-corpper" :style="'width:'+cropperInitW+'px;height:'+cropperInitH+'px;background:#000'">
<view class="uni-corpper-content" :style="'width:'+cropperW+'px;height:'+cropperH+'px;left:'+cropperL+'px;top:'+cropperT+'px'">
<image :src="imageSrc" :style="'width:'+cropperW+'px;height:'+cropperH+'px'"></image>
<view class="uni-corpper-crop-box" @touchstart.stop="contentStartMove" @touchmove.stop="contentMoveing" @touchend.stop="contentTouchEnd"
:style="'left:'+cutL+'px;top:'+cutT+'px;right:'+cutR+'px;bottom:'+cutB+'px'">
<view class="uni-cropper-view-box">
<view class="uni-cropper-dashed-h"></view>
<view class="uni-cropper-dashed-v"></view>
<view class="uni-cropper-line-t" data-drag="top" @touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
<view class="uni-cropper-line-r" data-drag="right" @touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
<view class="uni-cropper-line-b" data-drag="bottom" @touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
<view class="uni-cropper-line-l" data-drag="left" @touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
<view class="uni-cropper-point point-t" data-drag="top" @touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
<view class="uni-cropper-point point-tr" data-drag="topTight"></view>
<view class="uni-cropper-point point-r" data-drag="right" @touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
<view class="uni-cropper-point point-rb" data-drag="rightBottom" @touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
<view class="uni-cropper-point point-b" data-drag="bottom" @touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
<view class="uni-cropper-point point-bl" data-drag="bottomLeft"></view>
<view class="uni-cropper-point point-l" data-drag="left" @touchstart.stop="dragStart" @touchmove.stop="dragMove"></view>
<view class="uni-cropper-point point-lt" data-drag="leftTop"></view>
</view>
</view>
</view>
</view>
</view>
<view class='cropper-config'>
<button type="primary reverse" @click="getImage" style='margin-top: 30rpx;'> 选择头像 </button>
<button type="warn" @click="getImageInfo" style='margin-top: 30rpx;'> 提交 </button>
</view>
<canvas canvas-id="myCanvas" :style="'position:absolute;border: 1px solid red; width:'+imageW+'px;height:'+imageH+'px;top:-9999px;left:-9999px;'"></canvas>
</view>
</view>
</template>
<script>
import config from '@/config'
import store from "@/store"
import { uploadAvatar } from "@/api/system/user"
const baseUrl = config.baseUrl
let sysInfo = uni.getSystemInfoSync()
let SCREEN_WIDTH = sysInfo.screenWidth
let PAGE_X, // 手按下的x位置
PAGE_Y, // 手按下y的位置
PR = sysInfo.pixelRatio, // dpi
T_PAGE_X, // 手移动的时候x的位置
T_PAGE_Y, // 手移动的时候Y的位置
CUT_L, // 初始化拖拽元素的left值
CUT_T, // 初始化拖拽元素的top值
CUT_R, // 初始化拖拽元素的
CUT_B, // 初始化拖拽元素的
CUT_W, // 初始化拖拽元素的宽度
CUT_H, // 初始化拖拽元素的高度
IMG_RATIO, // 图片比例
IMG_REAL_W, // 图片实际的宽度
IMG_REAL_H, // 图片实际的高度
DRAFG_MOVE_RATIO = 1, //移动时候的比例,
INIT_DRAG_POSITION = 100, // 初始化屏幕宽度和裁剪区域的宽度之差,用于设置初始化裁剪的宽度
DRAW_IMAGE_W = sysInfo.screenWidth // 设置生成的图片宽度
export default {
/**
* 页面的初始数据
*/
data() {
return {
imageSrc: store.getters.avatar,
isShowImg: false,
// 初始化的宽高
cropperInitW: SCREEN_WIDTH,
cropperInitH: SCREEN_WIDTH,
// 动态的宽高
cropperW: SCREEN_WIDTH,
cropperH: SCREEN_WIDTH,
// 动态的left top值
cropperL: 0,
cropperT: 0,
transL: 0,
transT: 0,
// 图片缩放值
scaleP: 0,
imageW: 0,
imageH: 0,
// 裁剪框 宽高
cutL: 0,
cutT: 0,
cutB: SCREEN_WIDTH,
cutR: '100%',
qualityWidth: DRAW_IMAGE_W,
innerAspectRadio: DRAFG_MOVE_RATIO
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
this.loadImage()
},
methods: {
setData: function (obj) {
let that = this
Object.keys(obj).forEach(function (key) {
that.$set(that.$data, key, obj[key])
})
},
getImage: function () {
var _this = this
uni.chooseImage({
success: function (res) {
_this.setData({
imageSrc: res.tempFilePaths[0],
})
_this.loadImage()
},
})
},
loadImage: function () {
var _this = this
uni.getImageInfo({
src: _this.imageSrc,
success: function success(res) {
IMG_RATIO = 1 / 1
if (IMG_RATIO >= 1) {
IMG_REAL_W = SCREEN_WIDTH
IMG_REAL_H = SCREEN_WIDTH / IMG_RATIO
} else {
IMG_REAL_W = SCREEN_WIDTH * IMG_RATIO
IMG_REAL_H = SCREEN_WIDTH
}
let minRange = IMG_REAL_W > IMG_REAL_H ? IMG_REAL_W : IMG_REAL_H
INIT_DRAG_POSITION = minRange > INIT_DRAG_POSITION ? INIT_DRAG_POSITION : minRange
// 根据图片的宽高显示不同的效果 保证图片可以正常显示
if (IMG_RATIO >= 1) {
let cutT = Math.ceil((SCREEN_WIDTH / IMG_RATIO - (SCREEN_WIDTH / IMG_RATIO - INIT_DRAG_POSITION)) / 2)
let cutB = cutT
let cutL = Math.ceil((SCREEN_WIDTH - SCREEN_WIDTH + INIT_DRAG_POSITION) / 2)
let cutR = cutL
_this.setData({
cropperW: SCREEN_WIDTH,
cropperH: SCREEN_WIDTH / IMG_RATIO,
// 初始化left right
cropperL: Math.ceil((SCREEN_WIDTH - SCREEN_WIDTH) / 2),
cropperT: Math.ceil((SCREEN_WIDTH - SCREEN_WIDTH / IMG_RATIO) / 2),
cutL: cutL,
cutT: cutT,
cutR: cutR,
cutB: cutB,
// 图片缩放值
imageW: IMG_REAL_W,
imageH: IMG_REAL_H,
scaleP: IMG_REAL_W / SCREEN_WIDTH,
qualityWidth: DRAW_IMAGE_W,
innerAspectRadio: IMG_RATIO
})
} else {
let cutL = Math.ceil((SCREEN_WIDTH * IMG_RATIO - (SCREEN_WIDTH * IMG_RATIO)) / 2)
let cutR = cutL
let cutT = Math.ceil((SCREEN_WIDTH - INIT_DRAG_POSITION) / 2)
let cutB = cutT
_this.setData({
cropperW: SCREEN_WIDTH * IMG_RATIO,
cropperH: SCREEN_WIDTH,
// 初始化left right
cropperL: Math.ceil((SCREEN_WIDTH - SCREEN_WIDTH * IMG_RATIO) / 2),
cropperT: Math.ceil((SCREEN_WIDTH - SCREEN_WIDTH) / 2),
cutL: cutL,
cutT: cutT,
cutR: cutR,
cutB: cutB,
// 图片缩放值
imageW: IMG_REAL_W,
imageH: IMG_REAL_H,
scaleP: IMG_REAL_W / SCREEN_WIDTH,
qualityWidth: DRAW_IMAGE_W,
innerAspectRadio: IMG_RATIO
})
}
_this.setData({
isShowImg: true
})
uni.hideLoading()
}
})
},
// 拖动时候触发的touchStart事件
contentStartMove(e) {
PAGE_X = e.touches[0].pageX
PAGE_Y = e.touches[0].pageY
},
// 拖动时候触发的touchMove事件
contentMoveing(e) {
var _this = this
var dragLengthX = (PAGE_X - e.touches[0].pageX) * DRAFG_MOVE_RATIO
var dragLengthY = (PAGE_Y - e.touches[0].pageY) * DRAFG_MOVE_RATIO
// 左移
if (dragLengthX > 0) {
if (this.cutL - dragLengthX < 0) dragLengthX = this.cutL
} else {
if (this.cutR + dragLengthX < 0) dragLengthX = -this.cutR
}
if (dragLengthY > 0) {
if (this.cutT - dragLengthY < 0) dragLengthY = this.cutT
} else {
if (this.cutB + dragLengthY < 0) dragLengthY = -this.cutB
}
this.setData({
cutL: this.cutL - dragLengthX,
cutT: this.cutT - dragLengthY,
cutR: this.cutR + dragLengthX,
cutB: this.cutB + dragLengthY
})
PAGE_X = e.touches[0].pageX
PAGE_Y = e.touches[0].pageY
},
contentTouchEnd() {
},
// 获取图片
getImageInfo() {
var _this = this
uni.showLoading({
title: '图片生成中...',
})
// 将图片写入画布
const ctx = uni.createCanvasContext('myCanvas')
ctx.drawImage(_this.imageSrc, 0, 0, IMG_REAL_W, IMG_REAL_H)
ctx.draw(true, () => {
// 获取画布要裁剪的位置和宽度 均为百分比 * 画布中图片的宽度 保证了在微信小程序中裁剪的图片模糊 位置不对的问题 canvasT = (_this.cutT / _this.cropperH) * (_this.imageH / pixelRatio)
var canvasW = ((_this.cropperW - _this.cutL - _this.cutR) / _this.cropperW) * IMG_REAL_W
var canvasH = ((_this.cropperH - _this.cutT - _this.cutB) / _this.cropperH) * IMG_REAL_H
var canvasL = (_this.cutL / _this.cropperW) * IMG_REAL_W
var canvasT = (_this.cutT / _this.cropperH) * IMG_REAL_H
uni.canvasToTempFilePath({
x: canvasL,
y: canvasT,
width: canvasW,
height: canvasH,
destWidth: canvasW,
destHeight: canvasH,
quality: 0.5,
canvasId: 'myCanvas',
success: function (res) {
uni.hideLoading()
let data = {name: 'avatarfile', filePath: res.tempFilePath}
uploadAvatar(data).then(response => {
store.commit('SET_AVATAR', baseUrl + response.imgUrl)
uni.showToast({ title: "修改成功", icon: 'success' })
uni.navigateBack()
})
}
})
})
},
// 设置大小的时候触发的touchStart事件
dragStart(e) {
T_PAGE_X = e.touches[0].pageX
T_PAGE_Y = e.touches[0].pageY
CUT_L = this.cutL
CUT_R = this.cutR
CUT_B = this.cutB
CUT_T = this.cutT
},
// 设置大小的时候触发的touchMove事件
dragMove(e) {
var _this = this
var dragType = e.target.dataset.drag
switch (dragType) {
case 'right':
var dragLength = (T_PAGE_X - e.touches[0].pageX) * DRAFG_MOVE_RATIO
if (CUT_R + dragLength < 0) dragLength = -CUT_R
this.setData({
cutR: CUT_R + dragLength
})
break
case 'left':
var dragLength = (T_PAGE_X - e.touches[0].pageX) * DRAFG_MOVE_RATIO
if (CUT_L - dragLength < 0) dragLength = CUT_L
if ((CUT_L - dragLength) > (this.cropperW - this.cutR)) dragLength = CUT_L - (this.cropperW - this.cutR)
this.setData({
cutL: CUT_L - dragLength
})
break
case 'top':
var dragLength = (T_PAGE_Y - e.touches[0].pageY) * DRAFG_MOVE_RATIO
if (CUT_T - dragLength < 0) dragLength = CUT_T
if ((CUT_T - dragLength) > (this.cropperH - this.cutB)) dragLength = CUT_T - (this.cropperH - this.cutB)
this.setData({
cutT: CUT_T - dragLength
})
break
case 'bottom':
var dragLength = (T_PAGE_Y - e.touches[0].pageY) * DRAFG_MOVE_RATIO
if (CUT_B + dragLength < 0) dragLength = -CUT_B
this.setData({
cutB: CUT_B + dragLength
})
break
case 'rightBottom':
var dragLengthX = (T_PAGE_X - e.touches[0].pageX) * DRAFG_MOVE_RATIO
var dragLengthY = (T_PAGE_Y - e.touches[0].pageY) * DRAFG_MOVE_RATIO
if (CUT_B + dragLengthY < 0) dragLengthY = -CUT_B
if (CUT_R + dragLengthX < 0) dragLengthX = -CUT_R
let cutB = CUT_B + dragLengthY
let cutR = CUT_R + dragLengthX
this.setData({
cutB: cutB,
cutR: cutR
})
break
default:
break
}
}
}
}
</script>
<style scoped>
.cropper-config {
padding: 20rpx 40rpx;
}
.cropper-content {
min-height: 750rpx;
width: 100%;
}
.uni-corpper {
position: relative;
overflow: hidden;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: transparent;
-webkit-touch-callout: none;
box-sizing: border-box;
}
.uni-corpper-content {
position: relative;
}
.uni-corpper-content image {
display: block;
width: 100%;
min-width: 0 !important;
max-width: none !important;
height: 100%;
min-height: 0 !important;
max-height: none !important;
image-orientation: 0deg !important;
margin: 0 auto;
}
/* 移动图片效果 */
.uni-cropper-drag-box {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
cursor: move;
background: rgba(0, 0, 0, 0.6);
z-index: 1;
}
/* 内部的信息 */
.uni-corpper-crop-box {
position: absolute;
background: rgba(255, 255, 255, 0.3);
z-index: 2;
}
.uni-corpper-crop-box .uni-cropper-view-box {
position: relative;
display: block;
width: 100%;
height: 100%;
overflow: visible;
outline: 1rpx solid #69f;
outline-color: rgba(102, 153, 255, .75)
}
/* 横向虚线 */
.uni-cropper-dashed-h {
position: absolute;
top: 33.33333333%;
left: 0;
width: 100%;
height: 33.33333333%;
border-top: 1rpx dashed rgba(255, 255, 255, 0.5);
border-bottom: 1rpx dashed rgba(255, 255, 255, 0.5);
}
/* 纵向虚线 */
.uni-cropper-dashed-v {
position: absolute;
left: 33.33333333%;
top: 0;
width: 33.33333333%;
height: 100%;
border-left: 1rpx dashed rgba(255, 255, 255, 0.5);
border-right: 1rpx dashed rgba(255, 255, 255, 0.5);
}
/* 四个方向的线 为了之后的拖动事件*/
.uni-cropper-line-t {
position: absolute;
display: block;
width: 100%;
background-color: #69f;
top: 0;
left: 0;
height: 1rpx;
opacity: 0.1;
cursor: n-resize;
}
.uni-cropper-line-t::before {
content: '';
position: absolute;
top: 50%;
right: 0rpx;
width: 100%;
-webkit-transform: translate3d(0, -50%, 0);
transform: translate3d(0, -50%, 0);
bottom: 0;
height: 41rpx;
background: transparent;
z-index: 11;
}
.uni-cropper-line-r {
position: absolute;
display: block;
background-color: #69f;
top: 0;
right: 0rpx;
width: 1rpx;
opacity: 0.1;
height: 100%;
cursor: e-resize;
}
.uni-cropper-line-r::before {
content: '';
position: absolute;
top: 0;
left: 50%;
width: 41rpx;
-webkit-transform: translate3d(-50%, 0, 0);
transform: translate3d(-50%, 0, 0);
bottom: 0;
height: 100%;
background: transparent;
z-index: 11;
}
.uni-cropper-line-b {
position: absolute;
display: block;
width: 100%;
background-color: #69f;
bottom: 0;
left: 0;
height: 1rpx;
opacity: 0.1;
cursor: s-resize;
}
.uni-cropper-line-b::before {
content: '';
position: absolute;
top: 50%;
right: 0rpx;
width: 100%;
-webkit-transform: translate3d(0, -50%, 0);
transform: translate3d(0, -50%, 0);
bottom: 0;
height: 41rpx;
background: transparent;
z-index: 11;
}
.uni-cropper-line-l {
position: absolute;
display: block;
background-color: #69f;
top: 0;
left: 0;
width: 1rpx;
opacity: 0.1;
height: 100%;
cursor: w-resize;
}
.uni-cropper-line-l::before {
content: '';
position: absolute;
top: 0;
left: 50%;
width: 41rpx;
-webkit-transform: translate3d(-50%, 0, 0);
transform: translate3d(-50%, 0, 0);
bottom: 0;
height: 100%;
background: transparent;
z-index: 11;
}
.uni-cropper-point {
width: 5rpx;
height: 5rpx;
background-color: #69f;
opacity: .75;
position: absolute;
z-index: 3;
}
.point-t {
top: -3rpx;
left: 50%;
margin-left: -3rpx;
cursor: n-resize;
}
.point-tr {
top: -3rpx;
left: 100%;
margin-left: -3rpx;
cursor: n-resize;
}
.point-r {
top: 50%;
left: 100%;
margin-left: -3rpx;
margin-top: -3rpx;
cursor: n-resize;
}
.point-rb {
left: 100%;
top: 100%;
-webkit-transform: translate3d(-50%, -50%, 0);
transform: translate3d(-50%, -50%, 0);
cursor: n-resize;
width: 36rpx;
height: 36rpx;
background-color: #69f;
position: absolute;
z-index: 1112;
opacity: 1;
}
.point-b {
left: 50%;
top: 100%;
margin-left: -3rpx;
margin-top: -3rpx;
cursor: n-resize;
}
.point-bl {
left: 0%;
top: 100%;
margin-left: -3rpx;
margin-top: -3rpx;
cursor: n-resize;
}
.point-l {
left: 0%;
top: 50%;
margin-left: -3rpx;
margin-top: -3rpx;
cursor: n-resize;
}
.point-lt {
left: 0%;
top: 0%;
margin-left: -3rpx;
margin-top: -3rpx;
cursor: n-resize;
}
/* 裁剪框预览内容 */
.uni-cropper-viewer {
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
}
.uni-cropper-viewer image {
position: absolute;
z-index: 2;
}
</style>

View File

@@ -0,0 +1,112 @@
<template>
<view class="help-container">
<view v-for="(item, findex) in list" :key="findex" :title="item.title" class="list-title">
<view class="text-title">
<view :class="item.icon"></view>{{ item.title }}
</view>
<view class="childList">
<view v-for="(child, zindex) in item.childList" :key="zindex" class="question" hover-class="hover"
@click="handleText(child)">
<view class="text-item">{{ child.title }}</view>
<view class="line" v-if="zindex !== item.childList.length - 1"></view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list: [{
icon: 'iconfont icon-github',
title: '若依问题',
childList: [{
title: '若依开源吗?',
content: '开源'
}, {
title: '若依可以商用吗?',
content: '可以'
}, {
title: '若依官网地址多少?',
content: 'http://ruoyi.vip'
}, {
title: '若依文档地址多少?',
content: 'http://doc.ruoyi.vip'
}]
},
{
icon: 'iconfont icon-help',
title: '其他问题',
childList: [{
title: '如何退出登录?',
content: '请点击[我的] - [应用设置] - [退出登录]即可退出登录',
}, {
title: '如何修改用户头像?',
content: '请点击[我的] - [选择头像] - [点击提交]即可更换用户头像',
}, {
title: '如何修改登录密码?',
content: '请点击[我的] - [应用设置] - [修改密码]即可修改登录密码',
}]
}
]
}
},
methods: {
handleText(item) {
this.$tab.navigateTo(`/pages/common/textview/index?title=${item.title}&content=${item.content}`)
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f8f8f8;
}
.help-container {
margin-bottom: 100rpx;
padding: 30rpx;
}
.list-title {
margin-bottom: 30rpx;
}
.childList {
background: #ffffff;
box-shadow: 0px 0px 10rpx rgba(193, 193, 193, 0.2);
border-radius: 16rpx;
margin-top: 10rpx;
}
.line {
width: 100%;
height: 1rpx;
background-color: #F5F5F5;
}
.text-title {
color: #303133;
font-size: 32rpx;
font-weight: bold;
margin-left: 10rpx;
.iconfont {
font-size: 16px;
margin-right: 10rpx;
}
}
.text-item {
font-size: 28rpx;
padding: 24rpx;
}
.question {
color: #606266;
font-size: 28rpx;
}
</style>

188
pda/pages/mine/index.vue Normal file
View File

@@ -0,0 +1,188 @@
<template>
<view class="mine-container" :style="{height: `${windowHeight}px`}">
<!--顶部个人信息栏-->
<view class="header-section">
<view class="flex padding justify-between">
<view class="flex align-center">
<view v-if="!avatar" class="cu-avatar xl round bg-white">
<view class="iconfont icon-people text-gray icon"></view>
</view>
<image v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round" mode="widthFix">
</image>
<view v-if="!name" @click="handleToLogin" class="login-tip">
点击登录
</view>
<view v-if="name" @click="handleToInfo" class="user-info">
<view class="u_title">
用户名:{{ name }}
</view>
</view>
</view>
<view @click="handleToInfo" class="flex align-center">
<text>个人信息</text>
<view class="iconfont icon-right"></view>
</view>
</view>
</view>
<view class="content-section">
<!-- <view class="mine-actions grid col-4 text-center">
<view class="action-item" @click="handleJiaoLiuQun">
<view class="iconfont icon-friendfill text-pink icon"></view>
<text class="text">交流群</text>
</view>
<view class="action-item" @click="handleBuilding">
<view class="iconfont icon-service text-blue icon"></view>
<text class="text">在线客服</text>
</view>
<view class="action-item" @click="handleBuilding">
<view class="iconfont icon-community text-mauve icon"></view>
<text class="text">反馈社区</text>
</view>
<view class="action-item" @click="handleBuilding">
<view class="iconfont icon-dianzan text-green icon"></view>
<text class="text">点赞我们</text>
</view>
</view>-->
<view class="menu-list">
<view class="list-cell list-cell-arrow" @click="handleToEditInfo">
<view class="menu-item-box">
<view class="iconfont icon-user menu-icon"></view>
<view>编辑资料</view>
</view>
</view>
<view class="list-cell list-cell-arrow" @click="handleHelp">
<view class="menu-item-box">
<view class="iconfont icon-help menu-icon"></view>
<view>常见问题</view>
</view>
</view>
<view class="list-cell list-cell-arrow" @click="handleAbout">
<view class="menu-item-box">
<view class="iconfont icon-aixin menu-icon"></view>
<view>关于我们</view>
</view>
</view>
<view class="list-cell list-cell-arrow" @click="handleToSetting">
<view class="menu-item-box">
<view class="iconfont icon-setting menu-icon"></view>
<view>应用设置</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
name: this.$store.state.user.name
}
},
computed: {
avatar() {
return this.$store.state.user.avatar
},
windowHeight() {
return uni.getSystemInfoSync().windowHeight - 50
}
},
methods: {
handleToInfo() {
this.$tab.navigateTo('/pages/mine/info/index')
},
handleToEditInfo() {
this.$tab.navigateTo('/pages/mine/info/edit')
},
handleToSetting() {
this.$tab.navigateTo('/pages/mine/setting/index')
},
handleToLogin() {
this.$tab.reLaunch('/pages/login')
},
handleToAvatar() {
this.$tab.navigateTo('/pages/mine/avatar/index')
},
handleHelp() {
this.$tab.navigateTo('/pages/mine/help/index')
},
handleAbout() {
this.$tab.navigateTo('/pages/mine/about/index')
},
handleJiaoLiuQun() {
this.$modal.showToast('QQ群:①133713780(满)、②146013835(满)、③189091635')
},
handleBuilding() {
this.$modal.showToast('模块建设中~')
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f5f6f7;
}
.mine-container {
width: 100%;
height: 100%;
.header-section {
padding: 15px 15px 45px 15px;
background-color: #3c96f3;
color: white;
.login-tip {
font-size: 18px;
margin-left: 10px;
}
.cu-avatar {
border: 2px solid #eaeaea;
.icon {
font-size: 40px;
}
}
.user-info {
margin-left: 15px;
.u_title {
font-size: 18px;
line-height: 30px;
}
}
}
.content-section {
position: relative;
top: -50px;
.mine-actions {
margin: 15px 15px;
padding: 20px 0px;
border-radius: 8px;
background-color: white;
.action-item {
.icon {
font-size: 28px;
}
.text {
display: block;
font-size: 13px;
margin: 8px 0px;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,127 @@
<template>
<view class="container">
<view class="example">
<uni-forms ref="form" :model="user" labelWidth="80px">
<uni-forms-item label="用户昵称" name="nickName">
<uni-easyinput v-model="user.nickName" placeholder="请输入昵称" />
</uni-forms-item>
<uni-forms-item label="手机号码" name="phonenumber">
<uni-easyinput v-model="user.phonenumber" placeholder="请输入手机号码" />
</uni-forms-item>
<uni-forms-item label="邮箱" name="email">
<uni-easyinput v-model="user.email" placeholder="请输入邮箱" />
</uni-forms-item>
<uni-forms-item label="性别" name="sex" required>
<uni-data-checkbox v-model="user.sex" :localdata="sexs" />
</uni-forms-item>
</uni-forms>
<button type="primary" @click="submit">提交</button>
</view>
</view>
</template>
<script>
import { getUserProfile } from "@/api/system/user"
import { updateUserProfile } from "@/api/system/user"
export default {
data() {
return {
user: {
nickName: "",
phonenumber: "",
email: "",
sex: ""
},
sexs: [{
text: '男',
value: "0"
}, {
text: '女',
value: "1"
}],
rules: {
nickName: {
rules: [{
required: true,
errorMessage: '用户昵称不能为空'
}]
},
phonenumber: {
rules: [{
required: true,
errorMessage: '手机号码不能为空'
}, {
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
errorMessage: '请输入正确的手机号码'
}]
},
email: {
rules: [{
required: true,
errorMessage: '邮箱地址不能为空'
}, {
format: 'email',
errorMessage: '请输入正确的邮箱地址'
}]
}
}
}
},
onLoad() {
this.getUser()
},
onReady() {
this.$refs.form.setRules(this.rules)
},
methods: {
getUser() {
getUserProfile().then(response => {
this.user = response.data
})
},
submit(ref) {
this.$refs.form.validate().then(res => {
updateUserProfile(this.user).then(response => {
this.$modal.msgSuccess("修改成功")
})
})
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #ffffff;
}
.example {
padding: 15px;
background-color: #fff;
}
.segmented-control {
margin-bottom: 15px;
}
.button-group {
margin-top: 15px;
display: flex;
justify-content: space-around;
}
.form-item {
display: flex;
align-items: center;
flex: 1;
}
.button {
display: flex;
align-items: center;
height: 35px;
line-height: 35px;
margin-left: 10px;
}
</style>

View File

@@ -0,0 +1,44 @@
<template>
<view class="container">
<uni-list>
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" title="昵称" :rightText="user.nickName" />
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'phone-filled'}" title="手机号码" :rightText="user.phonenumber" />
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'email-filled'}" title="邮箱" :rightText="user.email" />
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'auth-filled'}" title="岗位" :rightText="postGroup" />
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'staff-filled'}" title="角色" :rightText="roleGroup" />
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" title="创建日期" :rightText="user.createTime" />
</uni-list>
</view>
</template>
<script>
import { getUserProfile } from "@/api/system/user"
export default {
data() {
return {
user: {},
roleGroup: "",
postGroup: ""
}
},
onLoad() {
this.getUser()
},
methods: {
getUser() {
getUserProfile().then(response => {
this.user = response.data
this.roleGroup = response.roleGroup
this.postGroup = response.postGroup
})
}
}
}
</script>
<style lang="scss">
page {
background-color: #ffffff;
}
</style>

View File

@@ -0,0 +1,85 @@
<template>
<view class="pwd-retrieve-container">
<uni-forms ref="form" :value="user" labelWidth="80px">
<uni-forms-item name="oldPassword" label="旧密码">
<uni-easyinput type="password" v-model="user.oldPassword" placeholder="请输入旧密码" />
</uni-forms-item>
<uni-forms-item name="newPassword" label="新密码">
<uni-easyinput type="password" v-model="user.newPassword" placeholder="请输入新密码" />
</uni-forms-item>
<uni-forms-item name="confirmPassword" label="确认密码">
<uni-easyinput type="password" v-model="user.confirmPassword" placeholder="请确认新密码" />
</uni-forms-item>
<button type="primary" @click="submit">提交</button>
</uni-forms>
</view>
</template>
<script>
import { updateUserPwd } from "@/api/system/user"
export default {
data() {
return {
user: {
oldPassword: undefined,
newPassword: undefined,
confirmPassword: undefined
},
rules: {
oldPassword: {
rules: [{
required: true,
errorMessage: '旧密码不能为空'
}]
},
newPassword: {
rules: [{
required: true,
errorMessage: '新密码不能为空',
},
{
minLength: 6,
maxLength: 20,
errorMessage: '长度在 6 到 20 个字符'
}
]
},
confirmPassword: {
rules: [{
required: true,
errorMessage: '确认密码不能为空'
}, {
validateFunction: (rule, value, data) => data.newPassword === value,
errorMessage: '两次输入的密码不一致'
}
]
}
}
}
},
onReady() {
this.$refs.form.setRules(this.rules)
},
methods: {
submit() {
this.$refs.form.validate().then(res => {
updateUserPwd(this.user.oldPassword, this.user.newPassword).then(response => {
this.$modal.msgSuccess("修改成功")
})
})
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #ffffff;
}
.pwd-retrieve-container {
padding-top: 36rpx;
padding: 15px;
}
</style>

View File

@@ -0,0 +1,78 @@
<template>
<view class="setting-container" :style="{height: `${windowHeight}px`}">
<view class="menu-list">
<view class="list-cell list-cell-arrow" @click="handleToPwd">
<view class="menu-item-box">
<view class="iconfont icon-password menu-icon"></view>
<view>修改密码</view>
</view>
</view>
<view class="list-cell list-cell-arrow" @click="handleToUpgrade">
<view class="menu-item-box">
<view class="iconfont icon-refresh menu-icon"></view>
<view>检查更新</view>
</view>
</view>
<view class="list-cell list-cell-arrow" @click="handleCleanTmp">
<view class="menu-item-box">
<view class="iconfont icon-clean menu-icon"></view>
<view>清理缓存</view>
</view>
</view>
</view>
<view class="cu-list menu">
<view class="cu-item item-box">
<view class="content text-center" @click="handleLogout">
<text class="text-black">退出登录</text>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
windowHeight: uni.getSystemInfoSync().windowHeight
}
},
methods: {
handleToPwd() {
this.$tab.navigateTo('/pages/mine/pwd/index')
},
handleToUpgrade() {
this.$modal.showToast('模块建设中~')
},
handleCleanTmp() {
this.$modal.showToast('模块建设中~')
},
handleLogout() {
this.$modal.confirm('确定注销并退出系统吗?').then(() => {
this.$store.dispatch('LogOut').then(() => {}).finally(()=>{
this.$tab.reLaunch('/pages/index')
})
})
}
}
}
</script>
<style lang="scss" scoped>
.page {
background-color: #f8f8f8;
}
.item-box {
background-color: #FFFFFF;
margin: 30rpx;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 10rpx;
border-radius: 8rpx;
color: #303133;
font-size: 32rpx;
}
</style>

189
pda/pages/register.vue Normal file
View File

@@ -0,0 +1,189 @@
<template>
<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">若依移动端注册</text>
</view>
<view class="login-form-content">
<view class="input-item flex align-center">
<view class="iconfont icon-user icon"></view>
<input v-model="registerForm.username" class="input" type="text" placeholder="请输入账号" maxlength="30" />
</view>
<view class="input-item flex align-center">
<view class="iconfont icon-password icon"></view>
<input v-model="registerForm.password" type="password" class="input" placeholder="请输入密码" maxlength="20" />
</view>
<view class="input-item flex align-center">
<view class="iconfont icon-password icon"></view>
<input v-model="registerForm.confirmPassword" type="password" class="input" placeholder="请输入重复密码" maxlength="20" />
</view>
<view class="input-item flex align-center" style="width: 60%;margin: 0px;" v-if="captchaEnabled">
<view class="iconfont icon-code icon"></view>
<input v-model="registerForm.code" type="number" class="input" placeholder="请输入验证码" maxlength="4" />
<view class="login-code">
<image :src="codeUrl" @click="getCode" class="login-code-img"></image>
</view>
</view>
<view class="action-btn">
<button @click="handleRegister()" class="register-btn cu-btn block bg-blue lg round">注册</button>
</view>
</view>
<view class="xieyi text-center">
<text @click="handleUserLogin" class="text-blue">使用已有账号登录</text>
</view>
</view>
</template>
<script>
import { getCodeImg, register } from '@/api/login'
export default {
data() {
return {
codeUrl: "",
captchaEnabled: true,
globalConfig: getApp().globalData.config,
registerForm: {
username: "",
password: "",
confirmPassword: "",
code: "",
uuid: ""
}
}
},
created() {
this.getCode()
},
methods: {
// 用户登录
handleUserLogin() {
this.$tab.navigateTo(`/pages/login`)
},
// 获取图形验证码
getCode() {
getCodeImg().then(res => {
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled
if (this.captchaEnabled) {
this.codeUrl = 'data:image/gif;base64,' + res.img
this.registerForm.uuid = res.uuid
}
})
},
// 注册方法
async handleRegister() {
if (this.registerForm.username === "") {
this.$modal.msgError("请输入您的账号")
} else if (this.registerForm.password === "") {
this.$modal.msgError("请输入您的密码")
} else if (this.registerForm.confirmPassword === "") {
this.$modal.msgError("请再次输入您的密码")
} else if (this.registerForm.password !== this.registerForm.confirmPassword) {
this.$modal.msgError("两次输入的密码不一致")
} else if (this.registerForm.code === "" && this.captchaEnabled) {
this.$modal.msgError("请输入验证码")
} else {
this.$modal.loading("注册中,请耐心等待...")
this.register()
}
},
// 用户注册
async register() {
register(this.registerForm).then(res => {
this.$modal.closeLoading()
uni.showModal({
title: "系统提示",
content: "恭喜你,您的账号 " + this.registerForm.username + " 注册成功!",
success: function (res) {
if (res.confirm) {
uni.redirectTo({ url: `/pages/login` });
}
}
})
}).catch(() => {
if (this.captchaEnabled) {
this.getCode()
}
})
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #ffffff;
}
.normal-login-container {
width: 100%;
.logo-content {
width: 100%;
font-size: 21px;
text-align: center;
padding-top: 15%;
image {
border-radius: 4px;
}
.title {
margin-left: 10px;
}
}
.login-form-content {
text-align: center;
margin: 20px auto;
margin-top: 15%;
width: 80%;
.input-item {
margin: 20px auto;
background-color: #f5f6f7;
height: 45px;
border-radius: 20px;
.icon {
font-size: 38rpx;
margin-left: 10px;
color: #999;
}
.input {
width: 100%;
font-size: 14px;
line-height: 20px;
text-align: left;
padding-left: 15px;
}
}
.register-btn {
margin-top: 40px;
height: 45px;
}
.xieyi {
color: #333;
margin-top: 20px;
}
.login-code {
height: 38px;
float: right;
.login-code-img {
height: 38px;
position: absolute;
margin-left: 10px;
width: 200rpx;
}
}
}
}
</style>

View File

@@ -0,0 +1,521 @@
<template>
<view class="page-container">
<!-- 任务信息 -->
<view class="task-info" v-if="taskNo">
<text class="task-label">任务编号</text>
<text class="task-value">{{ taskNo }}</text>
</view>
<!-- 托盘信息 -->
<view class="form-section">
<text class="form-title">托盘信息</text>
<view class="form-item">
<text class="form-label">托盘号</text>
<input class="form-input" v-model="trayCode" placeholder="请输入托盘号" />
</view>
</view>
<!-- 扫码添加物料 -->
<view class="scan-section">
<view class="scan-header">
<text class="scan-title">扫描入库子单号</text>
<view class="scan-btn" @click="startScan">
<uni-icons type="scan" size="18" color="#1890ff"></uni-icons>
<text class="scan-btn-text">扫码</text>
</view>
</view>
<view class="input-wrap">
<input class="scan-input" v-model="barcode" placeholder="请输入或扫描入库子单号"
@confirm="handleBarcode" />
</view>
</view>
<!-- 当前扫码物料信息(待添加) -->
<view class="form-section" v-if="currentMaterial">
<text class="form-title">物料信息</text>
<view class="info-row">
<text class="info-label">物料编码</text>
<text class="info-value">{{ currentMaterial.productId }}</text>
</view>
<view class="info-row">
<text class="info-label">物料名称</text>
<text class="info-value">{{ currentMaterial.productName }}</text>
</view>
<view class="info-row">
<text class="info-label">子单号</text>
<text class="info-value">{{ currentMaterial.stockinDetailId }}</text>
</view>
<view class="form-item">
<text class="form-label">绑定数量</text>
<input class="form-input" v-model="currentQty" type="number" placeholder="请输入绑定数量" />
</view>
<button class="btn-add" @click="addItem">
<uni-icons type="plus" size="16" color="#fff"></uni-icons>
<text class="btn-add-text">加入列表</text>
</button>
</view>
<!-- 已添加物料列表 -->
<view class="list-section" v-if="items.length > 0">
<view class="section-header">
<text class="section-title">已绑定物料({{ items.length }} 种)</text>
</view>
<view class="item-card" v-for="(item, index) in items" :key="index">
<view class="item-body">
<view class="item-row">
<text class="item-label">物料编码</text>
<text class="item-value">{{ item.productId }}</text>
</view>
<view class="item-row">
<text class="item-label">物料名称</text>
<text class="item-value">{{ item.productName }}</text>
</view>
<view class="item-row">
<text class="item-label">绑定数量</text>
<text class="item-value highlight">{{ item.quantity }}</text>
</view>
</view>
<view class="item-delete" @click="removeItem(index)">
<uni-icons type="trash" size="20" color="#f5222d"></uni-icons>
</view>
</view>
</view>
<!-- 空状态提示 -->
<view class="empty-state" v-if="items.length === 0">
<text class="empty-text">请扫码添加物料</text>
</view>
<!-- 操作按钮 -->
<view class="btn-section">
<button class="btn btn-primary" :disabled="items.length === 0 || !trayCode" @click="submitBindTrayAction">
确认绑盘({{ items.length }} 种物料)
</button>
<button class="btn btn-success" :disabled="items.length === 0 || !trayCode" @click="submitAddInJobAction">
生成入库作业
</button>
<button class="btn btn-default" @click="resetAll">全部重置</button>
</view>
</view>
</template>
<script>
import { getMaterialByDetailId, submitBindTray,submitAddInJob } from '@/api/warehouse/inbound'
export default {
data() {
return {
taskNo: '',
trayCode: '',
// 当前扫码
barcode: '',
currentMaterial: null,
currentQty: '',
// 已加入列表的物料
items: []
}
},
onLoad(options) {
if (options.taskNo) {
this.taskNo = options.taskNo
}
},
methods: {
// 调用摄像头扫码
startScan() {
var that = this
uni.scanCode({
onlyFromCamera: false,
scanType: ['barCode', 'qrCode'],
success: function(res) {
that.barcode = res.result
that.handleBarcode()
}
})
},
// 根据入库明细ID查询物料
handleBarcode() {
if (!this.barcode) {
this.$modal.msg('请输入入库子单号')
return
}
var that = this
getMaterialByDetailId(this.barcode).then(function(res) {
that.currentMaterial = res.data
that.currentQty = res.data.quantity ? String(res.data.quantity) : ''
that.$modal.msgSuccess('物料信息获取成功')
}).catch(function() {
that.currentMaterial = null
that.currentQty = ''
that.$modal.msg('未找到该入库子单信息')
})
},
// 将当前物料加入绑定列表
addItem() {
if (!this.currentMaterial) {
this.$modal.msg('请先扫码查询物料')
return
}
if (!this.currentQty || Number(this.currentQty) <= 0) {
this.$modal.msg('请输入有效的绑定数量')
return
}
// 检查是否已存在相同子单
var exists = this.items.some(function(i) {
return i.stockinDetailId === this.currentMaterial.stockinDetailId
}.bind(this))
if (exists) {
this.$modal.msg('该物料已在列表中,请勿重复添加')
return
}
this.items.push({
stockinDetailId: this.currentMaterial.stockinDetailId,
productId: this.currentMaterial.productId,
productName: this.currentMaterial.productName,
quantity: Number(this.currentQty)
})
// 清空当前扫码区,继续扫下一个
this.barcode = ''
this.currentMaterial = null
this.currentQty = ''
this.$modal.msgSuccess('已加入列表')
},
// 从列表中移除某条物料
removeItem(index) {
this.items.splice(index, 1)
},
// 提交绑盘
submitBindTrayAction() {
if (!this.trayCode) {
this.$modal.msg('请输入托盘号')
return
}
if (this.items.length === 0) {
this.$modal.msg('请至少添加一种物料')
return
}
var data = {
trayCode: this.trayCode,
items: this.items.map(function(i) {
return {
stockinDetailId: i.stockinDetailId,
productId: i.productId,
quantity: i.quantity
}
})
}
var that = this
submitBindTray(data).then(function(res) {
that.$modal.msgSuccess(res.msg || '入库绑盘成功')
that.resetAll()
}).catch(function() {})
},
submitAddInJobAction() {
if (!this.trayCode) {
this.$modal.msg('请输入托盘号')
return
}
if (this.items.length === 0) {
this.$modal.msg('请至少添加一种物料')
return
}
var data = {
trayCode: this.trayCode,
}
var that = this
submitAddInJob(data).then(function(res) {
that.$modal.msgSuccess(res.msg || '生成入库作业成功')
that.resetAll()
}).catch(function() {})
},
// 全部重置
resetAll() {
this.trayCode = ''
this.barcode = ''
this.currentMaterial = null
this.currentQty = ''
this.items = []
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f5f7fa;
min-height: 100%;
}
.page-container {
padding: 24rpx;
padding-bottom: 60rpx;
}
/* 任务信息 */
.task-info {
background: #e6f7ff;
border-radius: 12rpx;
padding: 20rpx 24rpx;
margin-bottom: 24rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.task-label {
font-size: 26rpx;
color: #1890ff;
}
.task-value {
font-size: 26rpx;
color: #333;
font-weight: 500;
}
/* 扫码区 */
.scan-section {
background: #fff;
border-radius: 16rpx;
padding: 28rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.scan-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
}
.scan-title {
font-size: 30rpx;
font-weight: 500;
color: #333;
}
.scan-btn {
display: flex;
align-items: center;
padding: 8rpx 20rpx;
border: 1rpx solid #1890ff;
border-radius: 8rpx;
}
.scan-btn-text {
font-size: 24rpx;
color: #1890ff;
margin-left: 8rpx;
}
.input-wrap {
border: 1rpx solid #e8e8e8;
border-radius: 8rpx;
padding: 4rpx;
}
.scan-input {
font-size: 28rpx;
padding: 16rpx;
word-break: break-all;
width: 100%;
height: auto;
line-height: 1.4;
}
/* 通用 form-section */
.form-section {
background: #fff;
border-radius: 16rpx;
padding: 28rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.form-title {
font-size: 30rpx;
font-weight: 500;
color: #333;
margin-bottom: 24rpx;
padding-bottom: 16rpx;
border-bottom: 1rpx solid #f0f0f0;
display: block;
}
.form-item {
display: flex;
align-items: center;
padding: 16rpx 0;
}
.form-label {
font-size: 28rpx;
color: #666;
width: 160rpx;
flex-shrink: 0;
}
.form-input {
flex: 1;
font-size: 28rpx;
border: 1rpx solid #e8e8e8;
border-radius: 8rpx;
padding: 16rpx;
word-break: break-all;
min-width: 0;
height: auto;
line-height: 1.4;
}
.info-row {
display: flex;
justify-content: space-between;
padding: 16rpx 0;
border-bottom: 1rpx solid #f5f5f5;
}
.info-label {
font-size: 28rpx;
color: #999;
}
.info-value {
font-size: 28rpx;
color: #333;
}
/* 加入列表按钮 */
.btn-add {
margin-top: 24rpx;
background: #1890ff;
color: #fff;
border-radius: 12rpx;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: center;
padding: 20rpx 0;
border: none;
}
.btn-add-text {
font-size: 28rpx;
color: #fff;
margin-left: 8rpx;
}
/* 已添加物料列表 */
.list-section {
margin-bottom: 24rpx;
}
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16rpx;
}
.section-title {
font-size: 30rpx;
font-weight: 500;
color: #333;
}
.item-card {
background: #fff;
border-radius: 16rpx;
padding: 24rpx 28rpx;
margin-bottom: 16rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
display: flex;
align-items: center;
justify-content: space-between;
}
.item-body {
flex: 1;
margin-right: 20rpx;
}
.item-row {
display: flex;
justify-content: space-between;
padding: 8rpx 0;
}
.item-label {
font-size: 26rpx;
color: #999;
}
.item-value {
font-size: 26rpx;
color: #333;
}
.item-value.highlight {
color: #1890ff;
font-weight: 500;
}
.item-delete {
padding: 8rpx;
}
/* 空状态 */
.empty-state {
background: #fff;
border-radius: 16rpx;
padding: 60rpx 0;
margin-bottom: 24rpx;
display: flex;
align-items: center;
justify-content: center;
}
.empty-text {
font-size: 28rpx;
color: #ccc;
}
/* 底部按钮 */
.btn-section {
padding: 8rpx 0 24rpx;
}
.btn {
font-size: 30rpx;
border-radius: 12rpx;
margin-bottom: 20rpx;
}
.btn-primary {
background: #1890ff;
color: #fff;
}
.btn-success {
background: #0fe825;
color: #fff;
}
.btn-primary[disabled] {
background: #b0d4f5;
color: #fff;
}
.btn-default {
background: #fff;
color: #666;
border: 1rpx solid #d9d9d9;
}
</style>

View File

@@ -0,0 +1,298 @@
<template>
<view class="page-container">
<!-- 入库管理功能入口 -->
<view class="menu-section">
<view class="menu-card" @click="navigateTo('/pages/warehouse/inbound/bindTray')">
<view class="card-left">
<view class="card-icon blue">
<uni-icons type="scan" size="24" color="#fff"></uni-icons>
</view>
<view class="card-info">
<text class="card-title">入库绑盘</text>
<text class="card-desc">扫描物料条码进行入库绑盘操作</text>
</view>
</view>
<uni-icons type="right" size="18" color="#ccc"></uni-icons>
</view>
<view class="menu-card" @click="navigateTo('/pages/warehouse/inbound/supply')">
<view class="card-left">
<view class="card-icon green">
<uni-icons type="plus" size="24" color="#fff"></uni-icons>
</view>
<view class="card-info">
<text class="card-title">补料入库</text>
<text class="card-desc">产线补料申请入库操作</text>
</view>
</view>
<uni-icons type="right" size="18" color="#ccc"></uni-icons>
</view>
</view>
<!-- 待处理单据 -->
<view class="task-section">
<view class="section-header">
<text class="section-title">待处理单据</text>
<text class="section-more" @click="refreshTasks">刷新</text>
</view>
<view v-if="taskList.length === 0" class="empty-state">
<text class="empty-text">暂无待处理单据</text>
</view>
<view v-else>
<view class="task-card" v-for="(item, index) in taskList" :key="index"
@click="handleTask(item)">
<view class="task-header">
<text class="task-type">{{ item.typeName }}</text>
<text class="task-no">{{ item.taskNo }}</text>
</view>
<view class="task-body">
<view class="task-info-item">
<text class="info-label">物料编码</text>
<text class="info-value">{{ item.productId }}</text>
</view>
<view class="task-info-item">
<text class="info-label">物料名称</text>
<text class="info-value">{{ item.productName }}</text>
</view>
<view class="task-info-item">
<text class="info-label">数量</text>
<text class="info-value">{{ item.quantity - item.assignNum }}</text>
</view>
</view>
<view class="task-footer">
<text class="task-time">{{ item.createTime }}</text>
<view class="task-status" :class="item.statusClass">{{ item.statusName }}</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { getInboundTaskList } from '@/api/warehouse/inbound'
import UniIcons from "../../../uni_modules/uni-icons/components/uni-icons/uni-icons.vue";
export default {
components: {UniIcons},
data() {
return {
taskList: []
}
},
onLoad() {
this.loadTasks()
},
onShow() {
this.loadTasks()
},
methods: {
navigateTo(url) {
this.$tab.navigateTo(url)
},
loadTasks() {
getInboundTaskList().then(res => {
this.taskList = res.rows || []
}).catch(() => {
this.taskList = []
})
},
refreshTasks() {
this.loadTasks()
this.$modal.showToast('刷新成功')
},
handleTask(item) {
if (item.type === 'bindTray') {
this.$tab.navigateTo('/pages/warehouse/inbound/bindTray?taskNo=' + item.taskNo)
} else if (item.type === 'supply') {
this.$tab.navigateTo('/pages/warehouse/inbound/supply?taskNo=' + item.taskNo)
}
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f5f7fa;
min-height: 100%;
}
.page-container {
padding: 24rpx;
}
.menu-section {
margin-bottom: 32rpx;
}
.menu-card {
background: #fff;
border-radius: 16rpx;
padding: 32rpx 28rpx;
margin-bottom: 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.card-left {
display: flex;
align-items: center;
flex: 1;
}
.card-icon {
width: 72rpx;
height: 72rpx;
border-radius: 16rpx;
display: flex;
align-items: center;
justify-content: center;
margin-right: 24rpx;
}
.card-icon.blue {
background: linear-gradient(135deg, #1890ff, #40a9ff);
}
.card-icon.green {
background: linear-gradient(135deg, #52c41a, #73d13d);
}
.card-info {
display: flex;
flex-direction: column;
}
.card-title {
font-size: 30rpx;
font-weight: 500;
color: #333;
margin-bottom: 8rpx;
}
.card-desc {
font-size: 24rpx;
color: #999;
}
.task-section {
margin-top: 16rpx;
}
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
}
.section-title {
font-size: 30rpx;
font-weight: 500;
color: #333;
}
.section-more {
font-size: 26rpx;
color: #1890ff;
}
.empty-state {
background: #fff;
border-radius: 16rpx;
padding: 80rpx 0;
display: flex;
align-items: center;
justify-content: center;
}
.empty-text {
font-size: 28rpx;
color: #ccc;
}
.task-card {
background: #fff;
border-radius: 16rpx;
padding: 28rpx;
margin-bottom: 20rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.task-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
padding-bottom: 16rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.task-type {
font-size: 28rpx;
font-weight: 500;
color: #1890ff;
}
.task-no {
font-size: 24rpx;
color: #999;
}
.task-body {
margin-bottom: 16rpx;
}
.task-info-item {
display: flex;
justify-content: space-between;
padding: 10rpx 0;
}
.info-label {
font-size: 26rpx;
color: #999;
}
.info-value {
font-size: 26rpx;
color: #333;
}
.task-footer {
display: flex;
justify-content: space-between;
align-items: center;
padding-top: 16rpx;
border-top: 1rpx solid #f0f0f0;
}
.task-time {
font-size: 22rpx;
color: #ccc;
}
.task-status {
font-size: 22rpx;
padding: 4rpx 16rpx;
border-radius: 8rpx;
}
.task-status.pending {
color: #fa8c16;
background: #fff7e6;
}
.task-status.processing {
color: #1890ff;
background: #e6f7ff;
}
.task-status.completed {
color: #52c41a;
background: #f6ffed;
}
</style>

View File

@@ -0,0 +1,318 @@
<template>
<view class="page-container">
<!-- 任务信息 -->
<view class="task-info" v-if="taskNo">
<text class="task-label">任务编号</text>
<text class="task-value">{{ taskNo }}</text>
</view>
<!-- 扫码区域 -->
<view class="scan-section">
<view class="scan-header">
<text class="scan-title">扫描物料条码</text>
<view class="scan-btn" @click="startScan">
<uni-icons type="scan" size="18" color="#52c41a"></uni-icons>
<text class="scan-btn-text green">扫码</text>
</view>
</view>
<view class="input-wrap">
<input class="scan-input" v-model="barcode" placeholder="请输入或扫描物料条码"
@confirm="handleBarcode" focus />
</view>
</view>
<!-- 补料信息 -->
<view class="form-section">
<text class="form-title">补料信息</text>
<view class="form-item">
<text class="form-label">产线</text>
<input class="form-input" v-model="form.lineCode" placeholder="请输入产线编码" />
</view>
<view class="form-item">
<text class="form-label">工位</text>
<input class="form-input" v-model="form.stationCode" placeholder="请输入工位编码" />
</view>
<view class="form-item">
<text class="form-label">补料数量</text>
<input class="form-input" v-model="form.quantity" type="number" placeholder="请输入补料数量" />
</view>
<view class="form-item">
<text class="form-label">补料原因</text>
<input class="form-input" v-model="form.reason" placeholder="请输入补料原因" />
</view>
</view>
<!-- 物料信息 -->
<view class="form-section" v-if="materialInfo">
<text class="form-title">物料信息</text>
<view class="info-row">
<text class="info-label">物料编码</text>
<text class="info-value">{{ materialInfo.materialCode }}</text>
</view>
<view class="info-row">
<text class="info-label">物料名称</text>
<text class="info-value">{{ materialInfo.materialName }}</text>
</view>
<view class="info-row">
<text class="info-label">规格型号</text>
<text class="info-value">{{ materialInfo.spec }}</text>
</view>
<view class="info-row">
<text class="info-label">当前库存</text>
<text class="info-value">{{ materialInfo.stock }}</text>
</view>
</view>
<!-- 操作按钮 -->
<view class="btn-section">
<button class="btn btn-success" @click="submitSupply">确认补料入库</button>
<button class="btn btn-default" @click="resetForm">重置</button>
</view>
</view>
</template>
<script>
import { getMaterialByBarcode, submitSupplyInbound } from '@/api/warehouse/inbound'
export default {
data() {
return {
taskNo: '',
barcode: '',
materialInfo: null,
form: {
lineCode: '',
stationCode: '',
quantity: '',
reason: ''
}
}
},
onLoad(options) {
if (options.taskNo) {
this.taskNo = options.taskNo
}
},
methods: {
startScan() {
var that = this
uni.scanCode({
onlyFromCamera: false,
scanType: ['barCode', 'qrCode'],
success: function(res) {
that.barcode = res.result
that.handleBarcode()
}
})
},
handleBarcode() {
if (!this.barcode) {
this.$modal.msg('请输入物料条码')
return
}
var that = this
getMaterialByBarcode(this.barcode).then(function(res) {
that.materialInfo = res.data
that.$modal.msgSuccess('物料信息获取成功')
}).catch(function() {
that.materialInfo = null
})
},
submitSupply() {
if (!this.barcode) {
this.$modal.msg('请输入物料条码')
return
}
if (!this.form.lineCode) {
this.$modal.msg('请输入产线编码')
return
}
if (!this.form.quantity) {
this.$modal.msg('请输入补料数量')
return
}
var data = {
taskNo: this.taskNo,
barcode: this.barcode,
lineCode: this.form.lineCode,
stationCode: this.form.stationCode,
quantity: this.form.quantity,
reason: this.form.reason
}
var that = this
submitSupplyInbound(data).then(function() {
that.$modal.msgSuccess('补料入库成功')
that.resetForm()
})
},
resetForm() {
this.barcode = ''
this.materialInfo = null
this.form = {
lineCode: '',
stationCode: '',
quantity: '',
reason: ''
}
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f5f7fa;
min-height: 100%;
}
.page-container {
padding: 24rpx;
}
.task-info {
background: #f6ffed;
border-radius: 12rpx;
padding: 20rpx 24rpx;
margin-bottom: 24rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.task-label {
font-size: 26rpx;
color: #52c41a;
}
.task-value {
font-size: 26rpx;
color: #333;
font-weight: 500;
}
.scan-section {
background: #fff;
border-radius: 16rpx;
padding: 28rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.scan-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
}
.scan-title {
font-size: 30rpx;
font-weight: 500;
color: #333;
}
.scan-btn {
display: flex;
align-items: center;
padding: 8rpx 20rpx;
border: 1rpx solid #52c41a;
border-radius: 8rpx;
}
.scan-btn-text {
font-size: 24rpx;
color: #1890ff;
margin-left: 8rpx;
}
.scan-btn-text.green {
color: #52c41a;
}
.input-wrap {
border: 1rpx solid #e8e8e8;
border-radius: 8rpx;
padding: 4rpx;
}
.scan-input {
font-size: 28rpx;
padding: 16rpx;
}
.form-section {
background: #fff;
border-radius: 16rpx;
padding: 28rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.form-title {
font-size: 30rpx;
font-weight: 500;
color: #333;
margin-bottom: 24rpx;
padding-bottom: 16rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.form-item {
display: flex;
align-items: center;
padding: 16rpx 0;
}
.form-label {
font-size: 28rpx;
color: #666;
width: 160rpx;
flex-shrink: 0;
}
.form-input {
flex: 1;
font-size: 28rpx;
border: 1rpx solid #e8e8e8;
border-radius: 8rpx;
padding: 16rpx;
}
.info-row {
display: flex;
justify-content: space-between;
padding: 16rpx 0;
border-bottom: 1rpx solid #f5f5f5;
}
.info-label {
font-size: 28rpx;
color: #999;
}
.info-value {
font-size: 28rpx;
color: #333;
}
.btn-section {
padding: 24rpx 0;
}
.btn {
font-size: 30rpx;
border-radius: 12rpx;
margin-bottom: 20rpx;
}
.btn-success {
background: #52c41a;
color: #fff;
}
.btn-default {
background: #fff;
color: #666;
border: 1rpx solid #d9d9d9;
}
</style>

View File

@@ -0,0 +1,119 @@
<template>
<view class="page-container">
<view class="module-header">
<uni-icons type="search" size="22" color="#52c41a"></uni-icons>
<text class="header-title">盘点管理</text>
</view>
<view class="feature-list">
<view class="feature-card" @click="$modal.showToast('功能开发中')">
<view class="feature-left">
<uni-icons type="list" size="20" color="#1890ff"></uni-icons>
<text class="feature-name">盘点任务列表</text>
</view>
<uni-icons type="right" size="16" color="#ccc"></uni-icons>
</view>
<view class="feature-card" @click="$modal.showToast('功能开发中')">
<view class="feature-left">
<uni-icons type="scan" size="20" color="#fa8c16"></uni-icons>
<text class="feature-name">扫码盘点</text>
</view>
<uni-icons type="right" size="16" color="#ccc"></uni-icons>
</view>
<view class="feature-card" @click="$modal.showToast('功能开发中')">
<view class="feature-left">
<uni-icons type="compose" size="20" color="#52c41a"></uni-icons>
<text class="feature-name">盘点差异记录</text>
</view>
<uni-icons type="right" size="16" color="#ccc"></uni-icons>
</view>
<view class="feature-card" @click="$modal.showToast('功能开发中')">
<view class="feature-left">
<uni-icons type="paperplane" size="20" color="#722ed1"></uni-icons>
<text class="feature-name">盘点报告</text>
</view>
<uni-icons type="right" size="16" color="#ccc"></uni-icons>
</view>
</view>
<view class="empty-tip">
<text class="tip-text">盘点管理模块正在开发中,敬请期待</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f5f7fa;
min-height: 100%;
}
.page-container {
padding: 24rpx;
}
.module-header {
display: flex;
align-items: center;
padding: 24rpx 0;
margin-bottom: 20rpx;
}
.header-title {
font-size: 32rpx;
font-weight: 500;
color: #333;
margin-left: 12rpx;
}
.feature-list {
background: #fff;
border-radius: 16rpx;
overflow: hidden;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.feature-card {
display: flex;
align-items: center;
justify-content: space-between;
padding: 32rpx 28rpx;
border-bottom: 1rpx solid #f5f5f5;
}
.feature-card:last-child {
border-bottom: none;
}
.feature-left {
display: flex;
align-items: center;
}
.feature-name {
font-size: 28rpx;
color: #333;
margin-left: 16rpx;
}
.empty-tip {
padding: 60rpx 0;
text-align: center;
}
.tip-text {
font-size: 26rpx;
color: #ccc;
}
</style>

View File

@@ -0,0 +1,314 @@
<template>
<view class="page-container">
<!-- 任务信息 -->
<view class="task-info" v-if="taskNo">
<text class="task-label">出库任务编号</text>
<text class="task-value">{{ taskNo }}</text>
</view>
<!-- 扫码区域 -->
<view class="scan-section">
<view class="scan-header">
<text class="scan-title">扫描出库物料条码</text>
<view class="scan-btn" @click="startScan">
<uni-icons type="scan" size="18" color="#fa8c16"></uni-icons>
<text class="scan-btn-text orange">扫码</text>
</view>
</view>
<view class="input-wrap">
<input class="scan-input" v-model="barcode" placeholder="请输入或扫描物料条码"
@confirm="handleBarcode" focus />
</view>
</view>
<!-- 出库信息 -->
<view class="form-section" v-if="outboundInfo">
<text class="form-title">出库信息</text>
<view class="info-row">
<text class="info-label">物料编码</text>
<text class="info-value">{{ outboundInfo.materialCode }}</text>
</view>
<view class="info-row">
<text class="info-label">物料名称</text>
<text class="info-value">{{ outboundInfo.materialName }}</text>
</view>
<view class="info-row">
<text class="info-label">规格型号</text>
<text class="info-value">{{ outboundInfo.spec }}</text>
</view>
<view class="info-row">
<text class="info-label">托盘号</text>
<text class="info-value">{{ outboundInfo.trayCode }}</text>
</view>
<view class="info-row">
<text class="info-label">库位</text>
<text class="info-value">{{ outboundInfo.locationCode }}</text>
</view>
<view class="info-row">
<text class="info-label">出库数量</text>
<text class="info-value highlight">{{ outboundInfo.quantity }}</text>
</view>
<view class="info-row">
<text class="info-label">出库口</text>
<text class="info-value">{{ outboundInfo.portName }}</text>
</view>
</view>
<!-- 确认信息 -->
<view class="form-section" v-if="outboundInfo">
<text class="form-title">确认信息</text>
<view class="form-item">
<text class="form-label">实际数量</text>
<input class="form-input" v-model="confirmQty" type="number" :placeholder="'出库数量: ' + outboundInfo.quantity" />
</view>
<view class="form-item">
<text class="form-label">备注</text>
<input class="form-input" v-model="form.remark" placeholder="选填" />
</view>
</view>
<!-- 操作按钮 -->
<view class="btn-section" v-if="outboundInfo">
<button class="btn btn-orange" @click="confirmOutbound">确认出库</button>
<button class="btn btn-default" @click="resetForm">重置</button>
</view>
</view>
</template>
<script>
import { getOutboundDetail, confirmOutbound } from '@/api/warehouse/outbound'
export default {
data() {
return {
taskNo: '',
barcode: '',
outboundInfo: null,
confirmQty: '',
form: {
remark: ''
}
}
},
onLoad(options) {
if (options.taskNo) {
this.taskNo = options.taskNo
}
},
methods: {
startScan() {
var that = this
uni.scanCode({
onlyFromCamera: false,
scanType: ['barCode', 'qrCode'],
success: function(res) {
that.barcode = res.result
that.handleBarcode()
}
})
},
handleBarcode() {
if (!this.barcode) {
this.$modal.msg('请输入物料条码')
return
}
var that = this
var params = { taskNo: this.taskNo, barcode: this.barcode }
getOutboundDetail(params).then(function(res) {
that.outboundInfo = res.data
that.confirmQty = String(res.data.quantity)
that.$modal.msgSuccess('出库信息获取成功')
}).catch(function() {
that.outboundInfo = null
})
},
confirmOutbound() {
if (!this.confirmQty) {
this.$modal.msg('请输入实际数量')
return
}
var data = {
taskNo: this.taskNo,
barcode: this.barcode,
quantity: this.confirmQty,
remark: this.form.remark
}
var that = this
confirmOutbound(data).then(function() {
that.$modal.msgSuccess('出库确认成功')
that.resetForm()
})
},
resetForm() {
this.barcode = ''
this.outboundInfo = null
this.confirmQty = ''
this.form = {
remark: ''
}
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f5f7fa;
min-height: 100%;
}
.page-container {
padding: 24rpx;
}
.task-info {
background: #fff7e6;
border-radius: 12rpx;
padding: 20rpx 24rpx;
margin-bottom: 24rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.task-label {
font-size: 26rpx;
color: #fa8c16;
}
.task-value {
font-size: 26rpx;
color: #333;
font-weight: 500;
}
.scan-section {
background: #fff;
border-radius: 16rpx;
padding: 28rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.scan-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
}
.scan-title {
font-size: 30rpx;
font-weight: 500;
color: #333;
}
.scan-btn {
display: flex;
align-items: center;
padding: 8rpx 20rpx;
border: 1rpx solid #fa8c16;
border-radius: 8rpx;
}
.scan-btn-text {
font-size: 24rpx;
margin-left: 8rpx;
}
.scan-btn-text.orange {
color: #fa8c16;
}
.input-wrap {
border: 1rpx solid #e8e8e8;
border-radius: 8rpx;
padding: 4rpx;
}
.scan-input {
font-size: 28rpx;
padding: 16rpx;
}
.form-section {
background: #fff;
border-radius: 16rpx;
padding: 28rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.form-title {
font-size: 30rpx;
font-weight: 500;
color: #333;
margin-bottom: 24rpx;
padding-bottom: 16rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.form-item {
display: flex;
align-items: center;
padding: 16rpx 0;
}
.form-label {
font-size: 28rpx;
color: #666;
width: 160rpx;
flex-shrink: 0;
}
.form-input {
flex: 1;
font-size: 28rpx;
border: 1rpx solid #e8e8e8;
border-radius: 8rpx;
padding: 16rpx;
}
.info-row {
display: flex;
justify-content: space-between;
padding: 16rpx 0;
border-bottom: 1rpx solid #f5f5f5;
}
.info-label {
font-size: 28rpx;
color: #999;
}
.info-value {
font-size: 28rpx;
color: #333;
}
.info-value.highlight {
color: #fa8c16;
font-weight: 500;
}
.btn-section {
padding: 24rpx 0;
}
.btn {
font-size: 30rpx;
border-radius: 12rpx;
margin-bottom: 20rpx;
}
.btn-orange {
background: #fa8c16;
color: #fff;
}
.btn-default {
background: #fff;
color: #666;
border: 1rpx solid #d9d9d9;
}
</style>

View File

@@ -0,0 +1,411 @@
<template>
<view class="page-container">
<!-- 任务信息 -->
<view class="task-info" v-if="taskNo">
<text class="task-label">异常任务编号</text>
<text class="task-value">{{ taskNo }}</text>
</view>
<!-- 扫码区域 -->
<view class="scan-section">
<view class="scan-header">
<text class="scan-title">扫描异常物料条码</text>
<view class="scan-btn" @click="startScan">
<uni-icons type="scan" size="18" color="#f5222d"></uni-icons>
<text class="scan-btn-text red">扫码</text>
</view>
</view>
<view class="input-wrap">
<input class="scan-input" v-model="barcode" placeholder="请输入或扫描物料条码"
@confirm="handleBarcode" focus />
</view>
</view>
<!-- 异常信息填写 -->
<view class="form-section">
<text class="form-title">异常信息</text>
<view class="form-item">
<text class="form-label">异常类型</text>
<picker mode="selector" :range="exceptionTypes" range-key="label" @change="onTypeChange">
<view class="picker-value">{{ selectedType ? selectedType.label : '请选择异常类型' }}</view>
</picker>
<uni-icons type="bottom" size="16" color="#ccc"></uni-icons>
</view>
<view class="form-item">
<text class="form-label">处理方式</text>
<picker mode="selector" :range="handleMethods" range-key="label" @change="onMethodChange">
<view class="picker-value">{{ selectedMethod ? selectedMethod.label : '请选择处理方式' }}</view>
</picker>
<uni-icons type="bottom" size="16" color="#ccc"></uni-icons>
</view>
<view class="form-item">
<text class="form-label">异常描述</text>
<input class="form-input" v-model="form.description" placeholder="请描述异常情况" />
</view>
<view class="form-item column">
<text class="form-label">拍照留证</text>
<view class="photo-list">
<view class="photo-item" v-for="(photo, index) in photos" :key="index"
@click="previewPhoto(index)">
<image :src="photo" mode="aspectFill" class="photo-img"></image>
</view>
<view class="photo-add" @click="takePhoto" v-if="photos.length < 3">
<uni-icons type="plusempty" size="28" color="#ccc"></uni-icons>
</view>
</view>
</view>
</view>
<!-- 出库信息(扫码后显示) -->
<view class="form-section" v-if="outboundInfo">
<text class="form-title">出库任务信息</text>
<view class="info-row">
<text class="info-label">物料编码</text>
<text class="info-value">{{ outboundInfo.materialCode }}</text>
</view>
<view class="info-row">
<text class="info-label">物料名称</text>
<text class="info-value">{{ outboundInfo.materialName }}</text>
</view>
<view class="info-row">
<text class="info-label">出库数量</text>
<text class="info-value">{{ outboundInfo.quantity }}</text>
</view>
<view class="info-row">
<text class="info-label">出库口</text>
<text class="info-value">{{ outboundInfo.portName }}</text>
</view>
</view>
<!-- 操作按钮 -->
<view class="btn-section">
<button class="btn btn-danger" @click="submitException">提交异常确认</button>
<button class="btn btn-default" @click="resetForm">重置</button>
</view>
</view>
</template>
<script>
import { getOutboundDetail, submitOutboundException } from '@/api/warehouse/outbound'
export default {
data() {
return {
taskNo: '',
barcode: '',
outboundInfo: null,
photos: [],
exceptionTypes: [
{ value: 'damage', label: '物料损坏' },
{ value: 'missing', label: '物料缺失' },
{ value: 'wrong', label: '物料错误' },
{ value: 'qty_mismatch', label: '数量不符' },
{ value: 'other', label: '其他异常' }
],
handleMethods: [
{ value: 'return', label: '退回入库' },
{ value: 'replace', label: '更换物料' },
{ value: 'skip', label: '跳过本次' },
{ value: 'manual', label: '人工处理' }
],
selectedType: null,
selectedMethod: null,
form: {
description: ''
}
}
},
onLoad(options) {
if (options.taskNo) {
this.taskNo = options.taskNo
}
},
methods: {
startScan() {
var that = this
uni.scanCode({
onlyFromCamera: false,
scanType: ['barCode', 'qrCode'],
success: function(res) {
that.barcode = res.result
that.handleBarcode()
}
})
},
handleBarcode() {
if (!this.barcode) {
this.$modal.msg('请输入物料条码')
return
}
var that = this
var params = { taskNo: this.taskNo, barcode: this.barcode }
getOutboundDetail(params).then(function(res) {
that.outboundInfo = res.data
that.$modal.msgSuccess('出库信息获取成功')
}).catch(function() {
that.outboundInfo = null
})
},
onTypeChange(e) {
this.selectedType = this.exceptionTypes[e.detail.value]
},
onMethodChange(e) {
this.selectedMethod = this.handleMethods[e.detail.value]
},
takePhoto() {
var that = this
uni.chooseImage({
count: 1,
sourceType: ['camera', 'album'],
success: function(res) {
that.photos = that.photos.concat(res.tempFilePaths)
}
})
},
previewPhoto(index) {
uni.previewImage({
current: this.photos[index],
urls: this.photos
})
},
submitException() {
if (!this.barcode) {
this.$modal.msg('请输入物料条码')
return
}
if (!this.selectedType) {
this.$modal.msg('请选择异常类型')
return
}
if (!this.selectedMethod) {
this.$modal.msg('请选择处理方式')
return
}
var data = {
taskNo: this.taskNo,
barcode: this.barcode,
exceptionType: this.selectedType.value,
handleMethod: this.selectedMethod.value,
description: this.form.description
}
var that = this
submitOutboundException(data).then(function() {
that.$modal.msgSuccess('异常确认提交成功')
that.resetForm()
})
},
resetForm() {
this.barcode = ''
this.outboundInfo = null
this.photos = []
this.selectedType = null
this.selectedMethod = null
this.form = {
description: ''
}
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f5f7fa;
min-height: 100%;
}
.page-container {
padding: 24rpx;
}
.task-info {
background: #fff1f0;
border-radius: 12rpx;
padding: 20rpx 24rpx;
margin-bottom: 24rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.task-label {
font-size: 26rpx;
color: #f5222d;
}
.task-value {
font-size: 26rpx;
color: #333;
font-weight: 500;
}
.scan-section {
background: #fff;
border-radius: 16rpx;
padding: 28rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.scan-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
}
.scan-title {
font-size: 30rpx;
font-weight: 500;
color: #333;
}
.scan-btn {
display: flex;
align-items: center;
padding: 8rpx 20rpx;
border: 1rpx solid #f5222d;
border-radius: 8rpx;
}
.scan-btn-text {
font-size: 24rpx;
margin-left: 8rpx;
}
.scan-btn-text.red {
color: #f5222d;
}
.input-wrap {
border: 1rpx solid #e8e8e8;
border-radius: 8rpx;
padding: 4rpx;
}
.scan-input {
font-size: 28rpx;
padding: 16rpx;
}
.form-section {
background: #fff;
border-radius: 16rpx;
padding: 28rpx;
margin-bottom: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.form-title {
font-size: 30rpx;
font-weight: 500;
color: #333;
margin-bottom: 24rpx;
padding-bottom: 16rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.form-item {
display: flex;
align-items: center;
padding: 16rpx 0;
}
.form-item.column {
flex-direction: column;
align-items: flex-start;
}
.form-label {
font-size: 28rpx;
color: #666;
width: 160rpx;
flex-shrink: 0;
}
.form-item.column .form-label {
width: auto;
margin-bottom: 16rpx;
}
.form-input {
flex: 1;
font-size: 28rpx;
border: 1rpx solid #e8e8e8;
border-radius: 8rpx;
padding: 16rpx;
}
.picker-value {
flex: 1;
font-size: 28rpx;
color: #333;
padding: 16rpx;
}
.photo-list {
display: flex;
flex-wrap: wrap;
gap: 16rpx;
}
.photo-item {
width: 160rpx;
height: 160rpx;
border-radius: 12rpx;
overflow: hidden;
}
.photo-img {
width: 100%;
height: 100%;
}
.photo-add {
width: 160rpx;
height: 160rpx;
border-radius: 12rpx;
border: 1rpx dashed #d9d9d9;
display: flex;
align-items: center;
justify-content: center;
}
.info-row {
display: flex;
justify-content: space-between;
padding: 16rpx 0;
border-bottom: 1rpx solid #f5f5f5;
}
.info-label {
font-size: 28rpx;
color: #999;
}
.info-value {
font-size: 28rpx;
color: #333;
}
.btn-section {
padding: 24rpx 0;
}
.btn {
font-size: 30rpx;
border-radius: 12rpx;
margin-bottom: 20rpx;
}
.btn-danger {
background: #f5222d;
color: #fff;
}
.btn-default {
background: #fff;
color: #666;
border: 1rpx solid #d9d9d9;
}
</style>

View File

@@ -0,0 +1,312 @@
<template>
<view class="page-container">
<!-- 出库管理功能入口 -->
<view class="menu-section">
<view class="menu-card" @click="navigateTo('/pages/warehouse/outbound/confirm')">
<view class="card-left">
<view class="card-icon orange">
<uni-icons type="checkmarkempty" size="24" color="#fff"></uni-icons>
</view>
<view class="card-info">
<text class="card-title">出库确认</text>
<text class="card-desc">扫描出库物料条码进行出库确认</text>
</view>
</view>
<uni-icons type="right" size="18" color="#ccc"></uni-icons>
</view>
<view class="menu-card" @click="navigateTo('/pages/warehouse/outbound/exception')">
<view class="card-left">
<view class="card-icon red">
<uni-icons type="info" size="24" color="#fff"></uni-icons>
</view>
<view class="card-info">
<text class="card-title">出库异常确认</text>
<text class="card-desc">处理出库过程中的异常情况</text>
</view>
</view>
<uni-icons type="right" size="18" color="#ccc"></uni-icons>
</view>
</view>
<!-- 待处理任务 -->
<view class="task-section">
<view class="section-header">
<text class="section-title">待处理任务</text>
<text class="section-more" @click="refreshTasks">刷新</text>
</view>
<view v-if="taskList.length === 0" class="empty-state">
<text class="empty-text">暂无待处理任务</text>
</view>
<view v-else>
<view class="task-card" v-for="(item, index) in taskList" :key="index"
@click="handleTask(item)">
<view class="task-header">
<text class="task-type" :class="item.typeClass">{{ item.typeName }}</text>
<text class="task-no">{{ item.taskNo }}</text>
</view>
<view class="task-body">
<view class="task-info-item">
<text class="info-label">物料编码</text>
<text class="info-value">{{ item.materialCode }}</text>
</view>
<view class="task-info-item">
<text class="info-label">物料名称</text>
<text class="info-value">{{ item.materialName }}</text>
</view>
<view class="task-info-item">
<text class="info-label">出库数量</text>
<text class="info-value">{{ item.quantity }}</text>
</view>
<view class="task-info-item">
<text class="info-label">出库口</text>
<text class="info-value">{{ item.portName }}</text>
</view>
</view>
<view class="task-footer">
<text class="task-time">{{ item.createTime }}</text>
<view class="task-status" :class="item.statusClass">{{ item.statusName }}</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { getOutboundTaskList } from '@/api/warehouse/outbound'
export default {
data() {
return {
taskList: []
}
},
onLoad() {
this.loadTasks()
},
onShow() {
this.loadTasks()
},
methods: {
navigateTo(url) {
this.$tab.navigateTo(url)
},
loadTasks() {
getOutboundTaskList().then(res => {
this.taskList = res.data || []
}).catch(() => {
this.taskList = []
})
},
refreshTasks() {
this.loadTasks()
this.$modal.showToast('刷新成功')
},
handleTask(item) {
if (item.type === 'confirm') {
this.$tab.navigateTo('/pages/warehouse/outbound/confirm?taskNo=' + item.taskNo)
} else if (item.type === 'exception') {
this.$tab.navigateTo('/pages/warehouse/outbound/exception?taskNo=' + item.taskNo)
}
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f5f7fa;
min-height: 100%;
}
.page-container {
padding: 24rpx;
}
.menu-section {
margin-bottom: 32rpx;
}
.menu-card {
background: #fff;
border-radius: 16rpx;
padding: 32rpx 28rpx;
margin-bottom: 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.card-left {
display: flex;
align-items: center;
flex: 1;
}
.card-icon {
width: 72rpx;
height: 72rpx;
border-radius: 16rpx;
display: flex;
align-items: center;
justify-content: center;
margin-right: 24rpx;
}
.card-icon.orange {
background: linear-gradient(135deg, #fa8c16, #ffa940);
}
.card-icon.red {
background: linear-gradient(135deg, #f5222d, #ff4d4f);
}
.card-info {
display: flex;
flex-direction: column;
}
.card-title {
font-size: 30rpx;
font-weight: 500;
color: #333;
margin-bottom: 8rpx;
}
.card-desc {
font-size: 24rpx;
color: #999;
}
.task-section {
margin-top: 16rpx;
}
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
}
.section-title {
font-size: 30rpx;
font-weight: 500;
color: #333;
}
.section-more {
font-size: 26rpx;
color: #1890ff;
}
.empty-state {
background: #fff;
border-radius: 16rpx;
padding: 80rpx 0;
display: flex;
align-items: center;
justify-content: center;
}
.empty-text {
font-size: 28rpx;
color: #ccc;
}
.task-card {
background: #fff;
border-radius: 16rpx;
padding: 28rpx;
margin-bottom: 20rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.task-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
padding-bottom: 16rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.task-type {
font-size: 28rpx;
font-weight: 500;
}
.task-type.confirm {
color: #fa8c16;
}
.task-type.exception {
color: #f5222d;
}
.task-no {
font-size: 24rpx;
color: #999;
}
.task-body {
margin-bottom: 16rpx;
}
.task-info-item {
display: flex;
justify-content: space-between;
padding: 10rpx 0;
}
.info-label {
font-size: 26rpx;
color: #999;
}
.info-value {
font-size: 26rpx;
color: #333;
}
.task-footer {
display: flex;
justify-content: space-between;
align-items: center;
padding-top: 16rpx;
border-top: 1rpx solid #f0f0f0;
}
.task-time {
font-size: 22rpx;
color: #ccc;
}
.task-status {
font-size: 22rpx;
padding: 4rpx 16rpx;
border-radius: 8rpx;
}
.task-status.pending {
color: #fa8c16;
background: #fff7e6;
}
.task-status.processing {
color: #1890ff;
background: #e6f7ff;
}
.task-status.completed {
color: #52c41a;
background: #f6ffed;
}
.task-status.exception {
color: #f5222d;
background: #fff1f0;
}
</style>

View File

@@ -0,0 +1,191 @@
<template>
<view class="page-container">
<view class="module-header">
<uni-icons type="bars" size="22" color="#722ed1"></uni-icons>
<text class="header-title">库存统计</text>
</view>
<!-- 库存概览卡片 -->
<view class="summary-section">
<view class="summary-card">
<view class="summary-row">
<view class="summary-item">
<text class="summary-value">--</text>
<text class="summary-label">库存总量</text>
</view>
<view class="summary-divider"></view>
<view class="summary-item">
<text class="summary-value">--</text>
<text class="summary-label">物料种类</text>
</view>
</view>
<view class="summary-row">
<view class="summary-item">
<text class="summary-value">--</text>
<text class="summary-label">今日入库</text>
</view>
<view class="summary-divider"></view>
<view class="summary-item">
<text class="summary-value">--</text>
<text class="summary-label">今日出库</text>
</view>
</view>
</view>
</view>
<view class="feature-list">
<view class="feature-card" @click="$modal.showToast('功能开发中')">
<view class="feature-left">
<uni-icons type="search" size="20" color="#1890ff"></uni-icons>
<text class="feature-name">库存查询</text>
</view>
<uni-icons type="right" size="16" color="#ccc"></uni-icons>
</view>
<view class="feature-card" @click="$modal.showToast('功能开发中')">
<view class="feature-left">
<uni-icons type="location" size="20" color="#fa8c16"></uni-icons>
<text class="feature-name">库位分布</text>
</view>
<uni-icons type="right" size="16" color="#ccc"></uni-icons>
</view>
<view class="feature-card" @click="$modal.showToast('功能开发中')">
<view class="feature-left">
<uni-icons type="pie-chart" size="20" color="#52c41a"></uni-icons>
<text class="feature-name">库存报表</text>
</view>
<uni-icons type="right" size="16" color="#ccc"></uni-icons>
</view>
<view class="feature-card" @click="$modal.showToast('功能开发中')">
<view class="feature-left">
<uni-icons type="alert" size="20" color="#f5222d"></uni-icons>
<text class="feature-name">库存预警</text>
</view>
<uni-icons type="right" size="16" color="#ccc"></uni-icons>
</view>
</view>
<view class="empty-tip">
<text class="tip-text">库存统计模块正在开发中,敬请期待</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f5f7fa;
min-height: 100%;
}
.page-container {
padding: 24rpx;
}
.module-header {
display: flex;
align-items: center;
padding: 24rpx 0;
margin-bottom: 20rpx;
}
.header-title {
font-size: 32rpx;
font-weight: 500;
color: #333;
margin-left: 12rpx;
}
.summary-section {
margin-bottom: 32rpx;
}
.summary-card {
background: linear-gradient(135deg, #1890ff, #096dd9);
border-radius: 16rpx;
padding: 40rpx 28rpx;
}
.summary-row {
display: flex;
align-items: center;
justify-content: space-around;
}
.summary-row:first-child {
margin-bottom: 32rpx;
}
.summary-divider {
width: 1rpx;
height: 60rpx;
background: rgba(255, 255, 255, 0.3);
}
.summary-item {
display: flex;
flex-direction: column;
align-items: center;
}
.summary-value {
font-size: 40rpx;
font-weight: 500;
color: #fff;
margin-bottom: 8rpx;
}
.summary-label {
font-size: 24rpx;
color: rgba(255, 255, 255, 0.8);
}
.feature-list {
background: #fff;
border-radius: 16rpx;
overflow: hidden;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
}
.feature-card {
display: flex;
align-items: center;
justify-content: space-between;
padding: 32rpx 28rpx;
border-bottom: 1rpx solid #f5f5f5;
}
.feature-card:last-child {
border-bottom: none;
}
.feature-left {
display: flex;
align-items: center;
}
.feature-name {
font-size: 28rpx;
color: #333;
margin-left: 16rpx;
}
.empty-tip {
padding: 60rpx 0;
text-align: center;
}
.tip-text {
font-size: 26rpx;
color: #ccc;
}
</style>

182
pda/pages/work/index.vue Normal file
View File

@@ -0,0 +1,182 @@
<template>
<view class="work-container">
<!-- 轮播图 -->
<uni-swiper-dot class="uni-swiper-dot-box" :info="data" :current="current" field="content">
<swiper class="swiper-box" :current="swiperDotIndex" @change="changeSwiper">
<swiper-item v-for="(item, index) in data" :key="index">
<view class="swiper-item" @click="clickBannerItem(item)">
<image :src="item.image" mode="aspectFill" :draggable="false" />
</view>
</swiper-item>
</swiper>
</uni-swiper-dot>
<!-- 宫格组件 -->
<uni-section title="系统管理" type="line"></uni-section>
<view class="grid-body">
<uni-grid :column="4" :showBorder="false" @change="changeGrid">
<uni-grid-item>
<view class="grid-item-box">
<uni-icons type="person-filled" size="30"></uni-icons>
<text class="text">用户管理</text>
</view>
</uni-grid-item>
<uni-grid-item>
<view class="grid-item-box">
<uni-icons type="staff-filled" size="30"></uni-icons>
<text class="text">角色管理</text>
</view>
</uni-grid-item>
<uni-grid-item>
<view class="grid-item-box">
<uni-icons type="color" size="30"></uni-icons>
<text class="text">菜单管理</text>
</view>
</uni-grid-item>
<uni-grid-item>
<view class="grid-item-box">
<uni-icons type="settings-filled" size="30"></uni-icons>
<text class="text">部门管理</text>
</view>
</uni-grid-item>
<uni-grid-item>
<view class="grid-item-box">
<uni-icons type="heart-filled" size="30"></uni-icons>
<text class="text">岗位管理</text>
</view>
</uni-grid-item>
<uni-grid-item>
<view class="grid-item-box">
<uni-icons type="bars" size="30"></uni-icons>
<text class="text">字典管理</text>
</view>
</uni-grid-item>
<uni-grid-item>
<view class="grid-item-box">
<uni-icons type="gear-filled" size="30"></uni-icons>
<text class="text">参数设置</text>
</view>
</uni-grid-item>
<uni-grid-item>
<view class="grid-item-box">
<uni-icons type="chat-filled" size="30"></uni-icons>
<text class="text">通知公告</text>
</view>
</uni-grid-item>
<uni-grid-item>
<view class="grid-item-box">
<uni-icons type="wallet-filled" size="30"></uni-icons>
<text class="text">日志管理</text>
</view>
</uni-grid-item>
</uni-grid>
</view>
</view>
</template>
<script>
export default {
data() {
return {
current: 0,
swiperDotIndex: 0,
data: [{
image: '/static/images/banner/banner01.jpg'
},
{
image: '/static/images/banner/banner02.jpg'
},
{
image: '/static/images/banner/banner03.jpg'
}
]
}
},
methods: {
clickBannerItem(item) {
console.info(item)
},
changeSwiper(e) {
this.current = e.detail.current
},
changeGrid(e) {
this.$modal.showToast('模块建设中~')
}
}
}
</script>
<style lang="scss" scoped>
/* #ifndef APP-NVUE */
page {
display: flex;
flex-direction: column;
box-sizing: border-box;
background-color: #fff;
min-height: 100%;
height: auto;
}
view {
font-size: 14px;
line-height: inherit;
}
/* #endif */
.text {
text-align: center;
font-size: 26rpx;
margin-top: 10rpx;
}
.grid-item-box {
flex: 1;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
align-items: center;
justify-content: center;
padding: 15px 0;
}
.uni-margin-wrap {
width: 690rpx;
width: 100%;
;
}
.swiper {
height: 300rpx;
}
.swiper-box {
height: 150px;
}
.swiper-item {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
justify-content: center;
align-items: center;
color: #fff;
height: 300rpx;
line-height: 300rpx;
}
@media screen and (min-width: 500px) {
.uni-swiper-dot-box {
width: 400px;
/* #ifndef APP-NVUE */
margin: 0 auto;
/* #endif */
margin-top: 8px;
}
.image {
width: 100%;
}
}
</style>