Browse Source

直接发料查询功能

lijuncheng0816
lijuncheng 1 month ago
parent
commit
ba7690e089
  1. 8
      src/api/request2.js
  2. 257
      src/mycomponents/query/balanceQuery.vue
  3. 84
      src/mycomponents/query/showListItem.vue
  4. 32
      src/pages/issue/record/directIssue.vue
  5. 37
      src/pages/productionReceipt/job/productionReceiptDetail.vue
  6. 6
      src/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue

8
src/api/request2.js

@ -548,7 +548,7 @@ export function getBasicItemByCode(itemCode) {
} }
return request({ return request({
url: baseApi + "/wms/itembasic/page", url: baseApi + "/wms/itembasic/page",
method: "post", method: "get",
data: params, data: params,
}); });
} }
@ -562,7 +562,7 @@ export function getBasicItemByCodeSenior(itemCode) {
var params = { var params = {
filters: [{ filters: [{
column: "column", column: "code",
action: "like", action: "like",
value: itemCode value: itemCode
}], }],
@ -570,8 +570,8 @@ export function getBasicItemByCodeSenior(itemCode) {
pageSize: 1000 pageSize: 1000
} }
return request({ return request({
url: baseApi + "/wms/itembasic/page", url: baseApi + "/wms/itembasic/senior",
method: "get", method: "post",
data: params, data: params,
}); });
} }

257
src/mycomponents/query/balanceQuery.vue

@ -0,0 +1,257 @@
<template>
<view style=" ">
<uni-drawer ref="showRight" mode="left" :mask-click="true" :width="330">
<view style="height:100vh;display:flex;flex-direction:column;">
<view class="uni-flex" style="justify-content: center;
background-color:#007AFF ;
color: #fff;
padding: 15rpx;
font-size: 35rpx;">
库存查询
</view>
<scroll-view v-if="true" style="height: calc(100vh - 180rpx)" scroll-y="true">
<!-- <button @click="closeDrawer" type="primary">关闭Drawer</button> -->
<!-- <view v-for="item in 110" :key="item">可滚动内容 {{ item }}</view> -->
<view class="" style="margin: 10rpx; font-size: 35rpx;">
物料号
</view>
<view style=" margin: 10rpx; display: flex; align-items: center;">
<uni-easyinput class="uni-mt-5" prefixIcon="search" v-model="itemCode" placeholder="请输入物料号"
@clear="clearItemCode" @confirm="onConfirmItemCode"></uni-easyinput>
<!-- <view>查询</view> -->
<!-- <button style="height: 80rpx; align-items: center; text-align: center;" type="primary" size="mini" >查询</button> -->
</view>
<view v-for="(item, index) in itemCodeResult" :key="index" @click="selectItemCode(item)">
<view class="" style="font-size: 30rpx; margin: 20rpx;">
<view class="">
({{index+1}}) 物料代码 : {{item.code}}
</view>
<view class="">
名称 : {{item.name}}
</view>
<view class="">
描述1 : {{item.desc1}}
</view>
<view class="">
描述2 : {{item.desc1}}
</view>
</view>
<view class="split_line"></view>
</view>
<scroll-view scroll-x="true" v-if="tableData.length>0" style="width: 330px; display: flex; align-items: center; justify-content: center; ">
<view style="width: 330px; display: flex;justify-content: center; background-color: #fff; padding-bottom: 150rpx;">
<uni-table border stripe emptyText="暂无更多数据">
<!-- 表头行 -->
<uni-tr>
<uni-th width="60" style="font-weight: 800;" align="left">序号</uni-th>
<uni-th width="60" align="left">批次</uni-th>
<uni-th width="50" align="left">库位</uni-th>
<uni-th width="60" align="left">状态</uni-th>
<uni-th width="120" align="left">数量</uni-th>
</uni-tr>
<!-- 表格数据行 -->
<uni-tr v-for="(item, index) in tableData" :key="index">
<uni-td>{{index+1}}</uni-td>
<uni-td>{{item.batch}}</uni-td>
<uni-td>{{item.locationCode}}</uni-td>
<uni-td>{{statusDesc(item.inventoryStatus)}}</uni-td>
<uni-td>{{item.qty}}</uni-td>
</uni-tr>
</uni-table>
<view class="uni-flex" style=" flex-direction: column; position: fixed; bottom: 0; margin-bottom: 100rpx; background-color: #fff; width: 100%; align-items: center;" >
<view class="" style="width: 100%; display: flex; justify-content: center; font-size: 32rpx;margin-top: 10rpx;margin-bottom: 10rpx;">
<view class="" >当前页{{ current }}总数{{ total }}每页{{ pageSize }}
</view>
</view>
<uni-pagination :current="current" :total="total" :show-icon="true"
@change="change" />
</view>
</view>
</scroll-view>
</scroll-view>
<button @click="closeDrawer" type="primary" style="padding-left: 20rpx;">关闭</button>
</view>
</uni-drawer>
</view>
</template>
<script>
import {
getBasicItemByCodeSenior,
} from '@/api/request2.js';
import {
getInventoryStatusStyle,
getInventoryStatusName
} from '@/common/directory.js';
export default {
components: {},
data() {
return {
itemCode: "",
itemCodeResult: [],
current: 1,
total: 18,
tableData: [{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 1
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 2
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 3
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 4
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 3
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 4
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 3
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 4
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 3
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 4
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 3
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 4
}
]
}
},
props: {
// detail: {
// type: Object,
// default: {}
// },
// isShowPack: {
// type: Boolean,
// default: true
// }
},
watch: {
},
methods: {
statusStyle: function(val) {
return getInventoryStatusStyle(val);
},
statusDesc(value) {
return getInventoryStatusName(value)
},
change() {
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
selectItemCode(item) {
this.itemCode = item.code
this.itemCodeResult = []
},
clearItemCode() {
this.itemCode = ""
this.itemCodeResult = []
},
onConfirmItemCode() {
if (!this.itemCode) {
this.showErrorMessage("物料号为空,请先输入物料号")
return;
}
uni.showLoading({
title: "加载中",
mask: true
})
getBasicItemByCodeSenior(this.itemCode).then(res => {
uni.hideLoading()
if (res.data && res.data.list.length > 0) {
if (res.data.list.length == 1) {
this.itemCode = res.data.list[0].code
} else {
this.itemCodeResult = res.data.list
}
} else {
this.showErrorMessage("未查找到物料[" + this.itemCode + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
showDrawer() {
this.$refs.showRight.open();
},
closeDrawer() {
this.$refs.showRight.close();
}
}
}
</script>
<style>
</style>

84
src/mycomponents/query/showListItem.vue

@ -0,0 +1,84 @@
<template>
<view class="wyf">
<uni-popup ref="listPopup" type="dialog">
<view class="container">
<uni-list class="list">
<uni-list-item v-for="(item,index) in list" :title="item.title"
thumb-size="lg" >
<template v-slot:footer>
<!-- <image class="slot-image" src="@/static/logo.png" mode="widthFix" @click="selectItem(item,index)"></image -->
<text class="go" @click="selectItem(item,index)">Go</text>
</template>
</uni-list-item>
</uni-list>
</view>
</uni-popup>
</view>
</template>
<script>
import { onShow } from '@dcloudio/uni-app';
export default {
emits: ["selectItem"],
components: {
},
data() {
return {
isScanedASN:false,
list: []
// [{
// title:'',
// selected:false
// }],
}
},
props: {
},
methods:{
openList(list){
this.list = list;
this.$refs.listPopup.open('center')
},
selectItem(item,index){
this.$refs.listPopup.close();
this.$emit("selectItem", item);
}
}
}
</script>
<style lang="scss" scoped>
.wyf{
// display: block;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1000
}
.container{
display: flex;
justify-content: center;
align-items: center;
.list{
width: 80%;
max-height:50vh;
overflow-y: auto;
border-radius: 10px !important;
.slot-image{
width: 40rpx;
}
.go{
color: rgb(60, 156, 255);
}
}
}
.list ::v-deep .uni-list--border{
border: 1rpx solid #e5e5e5;
}
</style>

32
src/pages/issue/record/directIssue.vue

@ -48,7 +48,7 @@
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode"> <winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode">
</winComScanBalance> </winComScanBalance>
<balanceQuery ref="refBalanceQuery" ></balanceQuery> <!-- <balanceQuery ref="refBalanceQuery"></balanceQuery> -->
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
@ -99,7 +99,7 @@
import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue' import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue' import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
import balanceQuery from '@/mycomponents/query/balanceQuery.vue' // import balanceQuery from '@/mycomponents/query/balanceQuery.vue'
export default { export default {
@ -114,7 +114,7 @@
recordDetailCard, recordDetailCard,
balanceSelect, balanceSelect,
winComScanBalance, winComScanBalance,
balanceQuery // balanceQuery
}, },
data() { data() {
return { return {
@ -166,7 +166,8 @@
if (e.index === 0) { if (e.index === 0) {
goHome(); goHome();
} else if (e.index == 1) { } else if (e.index == 1) {
this.$refs.refBalanceQuery.showDrawer(); // this.$refs.refBalanceQuery.showDrawer();
// this.closeScanPopup();
} }
}, },
// //
@ -177,26 +178,9 @@
mounted() {}, mounted() {},
methods: { methods: {
showDrawer() { // showDrawer() {
this.$refs.showRight.open(); // this.$refs.showRight.open();
}, // },
closeDrawer() {
this.$refs.showRight.close();
},
showDrawer() {
this.$refs.showRight.open();
},
closeDrawer() {
this.$refs.showRight.close();
},
showDrawer() {
this.$refs.showRight.open();
},
closeDrawer() {
this.$refs.showRight.close();
},
getBusinessType() { getBusinessType() {
getBusinessType(this.businessTypeCode, res => { getBusinessType(this.businessTypeCode, res => {

37
src/pages/productionReceipt/job/productionReceiptDetail.vue

@ -218,28 +218,33 @@
autoCommit(){ autoCommit(){
// //
var noCommitInfo=null var noCommitInfo=null
for (var i = 0; i < this.detailSource.length; i++) { let str=""
var sub =this.detailSource[i].subList
for(var j=0;j<sub.length;j++){ this.detailSource.forEach((item) => {
var item =sub[j] item.subList.forEach(cur => {
if(item.qty!=item.handleQty){ if (cur.qty != cur.handleQty) {
noCommitInfo=item; var tempHandleQty =0
break; if(cur.handleQty){
} tempHandleQty=cur.handleQty
}else {
tempHandleQty =0
} }
str += `包装号【${cur.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致\n`
} }
// })
if(noCommitInfo){ })
var handQty =noCommitInfo.handleQty?noCommitInfo.handleQty:0
this.showQuestionMessage("扫描数量["+handQty+"]任务数量["+noCommitInfo.qty+"]不一致,是否提交?",res=>{ if (str) {
if(res){ str = '任务明细未全部完成,是否提交?\n'+str
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
this.commit() this.commit()
} }
}) });
}else { } else {
//
this.commit() this.commit()
} }
}, },
// //

6
src/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue

@ -16,7 +16,8 @@
<view class="uni-pagination__btn" <view class="uni-pagination__btn"
:class="currentIndex === 1 ? 'uni-pagination--disabled' : 'uni-pagination--enabled'" :class="currentIndex === 1 ? 'uni-pagination--disabled' : 'uni-pagination--enabled'"
:hover-class="currentIndex === 1 ? '' : 'uni-pagination--hover'" :hover-start-time="20" :hover-class="currentIndex === 1 ? '' : 'uni-pagination--hover'" :hover-start-time="20"
:hover-stay-time="70" @click="clickLeft"> :hover-stay-time="70" @click="clickLeft"
style="margin-right: 70rpx;">
<template v-if="showIcon === true || showIcon === 'true'"> <template v-if="showIcon === true || showIcon === 'true'">
<uni-icons color="#666" size="16" type="left" /> <uni-icons color="#666" size="16" type="left" />
</template> </template>
@ -41,7 +42,8 @@
<view class="uni-pagination__btn" <view class="uni-pagination__btn"
:class="currentIndex >= maxPage ? 'uni-pagination--disabled' : 'uni-pagination--enabled'" :class="currentIndex >= maxPage ? 'uni-pagination--disabled' : 'uni-pagination--enabled'"
:hover-class="currentIndex === maxPage ? '' : 'uni-pagination--hover'" :hover-start-time="20" :hover-class="currentIndex === maxPage ? '' : 'uni-pagination--hover'" :hover-start-time="20"
:hover-stay-time="70" @click="clickRight"> :hover-stay-time="70" @click="clickRight"
style="margin-left: 70rpx;">
<template v-if="showIcon === true || showIcon === 'true'"> <template v-if="showIcon === true || showIcon === 'true'">
<uni-icons color="#666" size="16" type="right" /> <uni-icons color="#666" size="16" type="right" />
</template> </template>

Loading…
Cancel
Save