项目初始化
This commit is contained in:
521
pda/pages/warehouse/inbound/bindTray.vue
Normal file
521
pda/pages/warehouse/inbound/bindTray.vue
Normal 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>
|
||||
298
pda/pages/warehouse/inbound/index.vue
Normal file
298
pda/pages/warehouse/inbound/index.vue
Normal 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>
|
||||
318
pda/pages/warehouse/inbound/supply.vue
Normal file
318
pda/pages/warehouse/inbound/supply.vue
Normal 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>
|
||||
Reference in New Issue
Block a user