You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
185 lines
4.6 KiB
185 lines
4.6 KiB
|
7 months ago
|
<template>
|
||
|
|
<view class="inventory-bg">
|
||
|
|
<view class="inventory-card">
|
||
|
|
<view class="form-group">
|
||
|
|
<text class="form-label">盘点人</text>
|
||
|
|
<input class="form-input" :value="userName" disabled />
|
||
|
|
</view>
|
||
|
|
<view class="form-group">
|
||
|
|
<text class="form-label">盘点日期</text>
|
||
|
|
<input class="form-input" :value="date" disabled />
|
||
|
|
</view>
|
||
|
|
<view class="form-group">
|
||
|
|
<text class="form-label">库存数量</text>
|
||
|
|
<input class="form-input" :value="stockQty" disabled />
|
||
|
|
</view>
|
||
|
|
<view class="form-group">
|
||
|
|
<text class="form-label">盘点数量</text>
|
||
|
|
<input class="form-input" type="number" v-model="countQty" placeholder="请输入盘点数量" />
|
||
|
|
</view>
|
||
|
|
<view class="form-group">
|
||
|
|
<text class="form-label">盘点备注</text>
|
||
|
|
<textarea class="form-textarea" v-model="remark" placeholder="请输入备注" />
|
||
|
|
</view>
|
||
|
|
<view class="form-group">
|
||
|
|
<text class="form-label">照片上传</text>
|
||
|
|
<view class="photo-upload">
|
||
|
|
<view v-if="photo" class="photo-preview">
|
||
|
|
<image :src="photo" mode="aspectFill" class="photo-img" />
|
||
|
|
<text class="photo-del" @click="photo=''">删除</text>
|
||
|
|
</view>
|
||
|
|
<button v-else class="photo-btn" @click="choosePhoto">上传照片</button>
|
||
|
|
</view>
|
||
|
|
</view>
|
||
|
|
<button class="submit-btn" @click="submit">提交盘点</button>
|
||
|
|
</view>
|
||
|
|
</view>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
export default {
|
||
|
|
data() {
|
||
|
|
return {
|
||
|
|
userName: '张三',
|
||
|
|
date: '',
|
||
|
|
stockQty: 100, // 假数据,实际应根据扫码结果获取
|
||
|
|
countQty: '',
|
||
|
|
remark: '',
|
||
|
|
photo: ''
|
||
|
|
}
|
||
|
|
},
|
||
|
|
onLoad(options) {
|
||
|
|
this.date = this.getToday();
|
||
|
|
// options.code 可用于请求物资信息,获取库存数量等
|
||
|
|
// 这里只做演示
|
||
|
|
if (options.code) {
|
||
|
|
// 假设扫码内容就是物资名
|
||
|
|
// 实际可用code请求后端获取物资详情
|
||
|
|
// this.stockQty = ...
|
||
|
|
}
|
||
|
|
},
|
||
|
|
methods: {
|
||
|
|
getToday() {
|
||
|
|
const now = new Date();
|
||
|
|
const y = now.getFullYear();
|
||
|
|
const m = String(now.getMonth() + 1).padStart(2, '0');
|
||
|
|
const d = String(now.getDate()).padStart(2, '0');
|
||
|
|
return `${y}-${m}-${d}`;
|
||
|
|
},
|
||
|
|
choosePhoto() {
|
||
|
|
uni.chooseImage({
|
||
|
|
count: 1,
|
||
|
|
success: (res) => {
|
||
|
|
this.photo = res.tempFilePaths[0];
|
||
|
|
}
|
||
|
|
});
|
||
|
|
},
|
||
|
|
submit() {
|
||
|
|
if (!this.countQty) {
|
||
|
|
uni.showToast({ title: '请输入盘点数量', icon: 'none' });
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
uni.showToast({ title: '盘点提交成功', icon: 'success' });
|
||
|
|
// 实际可在此提交数据到后端
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<style>
|
||
|
|
.inventory-bg {
|
||
|
|
min-height: 100vh;
|
||
|
|
background: linear-gradient(180deg, #eaf1fb 0%, #f7fafd 100%);
|
||
|
|
display: flex;
|
||
|
|
align-items: center;
|
||
|
|
justify-content: center;
|
||
|
|
}
|
||
|
|
.inventory-card {
|
||
|
|
width: 92vw;
|
||
|
|
max-width: 480px;
|
||
|
|
background: #fff;
|
||
|
|
border-radius: 24px;
|
||
|
|
box-shadow: 0 8px 32px rgba(64,158,255,0.10);
|
||
|
|
padding: 48px 24px 32px 24px;
|
||
|
|
display: flex;
|
||
|
|
flex-direction: column;
|
||
|
|
align-items: stretch;
|
||
|
|
}
|
||
|
|
.form-group {
|
||
|
|
margin-bottom: 28px;
|
||
|
|
display: flex;
|
||
|
|
flex-direction: column;
|
||
|
|
}
|
||
|
|
.form-label {
|
||
|
|
font-size: 16px;
|
||
|
|
color: #3a3a3a;
|
||
|
|
margin-bottom: 10px;
|
||
|
|
font-weight: 500;
|
||
|
|
}
|
||
|
|
.form-input {
|
||
|
|
height: 48px;
|
||
|
|
border: 1.5px solid #e3e8f0;
|
||
|
|
border-radius: 12px;
|
||
|
|
padding: 0 14px;
|
||
|
|
font-size: 17px;
|
||
|
|
background: #f6f8fa;
|
||
|
|
color: #222;
|
||
|
|
margin-bottom: 2px;
|
||
|
|
}
|
||
|
|
.form-input[disabled] {
|
||
|
|
background: #f0f1f3;
|
||
|
|
color: #aaa;
|
||
|
|
}
|
||
|
|
.form-textarea {
|
||
|
|
min-height: 80px;
|
||
|
|
border: 1.5px solid #e3e8f0;
|
||
|
|
border-radius: 12px;
|
||
|
|
padding: 10px 14px;
|
||
|
|
font-size: 16px;
|
||
|
|
background: #f6f8fa;
|
||
|
|
color: #222;
|
||
|
|
}
|
||
|
|
.photo-upload {
|
||
|
|
display: flex;
|
||
|
|
align-items: center;
|
||
|
|
}
|
||
|
|
.photo-btn {
|
||
|
|
height: 44px;
|
||
|
|
background: #409eff;
|
||
|
|
color: #fff;
|
||
|
|
font-size: 16px;
|
||
|
|
border-radius: 8px;
|
||
|
|
padding: 0 24px;
|
||
|
|
border: none;
|
||
|
|
}
|
||
|
|
.photo-preview {
|
||
|
|
position: relative;
|
||
|
|
display: flex;
|
||
|
|
align-items: center;
|
||
|
|
}
|
||
|
|
.photo-img {
|
||
|
|
width: 80px;
|
||
|
|
height: 80px;
|
||
|
|
border-radius: 8px;
|
||
|
|
margin-right: 12px;
|
||
|
|
}
|
||
|
|
.photo-del {
|
||
|
|
color: #ff4d4f;
|
||
|
|
font-size: 14px;
|
||
|
|
cursor: pointer;
|
||
|
|
}
|
||
|
|
.submit-btn {
|
||
|
|
margin-top: 18px;
|
||
|
|
height: 52px;
|
||
|
|
background: linear-gradient(90deg, #409eff 0%, #3b7cff 100%);
|
||
|
|
color: #fff;
|
||
|
|
font-size: 20px;
|
||
|
|
font-weight: 700;
|
||
|
|
border-radius: 14px;
|
||
|
|
letter-spacing: 8px;
|
||
|
|
box-shadow: 0 4px 16px rgba(64,158,255,0.13);
|
||
|
|
}
|
||
|
|
.submit-btn:active {
|
||
|
|
background: linear-gradient(90deg, #337ecc 60%, #2a5db0 100%);
|
||
|
|
}
|
||
|
|
</style>
|