Browse Source

非生产领料和退料线边 添加查询物料

pda_nev
李俊城 10 months ago
parent
commit
0702474e76
  1. 7
      fe/PDA/api/index.js
  2. 10
      fe/PDA/mycomponents/wincom/winScanByCode.vue
  3. 6
      fe/PDA/mycomponents/wincom/winScanByProductCode.vue
  4. 6
      fe/PDA/pages/query/item.vue
  5. 145
      fe/PDA/pages/task/unProducePickWipDetail.vue
  6. 105
      fe/PDA/pages/task/unProduceReturnWipDetail.vue
  7. 11
      fe/PDA/uni_modules/wz-select-popup/components/wz-select-popup/util/utils.js
  8. 47
      fe/PDA/uni_modules/wz-select-popup/components/wz-select-popup/wz-select-popup.vue

7
fe/PDA/api/index.js

@ -208,6 +208,13 @@ export const getBalancesByItemCode = (params) => promise(
data: params
});
// ERP料号模糊匹配查询所有物料数据
export const getItemCodeByLike = (itemCode,pageIndex,pageSize) => promise(
devUrl + "/api/pda/item/get-fuzzy?itemCode="+itemCode+"&pageIndex="+pageIndex+"&pageSize="+pageSize, {
method: 'get',
data: {}
});
//根据库位查询库存
export const getBalancesByStatus = (params) => request(

10
fe/PDA/mycomponents/wincom/winScanByCode.vue

@ -55,11 +55,17 @@
},
getfocus() {
if (this.isShow) {
this.$refs.scan.getfocus()
if(this.$refs.scan){
this.$refs.scan.getfocus()
}
}
},
losefocus() {
this.$refs.scan.losefocus()
if(this.$refs.scan){
this.$refs.scan.losefocus()
}
},
scanClick() {

6
fe/PDA/mycomponents/wincom/winScanByProductCode.vue

@ -80,8 +80,9 @@
getMesBarCode(result.data.code).then(item=>{
uni.hideLoading();
if (item) {
this.losefocus(); //,getfocus()
//,getfocus()
this.scanResult = {
scanCode:result.data.code,
itemCode:item.itemCode,
@ -92,11 +93,10 @@
qty:item.qty,
locationCode:item.locationCode
};
uni.hideLoading();
this.callBack();
} else {
this.losefocus();
this.showMessage('单件码【' + result.data.code + '】,不存在')
uni.hideLoading();
}
}).catch(err => {
uni.hideLoading();

6
fe/PDA/pages/query/item.vue

@ -142,7 +142,7 @@
},
getScanCode(code) {
if (code == "") {
this.showMessage('零件号不能为空')
this.showMessage('ERP料号不能为空')
return;
}
this.itemCode = '';
@ -153,7 +153,7 @@
},
getItemInfo(code) {
uni.showLoading({
title: "正在查询零件信息...",
title: "正在查询ERP料号信息...",
mask: true
});
@ -165,7 +165,7 @@
this.itemDetail = res;
this.getContentByTab(this.tabIndex)
} else {
this.showMessage('未查找到零件【' + code + '】');
this.showMessage('未查找到ERP料号【' + code + '】');
this.itemCode = "";
}
uni.hideLoading();

145
fe/PDA/pages/task/unProducePickWipDetail.vue

@ -6,8 +6,8 @@
<com-job-scan-detail :jobContent="datacontent" :allCount="allCount" :scanCount="scanCount">
</com-job-scan-detail>
</view>
<scroll-view scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower"
@scroll="scroll" class="scroll-detail">
<scroll-view scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll"
class="scroll-detail">
<view class="detail-list margin_top" v-for="(item, index) in details" :key="item.id">
<view class="detail-content">
@ -76,7 +76,7 @@
<view v-if="item.scaned" class="choose_marked_count"
style="background-color: #5FCB94; opacity: 0.65">
<view class="" style="background-color: #5FCB94; width: 200rpx;height: 300rpx;">
;
;
</view>
<!-- <image src="@/static/image_marked.svg"></image> -->
</view>
@ -89,11 +89,16 @@
</view>
<com-balance ref='issueitems' @selectedItem='selectedBalanceItem'></com-balance>
<win-scan-button @goScan='openScanPopup' title="单件码"></win-scan-button>
<winScanButtonTop @goScan='openItemScanPopup' title="ERP料号"></winScanButtonTop>
<winScanButtonBottom @goScan='queryItemCode' title="ERP查询"></winScanButtonBottom>
<winScanByProductCode ref="scanPackPopup" title="单件码" @getScanResult='getScanResult'></winScanByProductCode>
<winScanLocationCode ref="location" title="库位" @getLocation="getToLocation"></winScanLocationCode>
<win-scan-by-code ref="scanPopupItem" title='ERP料号' @getScanCode='getScanCode'>
</win-scan-by-code>
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance>
<wz-select-popup ref="wzSelectPopup" @select="selectCheckbox" />
<com-message ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'
@afterCloseScanMessage='closeScanMessage'></com-message>
@afterCloseScanMessage='closeScanMessage' @afterClose="closeScanMessage"></com-message>
</view>
</template>
@ -103,6 +108,8 @@
takeIssueJob,
cancelTakeIssueJob,
finshUnProducePickJob,
getitems,
getItemCodeByLike
} from '@/api/index.js';
import {
getJobStatuStyle,
@ -116,6 +123,8 @@
} from '@/common/basic.js';
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanButton from '@/mycomponents/wincom/winScanButton.vue'
import winScanButtonTop from '@/mycomponents/wincom/winScanButtonTop.vue'
import winScanButtonBottom from '@/mycomponents/wincom/winScanButtonBottom.vue'
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue'
import comBalance from '@/mycomponents/common/comBalance.vue'
import comJobScanDetail from '@/mycomponents/comjob/comJobScanDetail.vue'
@ -123,18 +132,22 @@
import comNumberBox from '@/mycomponents/common/comNumberBox.vue';
import winScanByProductCode from '@/mycomponents/wincom/winScanByProductCode.vue'
import winScanLocationCode from '@/mycomponents/wincom/winScanLocationCode.vue';
import winScanByCode from '@/mycomponents/wincom/winScanByCode.vue'
export default {
components: {
comMessage,
winScanButton,
winScanButtonTop,
winScanButtonBottom,
winMulitScan,
comBalance,
comJobScanDetail,
winScanByPack,
comNumberBox,
winScanByProductCode,
winScanLocationCode
winScanLocationCode,
winScanByCode
},
data() {
return {
@ -149,6 +162,11 @@
scanCount: 0,
isPack: true,
titleArray: ['箱标签'],
userForm: {
names: [],
values: [],
origin: []
}
}
},
filters: {
@ -204,8 +222,9 @@
},
getToLocation(locationInfo) {
if(this.currentItem.recommendFromLocationCode!=locationInfo.code){
this.showMessage("扫描库位["+locationInfo.code+"]与推荐来源库位["+this.currentItem.recommendFromLocationCode+"]不一致")
if (this.currentItem.recommendFromLocationCode != locationInfo.code) {
this.showMessage("扫描库位[" + locationInfo.code + "]与推荐来源库位[" + this.currentItem
.recommendFromLocationCode + "]不一致")
return;
}
this.currentItem.handledFromLocationCode = locationInfo.code;
@ -222,6 +241,43 @@
// }
this.$refs.scanPackPopup.openScanPopup();
},
openItemScanPopup() {
this.$refs.scanPopupItem.openScanPopup();
},
queryItemCode(){
this.$refs.wzSelectPopup.open({
mode: 'radio', //radio checkbox
// dataList:[], //dataList使proxyConfig
selected: this.userForm.values, //
proxyConfig: { //
reqFun: this.reqGetList, //,Promise.resolve([])
localPaging: false //
},
search: {
type: 'remote', //local | remote
},
fields: {
label: 'name',
value: 'code'
}
})
},
reqGetList(data) {
let params = {
pageSize: data.pageSize,
pageIndex: data.pageIndex,
itemCode: data.searchValue,
};
return getItemCodeByLike(data.searchValue,data.pageIndex,data.pageSize);
},
selectCheckbox(mode, result){
this.getScanResult(result,false)
},
//
getDetail() {
let that = this;
@ -262,19 +318,51 @@
});
},
getScanResult(result) {
getScanCode(code) {
if (code == "") {
this.showMessage('ERP料号不能为空')
return;
}
getitems(code).then((res) => {
uni.hideLoading();
if (res) {
var result ={
itemCode:res.code
}
this.getScanResult(result,false)
} else {
this.showMessage('未查找到ERP料号【' + code + '】');
}
}).catch((err) => {
this.showMessage(err.message);
uni.hideLoading();
})
},
getScanResult(result,isMesCode=true) {
// AH240321AM0153 AH240321AM0198 AH240321AM0199
let item = this.details.find(r => {
return r.itemCode == result.itemCode
});
if (item == undefined) {
this.showMessage('在任务详情中,单件码【' + result.scanCode + '】所对应的ERP料号与任务中的ERP料号不一致,请重新扫描');
if(isMesCode){
this.showMessage('在任务详情中,单件码【' + result.scanCode + '】所对应的ERP料号与任务中的ERP料号不一致,请重新扫描');
}else {
this.showMessage('在任务详情中,没有找到ERP料号[' + result.itemCode+"]的信息,请重新扫描");
}
return;
}
if(item.scaned){
this.showMessage('单件码['+result.scanCode+"]已经扫描")
}else {
if (item.scaned) {
if(isMesCode){
this.showMessage('单件码[' + result.scanCode + "]已经扫描")
}else {
this.showMessage('ERP料号[' + result.itemCode + "]已经扫描")
}
} else {
item.scaned = true;
item.scanDate = new Date()
this.details.sort(compareDesc('scanDate'));
@ -326,7 +414,7 @@
if (items.length == this.details.length) {
this.finsh();
} else {
this.showMessage("还有未扫描的单件码或库位")
this.showMessage("还有未扫描的ERP物料或库位")
}
},
@ -363,17 +451,17 @@
that.datacontent.details = that.details;
let params = JSON.stringify(that.datacontent);
console.log("提交", params);
finshUnProducePickJob(that.id, params)
.then(res => {
uni.hideLoading();
if (res != null) {
that.showCommitSuccessMessage();
}
})
.catch(err => {
that.showMessage(err.message);
uni.hideLoading();
});
// finshUnProducePickJob(that.id, params)
// .then(res => {
// uni.hideLoading();
// if (res != null) {
// that.showCommitSuccessMessage();
// }
// })
// .catch(err => {
// that.showMessage(err.message);
// uni.hideLoading();
// });
},
//
@ -392,14 +480,19 @@
this.getDetail();
},
showMessage(message) {
this.$refs.scanPackPopup.losefocus();
this.$refs.scanPopupItem.losefocus();
this.$refs.comMessage.showMessage(message);
},
showScanMessage(message) {
this.$refs.scanPackPopup.losefocus();
this.$refs.scanPopupItem.losefocus();
this.$refs.comMessage.showScanMessage(message);
},
closeScanMessage() {
this.$refs.scanPackPopup.getfocus();
this.$refs.scanPopupItem.getfocus();
},
calcScanCount() {
@ -419,11 +512,9 @@
closeScanPopup() {
if (this.allCount == this.scanCount) {
this.$refs.scanPackPopup.closeScanPopup();
this.$refs.scanPopupItem.closeScanPopup();
}
},
scanPopupGetFocus() {
this.$refs.scanPackPopup.getfocus();
},
}
}

105
fe/PDA/pages/task/unProduceReturnWipDetail.vue

@ -89,11 +89,16 @@
</view>
<com-balance ref='issueitems' @selectedItem='selectedBalanceItem'></com-balance>
<win-scan-button @goScan='openScanPopup' title="单件码"></win-scan-button>
<winScanButtonTop @goScan='openItemScanPopup' title="ERP料号"></winScanButtonTop>
<winScanButtonBottom @goScan='queryItemCode' title="ERP查询"></winScanButtonBottom>
<winScanByProductCode ref="scanPackPopup" title="单件码" @getScanResult='getScanResult'></winScanByProductCode>
<winScanLocationCode ref="location" title="库位" @getLocation="getToLocation"></winScanLocationCode>
<win-scan-by-code ref="scanPopupItem" title='ERP料号' @getScanCode='getScanCode'>
</win-scan-by-code>
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance>
<wz-select-popup ref="wzSelectPopup" @select="selectCheckbox" />
<com-message ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'
@afterCloseScanMessage='closeScanMessage'></com-message>
@afterCloseScanMessage='closeScanMessage' @afterClose="closeScanMessage"></com-message>
</view>
</template>
@ -103,6 +108,8 @@
takeIssueJob,
cancelTakeIssueJob,
finshUnProduceReturnJob,
getitems,
getItemCodeByLike
} from '@/api/index.js';
import {
getJobStatuStyle,
@ -116,6 +123,8 @@
} from '@/common/basic.js';
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanButton from '@/mycomponents/wincom/winScanButton.vue'
import winScanButtonTop from '@/mycomponents/wincom/winScanButtonTop.vue'
import winScanButtonBottom from '@/mycomponents/wincom/winScanButtonBottom.vue'
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue'
import comBalance from '@/mycomponents/common/comBalance.vue'
import comJobScanDetail from '@/mycomponents/comjob/comJobScanDetail.vue'
@ -123,18 +132,22 @@
import comNumberBox from '@/mycomponents/common/comNumberBox.vue';
import winScanByProductCode from '@/mycomponents/wincom/winScanByProductCode.vue'
import winScanLocationCode from '@/mycomponents/wincom/winScanLocationCode.vue';
import winScanByCode from '@/mycomponents/wincom/winScanByCode.vue'
export default {
components: {
comMessage,
winScanButton,
winScanButtonTop,
winScanButtonBottom,
winMulitScan,
comBalance,
comJobScanDetail,
winScanByPack,
comNumberBox,
winScanByProductCode,
winScanLocationCode
winScanLocationCode,
winScanByCode
},
data() {
return {
@ -149,6 +162,11 @@
scanCount: 0,
isPack: true,
titleArray: ['箱标签'],
userForm: {
names: [],
values: [],
origin: []
}
}
},
filters: {
@ -222,6 +240,42 @@
// }
this.$refs.scanPackPopup.openScanPopup();
},
openItemScanPopup() {
this.$refs.scanPopupItem.openScanPopup();
},
queryItemCode(){
this.$refs.wzSelectPopup.open({
mode: 'radio', //radio checkbox
// dataList:[], //dataList使proxyConfig
selected: this.userForm.values, //
proxyConfig: { //
reqFun: this.reqGetList, //,Promise.resolve([])
localPaging: false //
},
search: {
type: 'remote', //local | remote
},
fields: {
label: 'name',
value: 'code'
}
})
},
reqGetList(data) {
let params = {
pageSize: data.pageSize,
pageIndex: data.pageIndex,
itemCode: data.searchValue,
};
return getItemCodeByLike(data.searchValue,data.pageIndex,data.pageSize);
},
selectCheckbox(mode, result){
this.getScanResult(result,false)
},
//
getDetail() {
let that = this;
@ -262,18 +316,50 @@
});
},
getScanResult(result) {
getScanCode(code) {
if (code == "") {
this.showMessage('ERP料号不能为空')
return;
}
getitems(code).then((res) => {
uni.hideLoading();
if (res) {
var result ={
itemCode:res.code
}
this.getScanResult(result,false)
} else {
this.showMessage('未查找到ERP料号【' + code + '】');
}
}).catch((err) => {
this.showMessage(err.message);
uni.hideLoading();
})
},
getScanResult(result,isMesCode=true) {
// AH240321AM0153 AH240321AM0198 AH240321AM0199
let item = this.details.find(r => {
return r.itemCode == result.itemCode
});
if (item == undefined) {
this.showMessage('在任务详情中,单件码【' + result.scanCode + '】所对应的ERP料号与任务中的ERP料号不一致,请重新扫描');
if(isMesCode){
this.showMessage('在任务详情中,单件码【' + result.scanCode + '】所对应的ERP料号与任务中的ERP料号不一致,请重新扫描');
}else {
this.showMessage('在任务详情中,没有找到ERP料号[' + result.itemCode+"]的信息,请重新扫描");
}
return;
}
if (item.scaned) {
this.showMessage('单件码[' + result.scanCode + "]已经扫描")
if(isMesCode){
this.showMessage('单件码[' + result.scanCode + "]已经扫描")
}else {
this.showMessage('ERP料号[' + result.itemCode + "]已经扫描")
}
} else {
item.scaned = true;
item.scanDate = new Date()
@ -387,14 +473,19 @@
this.getDetail();
},
showMessage(message) {
this.$refs.scanPackPopup.losefocus();
this.$refs.scanPopupItem.losefocus();
this.$refs.comMessage.showMessage(message);
},
showScanMessage(message) {
this.$refs.scanPackPopup.losefocus();
this.$refs.scanPopupItem.losefocus();
this.$refs.comMessage.showScanMessage(message);
},
closeScanMessage() {
this.$refs.scanPackPopup.getfocus();
this.$refs.scanPopupItem.getfocus();
},
calcScanCount() {
@ -414,11 +505,9 @@
closeScanPopup() {
if (this.allCount == this.scanCount) {
this.$refs.scanPackPopup.closeScanPopup();
this.$refs.scanPopupItem.closeScanPopup();
}
},
scanPopupGetFocus() {
this.$refs.scanPackPopup.getfocus();
},
}
}

11
fe/PDA/uni_modules/wz-select-popup/components/wz-select-popup/util/utils.js

@ -0,0 +1,11 @@
export function debounceSetting(fn, wait) {
let timeout = null;
wait = wait || 600;
return function () {
let that = this;
if(timeout !== null) clearTimeout(timeout);
timeout = setTimeout(() => {
fn.apply(that);
}, wait);
}
}

47
fe/PDA/uni_modules/wz-select-popup/components/wz-select-popup/wz-select-popup.vue

@ -1,6 +1,6 @@
<template>
<view>
<u-popup ref="popup" v-model="showPopup" border-radius="15" style="width: 100%;" mode="center">
<u-popup ref="popup" v-model="showPopup" border-radius="15" style="width: 100%;" mode="center">
<view class="select-popup-content">
<view class="uni-flex" style="display: flex; width: 100%;justify-content: center; ">
<view class="" style=" font-size: 35rpx; margin: 20rpx; font-weight: bold;">
@ -10,7 +10,8 @@
<u-line></u-line>
<view class="popup-search">
<wz-search v-model="searchValue" @search="searchData('search')" @clear="searchData('clear')" @input="change"/>
<wz-search v-model="searchValue" @search="searchData('search')" @clear="searchData('clear')"
@input="changeValue" />
</view>
<scroll-view class="popup-scroll-y" :scroll-top="scroll.newTop" scroll-y
:style="{'--popup-scroll-height': scrollH}" @scrolltolower="scrolltolower" @scroll="viewScroll">
@ -33,6 +34,8 @@
<script>
import wzSearch from "./wz-search.vue"
import wzList from "./wz-list.vue"
import {debounceSetting} from "./util/utils.js"
import {
deepMerge,
deepClone,
@ -81,7 +84,7 @@
newTop: 0
},
popConfig: {},
showPopup:false
showPopup: false,
};
},
mounted() {
@ -103,11 +106,19 @@
this.scroll.oldTop = e.detail.scrollTop
}, 100)
},
change(data){
console.log("输入",data)
this.searchData("search")
},
changeValue: debounceSetting(function() {
this.searchData("search")
}, 500),
// change(data){
// console.log("",data)
// this.searchValue = debounce(this.searchData("search"), 500)
// // this.searchData("search")
// },
searchData(type) {
console.log("输入", this.searchValue)
const {
search,
fields,
@ -161,10 +172,10 @@
if (config) {
this.popConfig = deepMerge(this.popConfig, config)
}
this.dataList=[]
this.searchValue=""
this.dataList = []
this.searchValue = ""
this.listInit(dataList)
this.showPopup =true;
this.showPopup = true;
},
/**列表数据初始化*/
listInit(dataList) {
@ -189,6 +200,10 @@
/**组件代理请求*/
proxyRequest() {
console.log("请求proxyRequest")
uni.showLoading({
title: "加载中",
mask: true
})
const {
proxyConfig,
page
@ -199,9 +214,11 @@
...page,
searchValue: this.searchValue
}).then(list => {
list.items.forEach(res=>{
res.code =res.itemCode
res.name =res.itemName;
uni.hideLoading()
list.items.forEach(res => {
res.itemCode = res.itemCode?res.itemCode:res.code
res.itemName = res.itemName?res.itemName:res.name
res.itemDesc1 =res.itemDesc1?res.itemDesc1:res.desc1
})
if (proxyConfig.localPaging) { //
@ -215,7 +232,7 @@
// this.pageStatus.loading = 'nomore'
// this.pageStatus.isEmpty = true
// }
if (!list.items || list.items.length ==0) {
if (!list.items || list.items.length == 0) {
this.pageStatus.loading = 'nomore'
this.pageStatus.isEmpty = true
}
@ -225,7 +242,7 @@
})
},
close() {
this.showPopup =false;
this.showPopup = false;
this.$emit('close')
setTimeout(() => {
this.allDataList = null

Loading…
Cancel
Save