This commit is contained in:
2025-12-31 14:32:55 +08:00
parent 8401f5bb6b
commit 124f3ca87e
9 changed files with 1290 additions and 0 deletions

View File

@@ -202,6 +202,48 @@
}
}
,{
"path" : "pages/hdyy/wbc/wbc-enter",
"style" :
{
"navigationStyle": "custom"
}
}
,{
"path" : "pages/hdyy/wbc/wbc-getuse",
"style" :
{
"navigationStyle": "custom"
}
}
,{
"path" : "pages/hdyy/wbc/wbc-return",
"style" :
{
"navigationStyle": "custom"
}
}
,{
"path" : "pages/hdyy/wbc/wbc-shouhuo",
"style" :
{
"navigationStyle": "custom"
}
}
,{
"path" : "pages/hdyy/wbc/wbc-transfer",
"style" :
{
"navigationStyle": "custom"
}
}
,{
"path" : "pages/hdyy/wbc/material",
"style" :
{
"navigationStyle": "custom"
}
}
],
"globalStyle": {
// "pageOrientation": "landscape",

100
pages/hdyy/wbc/material.vue Normal file
View File

@@ -0,0 +1,100 @@
<template>
<view class="zd_container">
<!-- 物料维护 -->
<nav-bar :title="title" :inner="true"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-5">
<span class="filter_label">关键字</span>
</view>
<view class="zd-col-14">
<input type="text" placeholder="输入物料关键字" class="filter_input" v-model="keyword" @focus="handleFocus">
</view>
<button class="mini-btn" type="primary" @tap="_queryMaterInfo">查询</button>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
<th>物料编码</th>
<th>物料名称</th>
<th>规格</th>
<th>型号</th>
<th>类别</th>
<th>计量单位</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.material_id === pkId}" @tap="toCheck(e)">
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.material_model}}</td>
<td>{{e.class_name}}</td>
<td>{{e.unit_name}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-24 button-primary" :class="{'button-info': !pkId}" @tap="toSure">确认</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {queryMaterInfo} from '@/utils/getData3.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
keyword: null,
dataList: [],
pkId: '',
pkObj: {}
};
},
onLoad (options) {
this.title = options.title
this._queryMaterInfo()
},
methods: {
handleFocus () {
this.keyword = null
},
async _queryMaterInfo () {
try {
let res = await queryMaterInfo(this.keyword)
if (res && res.data.length > 0) {
this.dataList = [...res.data]
} else {
this.dataList = []
}
} catch (e) {
this.dataList = []
}
},
toCheck (e) {
this.pkId = this.pkId === e.material_id ? '' : e.material_id
this.pkObj = this.pkId === e.material_id ? e : {}
},
toSure () {
if (this.pkId) {
this.$store.dispatch('setPublicObj', this.pkObj)
uni.navigateBack()
}
}
}
}
</script>

View File

@@ -0,0 +1,152 @@
<template>
<view class="zd_container">
<!-- 外包材送入 -->
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">点位</span>
</view>
<view class="zd-col-24 filter_select">
<search-box
v-model="val1"
/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">总数量</span>
</view>
<view class="zd-col-24">
<input type="number" v-model="num" class="filter_input filter_input_disabled" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">目的点位</span>
</view>
<view class="zd-col-18 filter_select">
<uni-data-select v-model="index" :localdata="options"></uni-data-select>
</view>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
<th>序号</th>
<th>物料编码</th>
<th>物料名称</th>
<th>批号</th>
<th>数量</th>
<th>单位</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i">
<td>{{i+1}}</td>
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.pcsn}}</td>
<td>{{e.qty}}</td>
<td>{{e.unit}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
<button class="zd-col-18 button-primary" :class="{'button-info': !val1 || !index || !dataList.length}" :disabled="disabled" @tap="_packInConfirm">送入</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {queryPointInDownload, queryPointInDtl, packInConfirm} from '@/utils/getData3.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
options: [],
num: null,
index: '',
val1: '',
dataList: [],
dataList: [{material_code: 'm001', qty: 100, checked: false, initialQty: 100}, {material_code: 'm002', qty: 200, checked: false, initialQty: 200}],
disabled: false
};
},
onLoad (options) {
this.title = options.title
this._queryPointInDownload()
},
methods: {
toEmpty () {
this.val1 = ''
this.num = null
this.dataList = []
this.checkedArr = []
this.allCheck = false
this.disabled = false
},
async _queryPointInDownload () {
try {
let res = await queryPointInDownload()
if (res) {
this.options = res.data
} else {
this.options = []
}
} catch (e) {
this.options = []
}
},
selectChange (e) {
this.index = e
},
async _queryPointInDtl () {
try {
let res = await queryPointInDtl(this.val1)
if (res && res.data.length > 0) {
this.dataList = [...res.data]
} else {
this.dataList = []
}
} catch (e) {
this.dataList = []
}
},
async _packInConfirm () {
this.disabled = true
if (!this.val1 || !this.index || !this.dataList.length) {
this.disabled = false
return
}
this.num = this.dataList.reduce((sum, item) => sum + Number(item.qty), 0)
try {
let res = await packInConfirm(this.val1, this.index, this.num, this.dataList)
if (res) {
uni.showToast({
title: res.message,
icon: 'none'
})
}
this.toEmpty()
this.disabled = false
} catch (e) {
this.disabled = false
}
}
}
}
</script>

View File

@@ -0,0 +1,167 @@
<template>
<view class="zd_container">
<!-- 外包材领用 -->
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">点位</span>
</view>
<view class="zd-col-24 filter_select">
<search-box v-model="val1" @handleChange="handleChange"/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">总数量</span>
</view>
<view class="zd-col-24">
<input type="number" v-model="num" class="filter_input filter_input_disabled" disabled>
</view>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
<th @tap="toAllCheck"><uni-icons :type="allCheck ? 'checkbox' : 'circle'" size="24" color="#4e6ef2"></uni-icons></th>
<th>序号</th>
<th>物料编码</th>
<th>物料名称</th>
<th>批号</th>
<th>出库数量</th>
<th>单位</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i">
<td @tap="toCheck(e)"><uni-icons :type="e.checked ? 'checkbox' : 'circle'" size="24" color="#4e6ef2"></uni-icons></td>
<td>{{i+1}}</td>
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.pcsn}}</td>
<td><input type="number" class="sin_input" v-model="e.qty" @blur="handleBlur(e)"></td>
<td>{{e.unit_name}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
<button class="zd-col-18 button-primary" :class="{'button-info': !val1 || !checkedArr.length}" :disabled="disabled" @tap="_queryDrawConfirm">确认转运</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {queryPointDrawDtl, queryDrawConfirm} from '@/utils/getData3.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
num: null,
val1: '',
allCheck: false,
checkedArr: [],
dataList: [],
dataList: [{material_code: 'm001', qty: 100, checked: false, initialQty: 100}, {material_code: 'm002', qty: 200, checked: false, initialQty: 200}],
disabled: false
};
},
onLoad (options) {
this.title = options.title
},
methods: {
toEmpty () {
this.val1 = ''
this.num = null
this.dataList = []
this.checkedArr = []
this.allCheck = false
this.disabled = false
},
toAllCheck () {
this.allCheck = !this.allCheck
this.dataList.map(el => {
el.checked = this.allCheck
})
},
toCheck (e) {
e.checked = !e.checked
this.checkedArr = this.dataList.filter(el => el.checked === true)
this.allCheck = this.checkedArr.length === this.dataList.length
},
handleChange (e) {
if (e) {
this._queryPointDrawDtl()
}
},
handleBlur (e) {
if (e.qty) {
if (e.qty < 0) {
e.qty = 0
} else {
e.qty = e.qty.replace(/[^0-9]/g, '')
e.qty = e.qty.replace(/^0+/, '') || '0'
if (e.qty > e.initialQty) {
e.qty = e.initialQty
}
this.num = this.dataList.reduce((sum, item) => sum + Number(item.qty), 0)
}
} else {
// uni.showToast({
// title: '数量必填',
// icon: 'none'
// })
}
},
async _queryPointDrawDtl () {
try {
let res = await queryPointDrawDtl(this.val1)
if (res && res.data.length > 0) {
this.dataList = [...res.data]
this.dataList.forEach(e => {
e.initialQty = e.qty
})
this.num = this.dataList.reduce((sum, item) => sum + Number(item.qty), 0)
} else {
this.dataList = []
}
} catch (e) {
this.dataList = []
}
},
async _queryDrawConfirm () {
this.checkedArr = this.dataList.filter(el => el.checked === true)
this.disabled = true
if (!this.val1 || !this.checkedArr.length) {
this.disabled = false
return
}
try {
let res = await queryDrawConfirm(this.val1, this.num, this.checkedArr)
if (res) {
uni.showToast({
title: res.message,
icon: 'none'
})
}
this.toEmpty()
this.disabled = false
} catch (e) {
this.disabled = false
}
}
}
}
</script>

View File

@@ -0,0 +1,259 @@
<template>
<view class="zd_container">
<!-- 外包材还回 -->
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">点位</span>
</view>
<view class="zd-col-18">
<search-box v-model="val1"/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">物料编码</span>
</view>
<view class="zd-col-13">
<search-box v-model="materialData.material_code"/>
</view>
<button class="mini-btn" type="primary" @tap="toJump('material?title=物料维护')">查询</button>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label filter_input_disabled">物料名称</span>
</view>
<view class="zd-col-18">
<input type="text" class="filter_input filter_input_disabled" v-model="materialData.material_name" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label filter_input_disabled">物料类别</span>
</view>
<view class="zd-col-18">
<input type="text" v-model="materialData.class_name" class="filter_input filter_input_disabled" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">批号</span>
</view>
<view class="zd-col-18">
<input type="text" v-model="pcsn" class="filter_input">
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">数量</span>
</view>
<view class="zd-col-18">
<input type="number" v-model="num" class="filter_input">
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">计量单位</span>
</view>
<view class="zd-col-18">
<input type="text" class="filter_input" v-model="unit">
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">备注</span>
</view>
<view class="zd-col-18">
<input type="text" class="filter_input" v-model="mark">
</view>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
<button class="zd-col-18 button-primary" :class="{'button-info': !val1 || JSON.stringify(materialData) === '{}'}" :disabled="disabled" @tap="_packConfirmReturn">确认还回</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {packConfirmReturn} from '@/utils/getData3.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
val1: '',
materialData: {},
num: '',
unit: 'KG',
mark: '',
disabled: false,
pcsn: ''
};
},
onLoad (options) {
this.title = options.title
},
onShow () {
if (this.$store.getters.publicObj !== '') {
this.materialData = this.$store.getters.publicObj
this.$store.dispatch('setPublicObj', '')
}
},
methods: {
toJump (name) {
uni.navigateTo({
url: `/pages/hdyy/wbc/${name}`
})
},
toEmpty () {
this.val1 = ''
this.index1 = ''
this.materialData = {}
this.pcsn = ''
this.num = ''
this.unit = 'KG'
this.mark = ''
this.disabled = false
},
async _packConfirmReturn () {
this.disabled = true
if (!this.val1 || JSON.stringify(this.materialData) === '{}') {
this.disabled = false
return
}
try {
let res = await packConfirmReturn(this.val1, this.materialData.material_id, this.materialData.material_code, this.materialData.material_name, this.pcsn, this.num, this.mark)
if (res) {
uni.showToast({
title: res.message,
icon: 'none'
})
}
this.toEmpty()
this.disabled = false
} catch (e) {
this.disabled = false
}
}
}
}
</script>
<style lang="stylus">
.input-container {
background-color: #fff;
border-radius: 16rpx;
padding: 30rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
margin-bottom: 40rpx;
}
.input-wrapper {
position: relative;
display: flex;
align-items: center;
// border: 2rpx solid #e0e0e0;
border-radius: 12rpx;
overflow: hidden;
transition: border-color 0.3s;
}
.input-wrapper:focus-within {
border-color: #007AFF;
}
.input-field {
flex: 1;
height: 80rpx;
// padding: 0 24rpx;
font-size: 28rpx;
color: #333;
}
.placeholder {
color: #999;
font-size: 28rpx;
}
.picker {
width: 80rpx;
height: 80rpx;
display: flex;
align-items: center;
justify-content: center;
background-color: #f8f8f8;
border-left: 2rpx solid #e0e0e0;
}
.picker-trigger {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.picker-text {
font-size: 24rpx;
color: #666;
}
.custom-dialog-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 999;
}
.custom-dialog {
width: 600rpx;
background: #fff;
border-radius: 16rpx;
overflow: hidden;
}
.dialog-title {
padding: 30rpx;
font-size: 32rpx;
text-align: center;
border-bottom: 1rpx solid #eee;
}
.dialog-body {
padding: 40rpx;
}
.dialog-input {
width: 100%;
height: 80rpx;
border: 1rpx solid #ddd;
border-radius: 8rpx;
padding: 0 20rpx;
text-align: center;
}
.dialog-footer {
display: flex;
border-top: 1rpx solid #eee;
}
.dialog-footer button {
flex: 1;
border-radius: 0;
margin: 0;
}
</style>

View File

@@ -0,0 +1,291 @@
<template>
<view class="zd_container">
<!-- 外包材收货 -->
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">点位</span>
</view>
<view class="zd-col-18">
<search-box v-model="val1" @handleChange="handleChange" @handleDel="handleDel"/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">区域</span>
</view>
<view class="zd-col-18 filter_select">
<uni-data-select v-model="index1" :localdata="options1"></uni-data-select>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">物料编码</span>
</view>
<view class="zd-col-13">
<search-box v-model="materialData.material_code"/>
</view>
<button class="mini-btn" type="primary" @tap="toJump('material?title=物料维护')">查询</button>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label filter_input_disabled">物料名称</span>
</view>
<view class="zd-col-18">
<input type="text" class="filter_input filter_input_disabled" v-model="materialData.material_name" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label filter_input_disabled">物料类别</span>
</view>
<view class="zd-col-18">
<input type="text" v-model="materialData.class_name" class="filter_input filter_input_disabled" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">批号</span>
</view>
<view class="zd-col-18">
<input type="text" v-model="pcsn" class="filter_input">
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">数量</span>
</view>
<view class="zd-col-18">
<input type="number" v-model="num" class="filter_input">
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">计量单位</span>
</view>
<view class="zd-col-18">
<input type="text" class="filter_input" v-model="unit">
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">备注</span>
</view>
<view class="zd-col-18">
<input type="text" class="filter_input" v-model="mark">
</view>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
<button class="zd-col-18 button-primary" :class="{'button-info': !val1 || JSON.stringify(materialData) === '{}'}" :disabled="disabled" @tap="_confirmStock">确认收货</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {queryPointRegion, confirmStock} from '@/utils/getData3.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
val1: '',
options1: [],
index1: '',
materialData: {},
num: '',
unit: 'KG',
mark: '',
disabled: false,
pcsn: ''
};
},
onLoad (options) {
this.title = options.title
},
onShow () {
if (this.$store.getters.publicObj !== '') {
this.materialData = this.$store.getters.publicObj
this.$store.dispatch('setPublicObj', '')
}
},
methods: {
onInput(e) {
// console.log('输入内容:', e.detail.value)
},
handleChange (e) {
if (e) {
this._queryPointRegion(e)
}
},
handleDel () {
},
toJump (name) {
uni.navigateTo({
url: `/pages/hdyy/wbc/${name}`
})
},
/** 下拉框*/
async _queryPointRegion () {
try {
let res = await queryPointRegion(this.val1)
if (res && res.data) {
this.options1 = [...res.data]
} else {
this.options1 = []
}
} catch (e) {
this.options1 = []
}
},
toEmpty () {
this.val1 = ''
this.index1 = ''
this.materialData = {}
this.pcsn = ''
this.num = ''
this.unit = 'KG'
this.mark = ''
},
async _confirmStock () {
this.disabled = true
if (!this.val1 || JSON.stringify(this.materialData) === '{}') {
this.disabled = false
return
}
try {
let res = await confirmStock(this.val1, this.index1, this.materialData.material_id, this.materialData.material_code, this.materialData.material_name, this.pcsn, this.num, this.unit, this.mark)
if (res) {
uni.showToast({
title: res.message,
icon: 'none'
})
}
this.toEmpty()
this.disabled = false
} catch (e) {
this.disabled = false
}
}
}
}
</script>
<style lang="stylus">
.input-container {
background-color: #fff;
border-radius: 16rpx;
padding: 30rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
margin-bottom: 40rpx;
}
.input-wrapper {
position: relative;
display: flex;
align-items: center;
// border: 2rpx solid #e0e0e0;
border-radius: 12rpx;
overflow: hidden;
transition: border-color 0.3s;
}
.input-wrapper:focus-within {
border-color: #007AFF;
}
.input-field {
flex: 1;
height: 80rpx;
// padding: 0 24rpx;
font-size: 28rpx;
color: #333;
}
.placeholder {
color: #999;
font-size: 28rpx;
}
.picker {
width: 80rpx;
height: 80rpx;
display: flex;
align-items: center;
justify-content: center;
background-color: #f8f8f8;
border-left: 2rpx solid #e0e0e0;
}
.picker-trigger {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.picker-text {
font-size: 24rpx;
color: #666;
}
.custom-dialog-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 999;
}
.custom-dialog {
width: 600rpx;
background: #fff;
border-radius: 16rpx;
overflow: hidden;
}
.dialog-title {
padding: 30rpx;
font-size: 32rpx;
text-align: center;
border-bottom: 1rpx solid #eee;
}
.dialog-body {
padding: 40rpx;
}
.dialog-input {
width: 100%;
height: 80rpx;
border: 1rpx solid #ddd;
border-radius: 8rpx;
padding: 0 20rpx;
text-align: center;
}
.dialog-footer {
display: flex;
border-top: 1rpx solid #eee;
}
.dialog-footer button {
flex: 1;
border-radius: 0;
margin: 0;
}
</style>

View File

@@ -0,0 +1,179 @@
<template>
<view class="zd_container">
<!-- 外包材转运 -->
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">移出点位</span>
</view>
<view class="zd-col-24 filter_select">
<search-box v-model="val1" @handleChange="handleChange"/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">总数量</span>
</view>
<view class="zd-col-24">
<input type="number" v-model="num" class="filter_input filter_input_disabled" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">移入点位</span>
</view>
<view class="zd-col-24 filter_select">
<search-box
v-model="val2"
/>
</view>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
<th @tap="toAllCheck"><uni-icons :type="allCheck ? 'checkbox' : 'circle'" size="24" color="#4e6ef2"></uni-icons></th>
<th>序号</th>
<th>物料编码</th>
<th>物料名称</th>
<th>批号</th>
<th>出库数量</th>
<th>单位</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i">
<td @tap="toCheck(e)"><uni-icons :type="e.checked ? 'checkbox' : 'circle'" size="24" color="#4e6ef2"></uni-icons></td>
<td>{{i+1}}</td>
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.pcsn}}</td>
<td><input type="number" class="sin_input" v-model="e.qty" @blur="handleBlur(e)"></td>
<td>{{e.unit_name}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
<button class="zd-col-18 button-primary" :class="{'button-info': !val1 || !val2 || !checkedArr.length}" :disabled="disabled" @tap="_confirmTransfer">确认转运</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {queryTransferDtl, confirmTransfer} from '@/utils/getData3.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
num: null,
val1: '',
val2: '',
allCheck: false,
checkedArr: [],
dataList: [],
dataList: [{material_code: 'm001', qty: 100, checked: false, initialQty: 100}, {material_code: 'm002', qty: 200, checked: false, initialQty: 200}],
disabled: false
};
},
onLoad (options) {
this.title = options.title
},
methods: {
toEmpty () {
this.val1 = ''
this.val2 = ''
this.num = null
this.dataList = []
this.checkedArr = []
this.allCheck = false
this.disabled = false
},
toAllCheck () {
this.allCheck = !this.allCheck
this.dataList.map(el => {
el.checked = this.allCheck
})
},
toCheck (e) {
e.checked = !e.checked
this.checkedArr = this.dataList.filter(el => el.checked === true)
this.allCheck = this.checkedArr.length === this.dataList.length
},
handleChange (e) {
if (e) {
this._queryTransferDtl()
}
},
handleBlur (e) {
if (e.qty) {
if (e.qty < 0) {
e.qty = 0
} else {
e.qty = e.qty.replace(/[^0-9]/g, '')
e.qty = e.qty.replace(/^0+/, '') || '0'
if (e.qty > e.initialQty) {
e.qty = e.initialQty
}
this.num = this.dataList.reduce((sum, item) => sum + Number(item.qty), 0)
}
} else {
// uni.showToast({
// title: '数量必填',
// icon: 'none'
// })
}
},
async _queryTransferDtl () {
try {
let res = await queryTransferDtl(this.val1)
if (res && res.data.length > 0) {
this.dataList = [...res.data]
this.dataList.forEach(e => {
e.initialQty = e.qty
})
this.num = this.dataList.reduce((sum, item) => sum + Number(item.qty), 0)
} else {
this.dataList = []
}
} catch (e) {
this.dataList = []
}
},
async _confirmTransfer () {
this.checkedArr = this.dataList.filter(el => el.checked === true)
this.disabled = true
if (!this.val1 || !this.val2 || !this.checkedArr.length) {
this.disabled = false
return
}
try {
let res = await confirmTransfer(this.val1, this.val2, this.checkedArr)
if (res) {
uni.showToast({
title: res.message,
icon: 'none'
})
}
this.toEmpty()
this.disabled = false
} catch (e) {
this.disabled = false
}
}
}
}
</script>

View File

@@ -63,6 +63,13 @@
{title: '退库确认', path: '/pages/Material/tuiku-confirm'},
{title: '大料箱移库', path: '/pages/Material/dlx-move-store'},
{title: '大料箱盘库', path: '/pages/Material/dlx-pan-store'}
]},
{title: '外包材管理', path: 'RF01', sonTree: [
{title: '外包材收货', path: '/pages/hdyy/wbc/wbc-shouhuo'},
{title: '外包材转运', path: '/pages/hdyy/wbc/wbc-transfer'},
{title: '外包材送入', path: '/pages/hdyy/wbc/wbc-enter'},
{title: '外包材领用', path: '/pages/hdyy/wbc/wbc-getuse'},
{title: '外包材还回', path: '/pages/hdyy/wbc/wbc-return'}
]}
],
show: false,

93
utils/getData3.js Normal file
View File

@@ -0,0 +1,93 @@
import request from './request.js'
// 项目hdyy
/**
* 公共分类
*/
// 物料信息查询
export const queryMaterInfo = (ccode, mcode) => request({
url:'api/pda/publicInterface/queryMaterInfo',
data: {class_code: ccode, material_code: mcode}
})
// 查询区域下拉框
export const queryRegionDropdown = (rcode) => request({
url:'api/pda/publicInterface/queryRegionDropdown',
data: {region_code: rcode}
})
/**
* 外包材收货(外包材管理)
*/
// 根据点位编码查询区域下拉框
export const queryPointRegion = (pcode) => request({
url:'api/pda/packaging/queryPointRegion',
data: {point_code: pcode}
})
// 确认收货
export const confirmStock = (pcode, rcode, mid, mcode, mname, pcsn, qty, unit, remark) => request({
url:'api/pda/packaging/confirmStock',
data: {point_code: pcode, region_code: rcode, material_id: mid, material_code: mcode, material_name: mname, pcsn: pcsn, qty: qty, qty_unit_name: unit, remark: remark}
})
/**
* 外包材转运(外包材管理)
*/
// 查询列表明细
export const queryTransferDtl = (opoint) => request({
url:'api/pda/packaging/queryTransferDtl',
data: {out_point: opoint}
})
// 确认转运
export const confirmTransfer = (opoint, ipoint, rows) => request({
url:'api/pda/packaging/confirmTransfer',
data: {out_point: opoint, in_point: ipoint, rows: rows}
})
/**
* 外包材送货(外包材管理)
*/
// 查询点位库存明细
export const queryPointInDtl = (pcode) => request({
url:'api/pda/packaging/queryPointInDtl',
data: {point_code: pcode}
})
// 查询目的点位下拉框
export const queryPointInDownload = () => request({
url:'api/pda/packaging/queryPointInDownload',
data: {}
})
// 送入
export const packInConfirm = (pcode, icode, qty, rows) => request({
url:'api/pda/packaging/packInConfirm',
data: {point_code: pcode, in_point_code: icode, total_qty: qty, rows: rows}
})
/**
* 外包材领用(外包材管理)
*/
// 查询点位明细
export const queryPointDrawDtl = (pcode) => request({
url:'api/pda/packaging/queryPointDrawDtl',
data: {point_code: pcode}
})
// 确认取货
export const queryDrawConfirm = (pcode, qty, rows) => request({
url:'api/pda/packaging/queryDrawConfirm',
data: {point_code: pcode, total_qty: qty, rows: rows}
})
/**
* 外包材还回(外包材管理)
*/
// 确认还回
export const packConfirmReturn = (pcode, mid, mcode, mname, pcsn, qty, remark) => request({
url:'api/pda/packaging/packConfirmReturn',
data: {point_code: pcode, material_id: mid, material_code: mcode, material_name: mname, pcsn: pcsn, qty: qty, remark: remark}
})