Browse Source

Merge branch 'hella_online_20240803' into master_hella

hella_online_20240829
陈薪名 8 months ago
parent
commit
d7005515a4
  1. 10
      .env.development
  2. 9
      .env.production
  3. 4
      src/common/basic.js
  4. 43
      src/common/label.js
  5. 4
      src/components/show-modal/show-modal.vue
  6. 4
      src/mycomponents/balance/level.vue
  7. 4
      src/mycomponents/common/comMessage.vue
  8. 144
      src/mycomponents/job/jobFilter.vue
  9. 6
      src/mycomponents/record/recordComDetailCard.vue
  10. 83
      src/mycomponents/scan/winComScanBalance.vue
  11. 2
      src/pages.json
  12. 2
      src/pages/customerReturn/job/returnDetail.vue
  13. 39
      src/pages/deliver/coms/comScanDeliverPack.vue
  14. 3
      src/pages/fg/fgChange.vue
  15. 28
      src/pages/fg/receiptByPlan.vue
  16. 7
      src/pages/inventoryMove/coms/comMoveJob.vue
  17. 8
      src/pages/inventoryMove/coms/comMoveRecord.vue
  18. 18
      src/pages/inventoryMove/job/holdToOkMoveJob.vue
  19. 16
      src/pages/inventoryMove/job/holdToScrapMoveJob.vue
  20. 3
      src/pages/inventoryMove/job/moveJob.vue
  21. 15
      src/pages/inventoryMove/job/nokToHoldMoveJob.vue
  22. 15
      src/pages/inventoryMove/job/okToHoldMoveJob.vue
  23. 16
      src/pages/inventoryMove/job/okToScrapMoveJob.vue
  24. 16
      src/pages/inventoryMove/job/scrapToHoldMoveJob.vue
  25. 231
      src/pages/issue/coms/comScanIssuePack.vue
  26. 10
      src/pages/issue/job/issueDetail.vue
  27. 140
      src/pages/issue/job/issueJob.vue
  28. 330
      src/pages/issue/record/directIssue.vue
  29. 719
      src/pages/issue/record/directIssue2.vue
  30. 6
      src/pages/package/record/overPackageRecord.vue
  31. 5
      src/pages/package/record/splitPackageRecord.vue
  32. 6
      src/pages/point/index.vue
  33. 39
      src/pages/pointPutawayJob/index.vue
  34. 109
      src/pages/productPutaway/job/productPutawayJob.vue
  35. 4
      src/pages/productPutaway/job/semiProductPutawayJob.vue
  36. 2
      src/pages/productReceipt/job/ccProductReceiptDetail.vue
  37. 35
      src/pages/productReceipt/job/ccProductReceiptJob.vue
  38. 9
      src/pages/productReceipt/job/fgProductReceiptDetail.vue
  39. 111
      src/pages/productReceipt/job/productReceiptJob.vue
  40. 2
      src/pages/productRecycle/job/productRecycleJobDetail.vue
  41. 11
      src/pages/productionReceipt/job/productionReceiptJob.vue
  42. 8
      src/pages/purchaseReceipt/job/receiptJob.vue
  43. 96
      src/pages/putaway/job/putawayJob.vue
  44. 3
      src/pages/repleinsh/coms/comRepleishDetailCard.vue
  45. 333
      src/pages/repleinsh/coms/comScanReplishPack.vue
  46. 42
      src/pages/repleinsh/job/repleinshDetail.vue
  47. 125
      src/pages/repleinsh/job/repleinshJob.vue
  48. 133
      src/pages/repleinsh/record/directRepleinshRecord.vue

10
.env.development

@ -1,11 +1,11 @@
VITE_BASE_URL=http://172.21.32.13:81/api/admin-api VITE_BASE_URL=http://172.22.32.9:81/api/admin-api
VITE_BASE_URL_IMAGE=http://172.21.32.13:81/admin-api VITE_BASE_URL_IMAGE=http://172.22.32.9:81/admin-api
# 租户配置 # 租户配置
VITE_TENANT='[{"text":"长春1379","value":1}]' VITE_TENANT='[{"text":"长春1379","value":1},{"text":"成都1397","value":2},{"text":"长春2379","value":3}]'
# 是否是测试环境 # 是否是测试环境
VITE_isDevelopment=false VITE_isDevelopment=true
# 积木报表请求路径 # 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://172.21.32.13:90' VITE_JMREPORT_BASE_URL='http://172.22.32.9:90'

9
.env.production

@ -1,11 +1,12 @@
VITE_BASE_URL=http://172.21.32.13:81/api/admin-api VITE_BASE_URL=http://172.22.32.8:81/api/admin-api
VITE_BASE_URL_IMAGE=http://172.21.32.13:81/admin-api VITE_BASE_URL_IMAGE=http://172.22.32.8:81/admin-api
# 租户配置 # 租户配置
VITE_TENANT='[{"text":"长春1379","value":1}]' VITE_TENANT='[{"text":"成都1397","value":2},{"text":"长春2379","value":3}]'
# 是否是测试环境 # 是否是测试环境
VITE_isDevelopment=false VITE_isDevelopment=false
# 积木报表请求路径 # 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://172.21.32.13:90' VITE_JMREPORT_BASE_URL='http://172.22.32.8:90'

4
src/common/basic.js

@ -344,9 +344,7 @@ export function getInspectReasonList(value) {
export function getSwitchInfoByCode(code) { export function getSwitchInfoByCode(code) {
var isCheck = false var isCheck = false
var resultInfo = "" var resultInfo = ""
if (switchList.length == 0) { switchList = uni.getStorageSync("switch")
switchList = uni.getStorageSync("switch")
}
for (let item of switchList) { for (let item of switchList) {
if (item.code == code) { if (item.code == code) {

43
src/common/label.js

@ -12,45 +12,45 @@ import {
export function getLabelInfo(scanMsg,headerType, callBack) { export function getLabelInfo(scanMsg, headerType, callBack) {
console.log('扫描信息:', scanMsg); console.log('扫描信息:', scanMsg);
if (scanMsg.length == 0) { if (scanMsg.length == 0) {
return null return null
} }
let items = scanMsg.split(';'); let items = scanMsg.split(';');
let header = items[0]; let header = items[0];
let version = items[1]; let version = items[1];
if ((header != undefined) && (version!=undefined)) { if ((header != undefined) && (version != undefined)) {
var hearList =getDirectoryItemArray(headerType) var hearList = getDirectoryItemArray(headerType)
if(!checkDirectoryItemExist(hearList,header)){ if (!checkDirectoryItemExist(hearList, header)) {
let labelResult = { let labelResult = {
label: { label: {
labelType: "", labelType: "",
barType: '', barType: '',
code:"" code: ""
}, },
package: null, package: null,
success: false, success: false,
message: '请输入'+headerType+"开始的标签", message: '请输入' + headerType + "开始的标签",
} }
callBack(labelResult); callBack(labelResult);
return; return;
} }
//解析扫描的是一维码还是二维码 //解析扫描的是一维码还是二维码
let type = header.substring(header.length - 1, header.length); let type = header.substring(header.length - 1, header.length);
if (type == 'Q') //qrcode if (type == 'Q') //qrcode
{ {
getQRCodeInfo(header, version, scanMsg, callBack); getQRCodeInfo(header, version, scanMsg, callBack);
} }
// else if (type == 'B') //barcode // else if (type == 'B') //barcode
// { // {
// getBarCodeInfo(header, version, items[2], callBack); // getBarCodeInfo(header, version, items[2], callBack);
// } // }
else { //直接输入文本 else { //直接输入文本
getBarCodeInfo('text', 'V1.0', scanMsg, callBack); getBarCodeInfo('text', 'V1.0', scanMsg, callBack);
} }
}else { } else {
getBarCodeInfo('text', 'V1.0', scanMsg, callBack); getBarCodeInfo('text', 'V1.0', scanMsg, callBack);
// let labelResult = { // let labelResult = {
// label: { // label: {
@ -79,7 +79,7 @@ export function getQRCodeInfo(header, version, scanMsg, callBack) {
message: '' message: ''
} }
getLabelByHeader(header, version).then(res => { getLabelByHeader(header, version).then(res => {
if (res.data==null) { if (res.data == null) {
labelResult.success = false; labelResult.success = false;
labelResult.message = '未查找到标签头为[' + header + ']的标签类型'; labelResult.message = '未查找到标签头为[' + header + ']的标签类型';
callBack(labelResult); callBack(labelResult);
@ -89,7 +89,7 @@ export function getQRCodeInfo(header, version, scanMsg, callBack) {
version: version, version: version,
label: res.data, label: res.data,
}; };
labelDic.push(newItem); labelDic.push(newItem);
getLabelItems(newItem, scanMsg, callBack); getLabelItems(newItem, scanMsg, callBack);
} }
@ -108,13 +108,13 @@ export function getLabelItems(labelItem, scanMsg, callBack) {
if (labelResult.label.labelType == 'PurchaseLabel' || labelResult.label.labelType == 'MakeLabel') { if (labelResult.label.labelType == 'PurchaseLabel' || labelResult.label.labelType == 'MakeLabel') {
//查询包装信息 //查询包装信息
let packingNumber = labelResult.label.packingNumber let packingNumber = labelResult.label.packingNumber
if (packingNumber != undefined) { if (packingNumber != undefined && packingNumber != '') {
getPackageListByNumber(packingNumber).then(pack => { getPackageListByNumber(packingNumber).then(pack => {
if (pack.data.reqPackage) { if (pack.data.reqPackage) {
labelResult.package = pack.data.reqPackage; labelResult.package = pack.data.reqPackage;
labelResult.package.subList = pack.data.subList; labelResult.package.subList = pack.data.subList;
console.log('包装信息', JSON.stringify(labelResult.package)) console.log('包装信息', JSON.stringify(labelResult.package))
} else { } else {
labelResult.success = false; labelResult.success = false;
labelResult.message = '包装号[' + packingNumber + ']没有包装信息'; labelResult.message = '包装号[' + packingNumber + ']没有包装信息';
@ -126,9 +126,12 @@ export function getLabelItems(labelItem, scanMsg, callBack) {
callBack(labelResult); callBack(labelResult);
}) })
} else { } else {
labelResult.success = false; //线边的物料可能没有箱码
labelResult.message = '在条码中未解析到箱码'; labelResult.package = labelResult.label;
callBack(labelResult); callBack(labelResult);
// labelResult.success = false;
// labelResult.message = '在条码中未解析到箱码';
// callBack(labelResult);
} }
} else { } else {
callBack(labelResult); callBack(labelResult);
@ -145,7 +148,7 @@ export function analysisQRCodeLabel(labelItem, scanMsg) {
success: true, success: true,
message: '' message: ''
} }
let separators = labelItem.label.separators; let separators = labelItem.label.separators;
if (separators == undefined || separators == null) { if (separators == undefined || separators == null) {
labelResult.message = "未读取到分隔符"; labelResult.message = "未读取到分隔符";
@ -189,11 +192,11 @@ export function getBarCodeInfo(header, version, value, callBack) {
label: { label: {
labelType: header, labelType: header,
barType: 'BarCode', barType: 'BarCode',
code:value code: value
}, },
package: null, package: null,
success: true, success: true,
message: '', message: '',
} }
callBack(labelResult); callBack(labelResult);
} }

4
src/components/show-modal/show-modal.vue

@ -82,7 +82,9 @@
cancelClose() { cancelClose() {
clearInterval(this.timer) //timer clearInterval(this.timer) //timer
this.$refs.modal.popupClose(); if(this.$refs.modal){
this.$refs.modal.popupClose();
}
this.success({ this.success({
// cancel: true, // cancel: true,
confirm: false, confirm: false,

4
src/mycomponents/balance/level.vue

@ -15,8 +15,8 @@
}, },
props: { props: {
priority: { priority: {
type: String, type: Number,
default:'2' default:2
}, },
title: { title: {
type: String, type: String,

4
src/mycomponents/common/comMessage.vue

@ -109,7 +109,9 @@
if (this.show) { if (this.show) {
this.show = false; this.show = false;
clearInterval(this.timer) //timer clearInterval(this.timer) //timer
this.$refs.modal.popupClose(); if(this.$refs.modal){
this.$refs.modal.popupClose();
}
this.success({ this.success({
// cancel: false, // cancel: false,
confirm: true, confirm: true,

144
src/mycomponents/job/jobFilter.vue

@ -1,40 +1,53 @@
<template> <template>
<uni-popup ref="popup" > <uni-popup ref="popup">
<view class="maskbox" @tap="maskClick"></view> <view class="maskbox" @tap="maskClick"></view>
<view class="uni-flex uni-column center" <view class="uni-flex uni-column center"
style="background-color: white;width: 100%; height:auto;padding: 20rpx;z-index: 99;position: relative; border-radius: 10rpx;"> style="background-color: white;width: 100%; height:auto;padding: 20rpx;z-index: 99;position: relative; border-radius: 10rpx;">
<view class="uni-flex space-between u-col-center" style="width: 100%;"> <view class="uni-flex space-between u-col-center" style="width: 100%;">
<view class="" style="font-size: 32rpx;"> <view class="" style="font-size: 32rpx;">
只看当天 只看当天
</view> </view>
<u-switch v-model="checkedTodayModel" active-color="#4DD865" inactive-color="#eee" size="35" @change="switchChangeToday"></u-switch> <u-switch v-model="checkedTodayModel" active-color="#4DD865" inactive-color="#eee" size="35"
@change="switchChangeToday"></u-switch>
</view> </view>
<view class="uni-flex space-between u-col-center" style="width: 100%;margin-top: 30rpx;"> <view class="uni-flex space-between u-col-center" style="width: 100%;margin-top: 30rpx;">
<view class="" style="font-size: 32rpx;"> <view class="" style="font-size: 32rpx;">
只看待处理 只看待处理
</view> </view>
<u-switch v-model="checkedWaitModel" active-color="#4DD865" inactive-color="#eee" size="35" @change="switchChangeWait"></u-switch> <u-switch v-model="checkedWaitModel" active-color="#4DD865" inactive-color="#eee" size="35"
@change="switchChangeWait"></u-switch>
</view> </view>
<view v-if="isShowProductionLineCode" class="uni-flex space-between u-col-center" style="width: 100%;margin-top: 30rpx;"> <view v-if="isShowProductionLineCode" class="uni-flex space-between u-col-center"
style="width: 100%;margin-top: 30rpx;">
<view class="" style="font-size: 32rpx;"> <view class="" style="font-size: 32rpx;">
生产线 生产线
</view> </view>
<!-- <u-input style="margin-left: 20rpx;" v-model="productionLineCode" :border="true" <!-- <u-input style="margin-left: 20rpx;" v-model="productionLineCode" :border="true"
placeholder="请输入生产线" @confirm="productionLineCodeConfirm" /> --> placeholder="请输入生产线" @confirm="productionLineCodeConfirm" /> -->
<uni-data-select class="uni-data-select" style="margin-left: 50rpx;" placeholder="请输入生产线" v-model="productionLineCode" :clear="false" :localdata="productionline" @change="productionLineCodeConfirm"></uni-data-select> <uni-data-select class="uni-data-select" style="margin-left: 50rpx;" placeholder="请输入生产线"
v-model="productionLineCode" :clear="false" :localdata="productionline"
@change="productionLineCodeConfirm"></uni-data-select>
</view> </view>
<view v-if="isShowFromLocationCode" class="uni-flex space-between u-col-center" style="width: 100%;margin-top: 30rpx;"> <view v-if="isShowItemCode" class="uni-flex space-between u-col-center"
style="width: 100%;margin-top: 30rpx;">
<view class="" style="font-size: 32rpx;">
物料代码
</view>
<u-input style="margin-left: 20rpx;" confirmType="search" v-model="itemCode" :border="true"
placeholder="请输入物料代码" @confirm="itemCodeConfirm" />
</view>
<view v-if="isShowFromLocationCode" class="uni-flex space-between u-col-center"
style="width: 100%;margin-top: 30rpx;">
<view class="" style="font-size: 32rpx;"> <view class="" style="font-size: 32rpx;">
来源库位 来源库位
</view> </view>
<u-input style="margin-left: 20rpx;" confirmType="search" v-model="fromLocationCode" :border="true" <u-input style="margin-left: 20rpx;" confirmType="search" v-model="fromLocationCode" :border="true"
placeholder="请输入来源库位" @confirm="fromLocationCodeConfirm" /> placeholder="请输入来源库位" @confirm="fromLocationCodeConfirm" />
</view> </view>
<view class=""> <!-- <view class="">
<view class="uni-flex u-row-center" style="margin-top: 30rpx;" v-if="isShowAsn"> <view class="uni-flex u-row-center" style="margin-top: 30rpx;" v-if="isShowAsn">
<button class="filter_button" hover-class="filter_button_after" <button class="filter_button" hover-class="filter_button_after"
@click="scanOtherClick">扫描ASN单号</button> @click="scanOtherClick">扫描ASN单号</button>
@ -43,8 +56,13 @@
<button class="filter_button" hover-class="filter_button_after" <button class="filter_button" hover-class="filter_button_after"
@click="scanNumberClick">扫描任务编号</button> @click="scanNumberClick">扫描任务编号</button>
</view> </view>
</view> -->
<view class=" uni-flex uni-row" style="margin-top: 5px;" v-if="isShowQurery">
<button class="btn_single_clear" hover-class="btn_commit_after" @click="reset()">重置</button>
<button class="btn_single_commit" hover-class="btn_commit_after" @click="query()">查询</button>
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
<win-scan-job-number ref="scanNumber" title="任务编号" @getScanCode='getScanNumber'></win-scan-job-number> <win-scan-job-number ref="scanNumber" title="任务编号" @getScanCode='getScanNumber'></win-scan-job-number>
<win-scan-asn-number ref="scanAsnNumber" :title="otherTitle" @getScanCode='getScanAsNumber'></win-scan-asn-number> <win-scan-asn-number ref="scanAsnNumber" :title="otherTitle" @getScanCode='getScanAsNumber'></win-scan-asn-number>
@ -59,12 +77,14 @@
import winScanAsnNumber from "@/mycomponents/scan/winScanAsnNumber.vue" import winScanAsnNumber from "@/mycomponents/scan/winScanAsnNumber.vue"
export default { export default {
emits: ["switchChangeToday", "switchChangeWait", "onScanNumber", "onScanAsnNumber","productionLineCode","fromLocationCode","fromLocationCodeConfirm"], emits: ["switchChangeToday", "switchChangeWait", "onScanNumber", "onScanAsnNumber", "productionLineCode",
"fromLocationCode", "fromLocationCodeConfirm", "itemCodeConfirm", "onQuery"
],
components: { components: {
winScanJobNumber, winScanJobNumber,
winScanAsnNumber winScanAsnNumber
}, },
props: { props: {
checkedToday: { checkedToday: {
type: Boolean, type: Boolean,
@ -78,34 +98,45 @@
type: String, type: String,
default: "" default: ""
}, },
isShowAsn:{ isShowAsn: {
type: Boolean, type: Boolean,
default: false default: false
}, },
isShowJob:{ isShowJob: {
type: Boolean, type: Boolean,
default: true default: true
}, },
isShowFromLocationCode:{ isShowFromLocationCode: {
type: Boolean, type: Boolean,
default: false default: false
}, },
isShowProductionLineCode:{ isShowProductionLineCode: {
type: Boolean, type: Boolean,
default: false default: false
}, },
productionline:{ productionline: {
type: Array, type: Array,
default: [] default: []
},
isShowItemCode: {
type: Boolean,
default: false
},
isShowQurery: {
type: Boolean,
default: false
} }
}, },
data() { data() {
return { return {
dataContent: {}, dataContent: {},
checkedTodayModel:false, checkedTodayModel: false,
checkedWaitModel:false, checkedWaitModel: false,
productionLineCode:'',// 线 productionLineCode: '', // 线
fromLocationCode:'',// fromLocationCode: '', //
itemCode: '', //
creationTime: '',
status: ''
} }
}, },
watch: { watch: {
@ -124,18 +155,47 @@
deep: true deep: true
} }
}, },
mounted() { mounted() {},
},
methods: { methods: {
getQueryCondition() {
let params = {
productionLineCode: this.productionLineCode,
fromLocationCode: this.fromLocationCode,
itemCode: this.itemCode,
creationTime: this.creationTime,
status: this.status
}
return params;
},
reset(){
this.productionLineCode = ''
this.fromLocationCode = ''
this.itemCode = ''
this.creationTime = ''
this.status = ''
this.query()
},
query() {
let params = this.getQueryCondition();
this.$emit("onQuery", params)
this.closeScanPopup();
},
// 线 // 线
productionLineCodeConfirm(e){ productionLineCodeConfirm(e) {
var lineCode=e var lineCode = e
this.$emit("productionLineCode", lineCode) this.productionLineCode = e;
// this.$emit("productionLineCode", lineCode)
}, },
// //
fromLocationCodeConfirm(){ fromLocationCodeConfirm() {
this.$emit("fromLocationCode", this.fromLocationCode) // this.$emit("fromLocationCode", this.fromLocationCode)
},
itemCodeConfirm() {
}, },
// //
maskClick() { maskClick() {
@ -149,22 +209,26 @@
this.$refs.popup.close() this.$refs.popup.close()
}, },
switchChangeToday(isOn) { switchChangeToday(isOn) {
let creationTime = ''; let creationTime = '';
if (isOn) { if (isOn) {
creationTime = getTodayDate(); creationTime = getTodayDate();
} }
this.creationTime = creationTime;
this.$emit("switchChangeToday", isOn, creationTime) this.$emit("switchChangeToday", isOn, creationTime)
this.closeScanPopup() if (!this.isShowQurery) {
this.closeScanPopup()
}
}, },
switchChangeWait(isOn) { switchChangeWait(isOn) {
let status = "1,2"; let status = "1,2";
if(isOn){ if (isOn) {
status="1" status = "1"
} }
this.status = status;
this.$emit("switchChangeWait", isOn, status) this.$emit("switchChangeWait", isOn, status)
this.closeScanPopup() if (!this.isShowQurery) {
this.closeScanPopup()
}
}, },
scanNumberClick() { scanNumberClick() {
@ -199,4 +263,4 @@
height: 100vh; height: 100vh;
z-index: 0; z-index: 0;
} }
</style> </style>

6
src/mycomponents/record/recordComDetailCard.vue

@ -9,7 +9,7 @@
:isShowBalanceQty="isShowBalanceQty"></item-qty> :isShowBalanceQty="isShowBalanceQty"></item-qty>
<view style="margin-left: 10px; margin-top: 5px;"> <view style="margin-left: 10px; margin-top: 5px;">
<pack title='父包装' :packingCode='dataContent.containerNumber'></pack> <pack title='父包装' :packingCode='dataContent.containerNumber'></pack>
<location title='目标库位' :locationCode='dataContent.toLocationCode'></location> <location v-if="isShowParentToLocation" title='目标库位' :locationCode='dataContent.toLocationCode'></location>
</view> </view>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
@ -91,6 +91,10 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
isShowParentToLocation: {
type: Boolean,
default: true
},
isShowBalanceQty: { isShowBalanceQty: {
type: Boolean, type: Boolean,

83
src/mycomponents/scan/winComScanBalance.vue

@ -34,7 +34,8 @@
import { import {
getBalanceByParams, getBalanceByParams,
getBasicItemByCode getBasicItemByCode,
getBalanceByFilter
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
@ -77,6 +78,10 @@
verifyCategory: { verifyCategory: {
type: Boolean, type: Boolean,
default: false default: false
},
isCheckLocationBalance: {
type: Boolean,
default: true
} }
}, },
data() { data() {
@ -91,6 +96,7 @@
fromLocation: '', fromLocation: '',
fromLocationList: [], fromLocationList: [],
fromLocationAreaTypeList: [], fromLocationAreaTypeList: [],
toLocationAreaTypeList: [],
locationOnFocus: false, locationOnFocus: false,
businessType: {}, businessType: {},
inventoryStatus: [], inventoryStatus: [],
@ -109,9 +115,9 @@
this.businessType = businessType this.businessType = businessType
this.fromInventoryStatuses = getDirectoryItemArray(businessType.outInventoryStatuses) this.fromInventoryStatuses = getDirectoryItemArray(businessType.outInventoryStatuses)
this.fromLocationAreaTypeList = getDirectoryItemArray(businessType.outAreaTypes) this.fromLocationAreaTypeList = getDirectoryItemArray(businessType.outAreaTypes)
this.toLocationAreaTypeList = getDirectoryItemArray(businessType.inAreaTypes)
this.itemTypesList = getDirectoryItemArray(businessType.itemTypes) this.itemTypesList = getDirectoryItemArray(businessType.itemTypes)
this.$refs.popup.open('bottom') this.$refs.popup.open('bottom')
}, },
getScanResult(result) { getScanResult(result) {
@ -121,7 +127,70 @@
return; return;
} }
this.getItemCodeType(result.package.itemCode, callBack => { this.getItemCodeType(result.package.itemCode, callBack => {
this.queryBalance(this.resultData) if(this.isCheckLocationBalance){
this.getToLocationBalance(this.resultData)
}else {
this.queryBalance(this.resultData)
}
})
},
//
getToLocationBalance(result) {
uni.showLoading({
title: '查询中',
mask: true
})
var filters = []
if (result.package.parentNumber) {
var packingNumber = result.package.parentNumber + "," + result.package.number;
filters.push({
column: "packingNumber",
action: "in",
value: packingNumber
})
} else {
filters.push({
column: "packingNumber",
action: "==",
value: result.package.number
})
}
filters.push({
column: "itemCode",
action: "==",
value: result.package.itemCode
})
filters.push({
column: "batch",
action: "==",
value: result.package.batch
})
filters.push({
column: "areaType",
action: "in",
value: this.toLocationAreaTypeList.join(',')
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getBalanceByFilter(params).then(res => {
uni.hideLoading()
if (res.data.list.length > 0) {
this.showErrorMessage("包装在库位【" + res.data.list[0].locationCode + "】已有库存余额");
} else {
this.queryBalance(this.resultData);
}
// callback(res.data)
}).catch(err => {
this.showErrorMessage(err.message);
}) })
}, },
@ -170,7 +239,7 @@
this.showErrorMessage(error) this.showErrorMessage(error)
}) })
}, },
getItemCodeType(itemCode, callBack) { getItemCodeType(itemCode, callBack) {
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
@ -186,9 +255,7 @@
if (this.verifyCategory) { if (this.verifyCategory) {
if (result.category == 'LCJ' || result.category == 'BJ') { if (result.category == 'LCJ' || result.category == 'BJ') {
callBack() callBack()
} } else {
else
{
this.showErrorMessage("扫描物料的种类不是【量产件】或者【备件】") this.showErrorMessage("扫描物料的种类不是【量产件】或者【备件】")
} }
} else { } else {
@ -213,6 +280,7 @@
this.showErrorMessage(error) this.showErrorMessage(error)
}) })
}, },
showErrorMessage(message) { showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, res => {
if (res) { if (res) {
@ -222,6 +290,7 @@
} }
}); });
}, },
selectBalanceItem(item) { selectBalanceItem(item) {
this.resultData.balance = item this.resultData.balance = item
this.$emit("getBalance", this.resultData) this.$emit("getBalance", this.resultData)

2
src/pages.json

@ -686,7 +686,7 @@
{ {
"path": "pages/repleinsh/record/repleinshRecord", "path": "pages/repleinsh/record/repleinshRecord",
"style": { "style": {
"navigationBarTitleText": "补料记录", "navigationBarTitleText": "超市先进先出补料",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"titleNView": { "titleNView": {
"autoBackButton": "true" "autoBackButton": "true"

2
src/pages/customerReturn/job/returnDetail.vue

@ -252,7 +252,7 @@
getScanResult(result) { getScanResult(result) {
try { try {
var packingNumber = result.balance.packingNumber; var packingNumber = result.package.number;
var batch = result.balance.batch; var batch = result.balance.batch;
var qty = result.balance.qty; var qty = result.balance.qty;
var itemCode = result.balance.itemCode; var itemCode = result.balance.itemCode;

39
src/pages/deliver/coms/comScanDeliverPack.vue

@ -232,10 +232,11 @@
fromLocationUpdate(fromlocation) { fromLocationUpdate(fromlocation) {
let location = this.fromLocationList.find(r => r == fromlocation) let location = this.fromLocationList.find(r => r == fromlocation)
if (location == undefined) { // --
this.fromLocationCode = '' // if (location == undefined) {
this.showErrorMessage('发货库位【' + fromlocation + '】不存在') this.fromLocationCode = fromlocation
} // this.showErrorMessage('' + fromlocation + '')
// }
}, },
onScan(result) { onScan(result) {
try { try {
@ -298,13 +299,39 @@
afterGetBalance(label, balance, packageInfo) { afterGetBalance(label, balance, packageInfo) {
let that = this;
try { try {
let that = this;
let itemCode = label.itemCode; let itemCode = label.itemCode;
let packingCode = label.packingNumber; let packingCode = label.packingNumber;
let lot = label.batch; let lot = label.batch;
let item = that.toLocation.Items.find(r => r.itemCode == itemCode); let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode); let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode);
// --
if(!fromLocation){
fromLocation = {
Batchs:[{
Recommends:[],
Records: [],
batch: label.batch,
detail:{
...packageInfo,
fromLocationCode: balance.locationCode,
toLocationCode:this.toLocationCode
},
handleQty: 0,
packingNumber: null,
// packingNumber: label.packingNumber,
qty: label.qty,
uom: label.uom
}],
toLocationCode:this.toLocationCode,
fromLocationCode: balance.locationCode,
handleQty: 0,
qty: label.qty,
uom: label.uom
}
item.Locations.push(fromLocation)
}
if (fromLocation != undefined) { if (fromLocation != undefined) {
let batch = fromLocation.Batchs.find(r => r.batch == lot); let batch = fromLocation.Batchs.find(r => r.batch == lot);
if (batch != undefined) { if (batch != undefined) {
@ -315,7 +342,7 @@
let record = batch.Records.find(r => r.packingNumber == packingCode); let record = batch.Records.find(r => r.packingNumber == packingCode);
if (record == undefined) { if (record == undefined) {
// //
if (batch.Recommends.length > 0) { if (batch.Recommends&&batch.Recommends.length > 0) {
let recommend = batch.Recommends.find(r => r.packingNumber == packingCode); let recommend = batch.Recommends.find(r => r.packingNumber == packingCode);
if (recommend != undefined) { if (recommend != undefined) {
that.addRecord(batch, label, balance, packageInfo) that.addRecord(batch, label, balance, packageInfo)

3
src/pages/fg/fgChange.vue

@ -71,7 +71,8 @@
</view> </view>
<win-com-scan-balance ref="scanPopup" @getBalance='getPackScanResult' :bussinessCode="bussinessCode" <win-com-scan-balance ref="scanPopup" @getBalance='getPackScanResult' :bussinessCode="bussinessCode"
:verifyCategory='true'> :verifyCategory='true'
:isCheckLocationBalance="false">
</win-com-scan-balance> </win-com-scan-balance>
<win-scan-fg-label ref="scanFgPopup" @getResult='getFgScanResult' title='灯码'></win-scan-fg-label> <win-scan-fg-label ref="scanFgPopup" @getResult='getFgScanResult' title='灯码'></win-scan-fg-label>

28
src/pages/fg/receiptByPlan.vue

@ -132,6 +132,7 @@
import { import {
Exception Exception
} from 'sass'; } from 'sass';
import { nextTick } from 'vue';
export default { export default {
components: { components: {
@ -217,6 +218,8 @@
this.showList = [] this.showList = []
this.loadingType = ""; this.loadingType = "";
this.showList = this.getDataPage(this.index, this.pageSize) this.showList = this.getDataPage(this.index, this.pageSize)
this.dataContent.handleQty = this.showList.length;
}, },
getDataPage(pageNo, pageSize) { getDataPage(pageNo, pageSize) {
@ -330,6 +333,8 @@
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 100,
} }
let isAllSubmit = Number(Number(this.dataContent.goodQty)+ Number(this.showList.length))==Number(this.dataContent.planQty)
var planeInfo = await getPlanByNumber(queryParams); var planeInfo = await getPlanByNumber(queryParams);
if (planeInfo.data && planeInfo.data.list.length > 0) { if (planeInfo.data && planeInfo.data.list.length > 0) {
@ -352,9 +357,22 @@
throw new Error("未查找到单据信息") throw new Error("未查找到单据信息")
} }
uni.hideLoading() uni.hideLoading()
this.showCommitSuccessMessage("提交成功<br>生成装配收货记录<br>" + list[0].requestNumber, list) if(isAllSubmit){
this.showList = []; this.clearData()
this.dataContent.handleQty = 0; }else{
this.showList = [];
this.allList = [];
this.index = 1;
this.dataContent.handleQty = 0;
}
nextTick(()=>{
this.showCommitSuccessMessage("提交成功<br>生成装配收货记录<br>" + list[0].requestNumber, list)
})
} catch (error) { } catch (error) {
uni.hideLoading() uni.hideLoading()
var hint = error.message ? error.message : error var hint = error.message ? error.message : error
@ -439,7 +457,9 @@
calcFgQty() { calcFgQty() {
this.dataContent.handleQty = this.showList.length; this.dataContent.handleQty = this.showList.length;
// this.dataContent.handleQty = this.allList.length; // this.dataContent.handleQty = this.allList.length;
if (this.dataContent.handleQty == this.dataContent.packQty) { // dataContent.noGoodQty
if (this.dataContent.handleQty == this.dataContent.packQty || (this.dataContent.noGoodQty<this.dataContent.packQty&&this.dataContent.handleQty == this.dataContent.noGoodQty)) {
if (this.$refs.scanPopup) { if (this.$refs.scanPopup) {
this.$refs.scanPopup.closeScanPopup(); this.$refs.scanPopup.closeScanPopup();
} }

7
src/pages/inventoryMove/coms/comMoveJob.vue

@ -111,6 +111,13 @@
methods: { methods: {
onReach() {
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList("more");
},
updateTitle() { updateTitle() {
var title = "" var title = ""
var name = this.title var name = this.title

8
src/pages/inventoryMove/coms/comMoveRecord.vue

@ -191,7 +191,7 @@
getBasicLocationByCode(this.toLocationCode).then(res => { getBasicLocationByCode(this.toLocationCode).then(res => {
if (res.data.total > 0) { if (res.data.total > 0) {
let result = res.data.list[0]; let result = res.data.list[0];
if(result.code!=this.toLocationCode){ if (result.code != this.toLocationCode) {
this.showErrorMessage('未查询到库位[' + this.toLocationCode + ']') this.showErrorMessage('未查询到库位[' + this.toLocationCode + ']')
return; return;
} }
@ -245,7 +245,11 @@
if (item == undefined) { if (item == undefined) {
var itemp = createItemInfo(balance, pack); var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); let newDetail = createDetailInfo(balance, pack);
//
if (newDetail.packingNumber == '') {
newDetail.packingNumber = pack.number;
}
if (this.businessTypeCode == "Move") { if (this.businessTypeCode == "Move") {
newDetail.toInventoryStatus = balance.inventoryStatus; newDetail.toInventoryStatus = balance.inventoryStatus;
} else { } else {

18
src/pages/inventoryMove/job/holdToOkMoveJob.vue

@ -16,11 +16,27 @@
title:'' title:''
} }
}, },
onLoad(option){ onLoad(option){
this.title = option.title this.title = option.title
}, },
onShow() {
if(this.$refs.comMoveJob){
this.$refs.comMoveJob.refresh();
}
},
onPullDownRefresh() { onPullDownRefresh() {
this.$refs.comMoveJob.refresh(); if(this.$refs.comMoveJob){
this.$refs.comMoveJob.refresh();
}
},
onReachBottom() {
if(this.$refs.comMoveJob){
this.$refs.comMoveJob.onReach();
}
}, },
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if (e.index === 0) { if (e.index === 0) {

16
src/pages/inventoryMove/job/holdToScrapMoveJob.vue

@ -19,8 +19,22 @@
onLoad(option){ onLoad(option){
this.title = option.title this.title = option.title
}, },
onShow() {
if(this.$refs.comMoveJob){
this.$refs.comMoveJob.refresh();
}
},
onPullDownRefresh() { onPullDownRefresh() {
this.$refs.comMoveJob.refresh(); if(this.$refs.comMoveJob){
this.$refs.comMoveJob.refresh();
}
},
onReachBottom() {
if(this.$refs.comMoveJob){
this.$refs.comMoveJob.onReach();
}
}, },
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if (e.index === 0) { if (e.index === 0) {

3
src/pages/inventoryMove/job/moveJob.vue

@ -24,6 +24,9 @@
this.title = option.title this.title = option.title
}, },
onReachBottom() {
this.$refs.comMoveJob.onReach();
},
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if (e.index === 0) { if (e.index === 0) {
this.$refs.comMoveJob.toHome(); this.$refs.comMoveJob.toHome();

15
src/pages/inventoryMove/job/nokToHoldMoveJob.vue

@ -18,10 +18,23 @@
onLoad(option){ onLoad(option){
this.title = option.title this.title = option.title
}, },
onShow() {
if(this.$refs.comMoveJob){
this.$refs.comMoveJob.refresh();
}
},
onPullDownRefresh() { onPullDownRefresh() {
this.$refs.comMoveJob.refresh(); if(this.$refs.comMoveJob){
this.$refs.comMoveJob.refresh();
}
}, },
onReachBottom() {
if(this.$refs.comMoveJob){
this.$refs.comMoveJob.onReach();
}
},
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if (e.index === 0) { if (e.index === 0) {
this.$refs.comMoveJob.toHome(); this.$refs.comMoveJob.toHome();

15
src/pages/inventoryMove/job/okToHoldMoveJob.vue

@ -18,10 +18,23 @@
onLoad(option){ onLoad(option){
this.title = option.title this.title = option.title
}, },
onShow() {
if(this.$refs.comMoveJob){
this.$refs.comMoveJob.refresh();
}
},
onPullDownRefresh() { onPullDownRefresh() {
this.$refs.comMoveJob.refresh(); if(this.$refs.comMoveJob){
this.$refs.comMoveJob.refresh();
}
}, },
onReachBottom() {
if(this.$refs.comMoveJob){
this.$refs.comMoveJob.onReach();
}
},
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if (e.index === 0) { if (e.index === 0) {
this.$refs.comMoveJob.toHome(); this.$refs.comMoveJob.toHome();

16
src/pages/inventoryMove/job/okToScrapMoveJob.vue

@ -19,8 +19,22 @@
onLoad(option){ onLoad(option){
this.title = option.title this.title = option.title
}, },
onShow() {
if(this.$refs.comMoveJob){
this.$refs.comMoveJob.refresh();
}
},
onPullDownRefresh() { onPullDownRefresh() {
this.$refs.comMoveJob.refresh(); if(this.$refs.comMoveJob){
this.$refs.comMoveJob.refresh();
}
},
onReachBottom() {
if(this.$refs.comMoveJob){
this.$refs.comMoveJob.onReach();
}
}, },
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if (e.index === 0) { if (e.index === 0) {

16
src/pages/inventoryMove/job/scrapToHoldMoveJob.vue

@ -19,8 +19,22 @@
onLoad(option){ onLoad(option){
this.title = option.title this.title = option.title
}, },
onShow() {
if(this.$refs.comMoveJob){
this.$refs.comMoveJob.refresh();
}
},
onPullDownRefresh() { onPullDownRefresh() {
this.$refs.comMoveJob.refresh(); if(this.$refs.comMoveJob){
this.$refs.comMoveJob.refresh();
}
},
onReachBottom() {
if(this.$refs.comMoveJob){
this.$refs.comMoveJob.onReach();
}
}, },
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if (e.index === 0) { if (e.index === 0) {

231
src/pages/issue/coms/comScanIssuePack.vue

@ -35,7 +35,7 @@
</view> --> </view> -->
<!-- <u-line class='line_color'></u-line> --> <!-- <u-line class='line_color'></u-line> -->
<view class="uni-flex uni-row" style="align-items: center; <!-- <view class="uni-flex uni-row" style="align-items: center;
background-color: #fff; background-color: #fff;
margin-left: 20rpx; margin-left: 20rpx;
margin-right: 20rpx; margin-right: 20rpx;
@ -49,7 +49,7 @@
placeholder="请选择库位" @confirm="fromLocationUpdate" placeholder="请选择库位" @confirm="fromLocationUpdate"
:inputStyle="inputStyleObject"></uni-combox> :inputStyle="inputStyleObject"></uni-combox>
</view> </view>
</view> </view> -->
<view class=""> <view class="">
<view class=""> <view class="">
@ -231,7 +231,7 @@
that.fromInventoryStatuses = this.jobContent.outInventoryStatuses that.fromInventoryStatuses = this.jobContent.outInventoryStatuses
that.toLocation = that.dataContent[0]; that.toLocation = that.dataContent[0];
that.toLocationCode = that.dataContent[0].toLocationCode; that.toLocationCode = that.dataContent[0].toLocationCode;
that.fromLocationList = that.getFromLocationList(); // that.fromLocationList = that.getFromLocationList();
} }
}, },
@ -239,23 +239,23 @@
this.$refs.balanceSelect.openPopup(items); this.$refs.balanceSelect.openPopup(items);
}, },
getFromLocationList() { // getFromLocationList() {
let list = []; // let list = [];
this.dataContent.forEach(location => { // this.dataContent.forEach(location => {
location.Items.forEach(item => { // location.Items.forEach(item => {
item.Locations.forEach(f => { // item.Locations.forEach(f => {
let item = list.find(l => l == f.fromLocationCode); // let item = list.find(l => l == f.fromLocationCode);
if (item == undefined) { // if (item == undefined) {
list.push(f.fromLocationCode) // list.push(f.fromLocationCode)
} // }
}) // })
}) // })
}); // });
// // //
list = uniqueArray(list); // list = uniqueArray(list);
this.fromLocationCode = list[0]; // this.fromLocationCode = list[0];
return list; // return list;
}, // },
fromLocationUpdate(fromlocation) { fromLocationUpdate(fromlocation) {
let location = this.fromLocationList.find(r => r == fromlocation) let location = this.fromLocationList.find(r => r == fromlocation)
@ -268,12 +268,12 @@
onScanResult(result) { onScanResult(result) {
try { try {
let that = this; let that = this;
if (that.fromLocationCode == '') { // if (that.fromLocationCode == '') {
that.showErrorMessage('请选择来源库位', res => { // that.showErrorMessage('', res => {
that.$refs.toLocationCombox.onFocus(); // that.$refs.toLocationCombox.onFocus();
}); // });
return; // return;
} // }
let packageInfo = result.package; let packageInfo = result.package;
let itemCode = result.label.itemCode; let itemCode = result.label.itemCode;
let packingCode = result.label.packingNumber; let packingCode = result.label.packingNumber;
@ -287,7 +287,7 @@
) )
return; return;
} else { } else {
var params = { var params = {
itemCode: result.package.itemCode, itemCode: result.package.itemCode,
batch: result.label.batch, batch: result.label.batch,
@ -318,9 +318,7 @@
if (result.label.packingNumber != result.balance.packingNumber) { if (result.label.packingNumber != result.balance.packingNumber) {
result.balance.handleQty = Number(result.label.qty) result.balance.handleQty = Number(result.label.qty)
} } else {
else
{
result.balance.handleQty = Number(result.balance.qty) result.balance.handleQty = Number(result.balance.qty)
} }
this.afterGetBalance(result.label, result.balance, result.package); this.afterGetBalance(result.label, result.balance, result.package);
@ -333,91 +331,6 @@
uni.hideLoading() uni.hideLoading()
this.showErrorMessage(error) this.showErrorMessage(error)
}) })
// this.getBalance(result.label, packageInfo, balances => {
// this.packageInfo = packageInfo;
// //
// let s = '';
// if (!result.package.parentNumber) {
// if (balances.list.length == 0) {
// this.showErrorMessage(',')
// } else {
// let newBalances = balances.list.filter(b => b.locationCode == that
// .fromLocationCode);
// if (newBalances.length == 0) {
// this.showErrorMessage(',')
// } else if (newBalances.length == 1) {
// let balance = newBalances[0];
// this.afterGetBalance(result.label, balance, packageInfo);
// } else {
// this.showBalanceSelect(newBalances);
// }
// }
// } else {
// //
// if (balances.list.length == 0) {
// this.showErrorMessage(',')
// } else {
// //
// let subPackitems = balances.list.filter(r => r.packingNumber == packageInfo
// .number)
// //
// let subParentPackitems = balances.list.filter(r => r.packingNumber ==
// packageInfo
// .parentNumber && r.locationCode == this.fromLocationCode)
// //
// if (subPackitems.length == 0) {
// //
// if (subParentPackitems.length > 0) {
// if (subParentPackitems.length == 1) {
// let balance = subParentPackitems[0];
// balance.qty = packageInfo.qty;
// this.afterGetBalance(result.label, balance, packageInfo);
// } else {
// this.showBalanceSelect(subParentPackitems);
// }
// } else {
// this.showErrorMessage('' + packageInfo.parentNumber + '' +
// packageInfo.number + '')
// }
// } else {
// var locationCode = this.fromLocationCode
// if (balances.list == 1) {
// locationCode = balances.list[0].locationCode
// } else {
// var manyBlances = balances.list.filter(r => r.locationCode != this
// .fromLocationCode)
// if (manyBlances.length > 0) {
// locationCode = manyBlances[0].locationCode;
// }
// }
// this.showErrorMessage('' + packageInfo.number + '' +
// locationCode +
// ',')
// // var locationCode = this.fromLocationCode
// // if(balances.list==1){
// // locationCode=balances.list[0].locationCode
// // }else {
// // var manyBlances = balances.list.filter(r=>r.locationCode!=this.fromLocationCode)
// // if(manyBlances.length>0){
// // locationCode = manyBlances[0].locationCode;
// // }
// // }
// // this.showErrorMessage('' + packageInfo.number + '' +
// // locationCode +
// // ',')
// }
// }
// }
// uni.hideLoading();
// });
} }
} catch (e) { } catch (e) {
this.showErrorMessage(e.stack) this.showErrorMessage(e.stack)
@ -502,62 +415,7 @@
} }
} }
}, },
onScanResult1(result) {
try {
let that = this;
if (that.fromLocationCode == '') {
that.showErrorMessage('请选择来源库位', res => {
that.$refs.toLocationCombox.onFocus();
});
return;
}
that.label = result.label;
that.packageInfo = result.package;
// let packageInfo = result.package;
let itemCode = result.label.itemCode;
let packingCode = result.label.packingNumber;
let lot = result.label.batch;
let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
if (item == undefined) {
that.showErrorMessage('未查找到物料【' + itemCode + '】的发料明细',
res => {
that.getfocus();
}
)
return;
} else {
//
uni.showLoading({
title: '加载中',
mask: true
})
getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses,
balanceRes => {
if (balanceRes.success) {
if (balanceRes.data.list.length == 0) {
this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],未查找到该包装的库存记录',
res => {
this.packGetFocus();
})
} else if (balanceRes.data.list.length == 1) {
let balance = balanceRes.data.list[0];
this.afterGetBalance(result.label, balance, that.packageInfo);
} else {
this.showBalanceSelect(balanceRes.data.list);
}
} else {
this.showErrorMessage(balanceRes.message.message);
}
uni.hideLoading();
});
}
} catch (e) {
this.showErrorMessage(e.stack)
uni.hideLoading();
}
},
selectBalanceItem(balance) { selectBalanceItem(balance) {
this.afterGetBalance(this.label, balance, this.packageInfo); this.afterGetBalance(this.label, balance, this.packageInfo);
}, },
@ -569,6 +427,7 @@
let packingCode = label.packingNumber; let packingCode = label.packingNumber;
let lot = label.batch; let lot = label.batch;
let item = that.toLocation.Items.find(r => r.itemCode == itemCode); let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
that.fromLocationCode = balance.locationCode;
let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode); let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode);
if (fromLocation != undefined) { if (fromLocation != undefined) {
let batch = fromLocation.Batchs.find(r => r.batch == lot); let batch = fromLocation.Batchs.find(r => r.batch == lot);
@ -580,7 +439,7 @@
let record = batch.Records.find(r => r.packingNumber == packingCode); let record = batch.Records.find(r => r.packingNumber == packingCode);
if (record == undefined) { if (record == undefined) {
// //
if ( batch.Recommends !=undefined && batch.Recommends.length > 0) { if (batch.Recommends != undefined && batch.Recommends.length > 0) {
let recommend = batch.Recommends.find(r => r.packingNumber == packingCode); let recommend = batch.Recommends.find(r => r.packingNumber == packingCode);
if (recommend != undefined) { if (recommend != undefined) {
that.addRecord(batch, label, balance, packageInfo) that.addRecord(batch, label, balance, packageInfo)
@ -631,11 +490,8 @@
} }
} }
} else { } else {
that.showErrorMessage('未查找到推荐库位【' + that.fromLocationCode + '】的发料明细', let locaion = that.createLocationInfo(label, balance, packageInfo);
res => { item.Locations.push(locaion);
that.getfocus();
}
)
} }
} catch (e) { } catch (e) {
that.showErrorMessage(e.stack, that.showErrorMessage(e.stack,
@ -646,6 +502,23 @@
} }
}, },
//
createLocationInfo(label, balance, packageInfo) {
let location = {
fromLocationCode: balance.locationCode,
qty: balance.qty,
uom: balance.uom,
handleQty: 0,
Batchs: []
}
let batch = this.createBatchInfo(label, balance, packageInfo);
batch.detail = balance;
batch.detail.fromLocationCode=balance.locationCode;
location.Batchs.push(batch);
return location;
},
createBatchInfo(data, balance, packageInfo) { createBatchInfo(data, balance, packageInfo) {
let batch = { let batch = {
batch: data.batch, batch: data.batch,
@ -672,7 +545,7 @@
// qty: Number(balance.qty), // qty: Number(balance.qty),
// qty: Number(label.qty) > Number(balance.qty) ? Number(balance.qty) : Number(label.qty), // qty: Number(label.qty) > Number(balance.qty) ? Number(balance.qty) : Number(label.qty),
qty: balance.handleQty, qty: balance.handleQty,
handleQty:balance.handleQty, handleQty: balance.handleQty,
uom: balance.uom, uom: balance.uom,
inventoryStatus: balance.inventoryStatus, inventoryStatus: balance.inventoryStatus,
balance: balance, balance: balance,
@ -681,7 +554,7 @@
packUnit: packageInfo.packUnit, packUnit: packageInfo.packUnit,
packQty: packageInfo.packQty packQty: packageInfo.packQty
} }
return record; return record;
}, },

10
src/pages/issue/job/issueDetail.vue

@ -272,7 +272,7 @@
// }) // })
// }, // },
submit() { submit() {
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
@ -346,8 +346,12 @@
.ContainerNumber; .ContainerNumber;
record.toInventoryStatus = r record.toInventoryStatus = r
.inventoryStatus; .inventoryStatus;
record.toLocationCode = subItem // record.toLocationCode = subItem
.toLocationCode; // .toLocationCode;
record.toLocationCode = this.jobContent
.detailToLocationCode;
record.supplierCode = r.supplierCode; record.supplierCode = r.supplierCode;
let single_price = r.balance let single_price = r.balance

140
src/pages/issue/job/issueJob.vue

@ -2,9 +2,13 @@
<view class=""> <view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view> <com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter :isShowFromLocationCode="true" :isShowProductionLineCode="true" :productionline="productionlineList" <job-filter :isShowFromLocationCode="true" :isShowProductionLineCode="true" :productionline="productionlineList"
ref="filter" otherTitle="" @switchChangeToday="switchChangeToday" @switchChangeWait="switchChangeWait" ref="filter" otherTitle="" :checkedToday="checkedToday" :checkedWaitTask="checkedWaitTask"
@onScanNumber="getScanNumber" :checkedToday="checkedToday" :checkedWaitTask="checkedWaitTask" :isShowItemCode="true" @onQuery="getListByFilter" :isShowQurery='true'>
@productionLineCode="productionLineCode" @fromLocationCode="fromLocationCode"> <!-- <job-filter :isShowFromLocationCode="true" :isShowProductionLineCode="true"
:productionline="productionlineList" ref="filter" otherTitle="" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask" @productionLineCode="productionLineCode"
@fromLocationCode="fromLocationCode"> -->
</job-filter> </job-filter>
<view v-if="jobList.length>0"> <view v-if="jobList.length>0">
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
@ -95,7 +99,8 @@
detailCloseOptions: [], detailCloseOptions: [],
title: '', title: '',
productionLine: "", productionLine: "",
fromLocation: "", fromLocation: "",
filterItemCode: "",
businessTypeCode: "Issue", businessTypeCode: "Issue",
businessType: null, businessType: null,
}; };
@ -105,7 +110,8 @@
this.getIssueJobByProductionline() this.getIssueJobByProductionline()
}, },
onShow() { onShow() {
this.getList('refresh', this.fromLocation, this.productionLine); this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode)
}, },
onReady() { onReady() {
@ -118,12 +124,13 @@
if (this.loadingType == 'loading' || this.loadingType == 'nomore') { if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return; return;
} }
this.getList('more', this.fromLocation, this.productionLine) this.getList('more', this.fromLocation, this.productionLine, this.filterItemCode)
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.getList('refresh', this.fromLocation, this.productionLine) this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode)
}, },
//退 //退
@ -175,7 +182,8 @@
} }
}) })
}, },
getList(type, fromLocation = '', productionLine = '') {
getList(type, fromLocation = '', productionLine = '',filterItemCode='') {
let that = this; let that = this;
uni.showLoading({ uni.showLoading({
title: "加载中­....", title: "加载中­....",
@ -223,14 +231,19 @@
action: "==", action: "==",
value: productionLine value: productionLine
}) })
}
if(filterItemCode){
//
filters.push({
column: "itemCode",
action: "like",
value: filterItemCode
})
} }
var params = { var params = {
filters: filters, filters: filters,
pageNo: this.pageNo, pageNo: this.pageNo,
pageSize: this.pageSize, pageSize: 100,
sort: 'fromLocationCode',
by: 'asc'
} }
getIssueJobList(params).then(res => { getIssueJobList(params).then(res => {
uni.hideLoading(); uni.hideLoading();
@ -261,13 +274,99 @@
that.showMessage(error) that.showMessage(error)
}) })
}, },
getListByFilter(params) {
console.log('getListByFilter',params)
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
var filters = []
if (this.checkedToday) {
filters.push({
column: "create_time",
action: "betweeen",
value: this.todayTime
})
}
filters.push({
column: "status",
action: "in",
value: this.status
})
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
if (params.fromLocationCode) {
//
this.fromLocation = params.fromLocationCode
filters.push({
column: "fromLocationCode",
action: "==",
value: params.fromLocationCode
})
}else{
this.fromLocation = ''
}
if (params.productionLineCode) {
// 线
this.productionLine = params.productionLineCode
filters.push({
column: "productionLineCode",
action: "==",
value: params.productionLineCode
})
}else{
this.productionLine = ''
}
if (params.itemCode) {
//
this.filterItemCode = params.itemCode
filters.push({
column: "itemCode",
action: "like",
value: params.itemCode
})
}else{
this.filterItemCode = ''
}
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode)
// getIssueJobList(params).then(res => {
// uni.hideLoading();
// if (res.data.total == 0) {
// that.showMessage('');
// } else if (res.data.total == 1) {
// that.openJobDetail(res.data.list[0]);
// } else {
// that.showItemList(res.data.list);
// }
// }).catch(error => {
// that.showMessage(error)
// })
},
fromLocationCode(fromLocation) { fromLocationCode(fromLocation) {
this.fromLocation = fromLocation; this.fromLocation = fromLocation;
this.getList('refresh', this.fromLocation, this.productionLine) this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode)
}, },
productionLineCode(productionLineCode) { productionLineCode(productionLineCode) {
this.productionLine = productionLineCode this.productionLine = productionLineCode
this.getList('refresh', this.fromLocation, this.productionLine) this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode)
}, },
getByAsnNumber(code) { getByAsnNumber(code) {
let that = this; let that = this;
@ -303,7 +402,7 @@
}, },
showItemList(itemList) { showItemList(itemList) {
this.$refs.scanList.openPopup(itemList); this.$refs.jobListPopup.openPopup(itemList);
}, },
selectedItem(item) { selectedItem(item) {
@ -342,7 +441,8 @@
cancleJob(id) { cancleJob(id) {
cancleTakeIssueJob(id).then(res => { cancleTakeIssueJob(id).then(res => {
if (res.data) { if (res.data) {
this.getList("refresh", this.fromLocation, this.productionLine) this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode)
uni.showToast({ uni.showToast({
title: "放弃任务成功" title: "放弃任务成功"
}) })
@ -378,13 +478,14 @@
switchChangeToday(state, creationTime) { switchChangeToday(state, creationTime) {
this.checkedToday = state; this.checkedToday = state;
this.todayTime = creationTime; this.todayTime = creationTime;
this.getList("refresh", this.fromLocation, this.productionLine); this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode)
}, },
switchChangeWait(state, jobStatus) { switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state; this.checkedWaitTask = state;
this.status = jobStatus; this.status = jobStatus;
this.getList("refresh", this.fromLocation, this.productionLine); this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode)
}, },
getScanNumber(code) { getScanNumber(code) {
@ -510,7 +611,8 @@
} }
} else { } else {
this.showMessage("按来源库位[" + balance.locationCode + "]批次[" + result.label.batch + this.showMessage("按来源库位[" + balance.locationCode + "]批次[" + result.label.batch +
"]物料号[" + result.label.itemCode + "]未查找到任务<br>" + "扫描[" + result.scanMessage + "]") "]物料号[" + result.label.itemCode + "]未查找到任务<br>" + "扫描[" + result
.scanMessage + "]")
} }
}).catch(error => { }).catch(error => {
this.showMessage(error + "<br>扫描[" + result.scanMessage + "]") this.showMessage(error + "<br>扫描[" + result.scanMessage + "]")

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

@ -1,7 +1,7 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<view class=""> <view class="">
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view> <com-blank-view @goScan='getBusinessType' v-if="detailSource.length==0"></com-blank-view>
</view> </view>
<view class="page-wraper" v-if="detailSource.length>0"> <view class="page-wraper" v-if="detailSource.length>0">
<view class="page-header"> <view class="page-header">
@ -16,7 +16,9 @@
<view class=""> <view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" <record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowFromLocation="false" @removeItem="removeItem(index,item)" :isShowFromLocation="false" @removeItem="removeItem(index,item)"
:isShowToLocation="false" @updateData="updateData" @removePack="removePack"> :isShowToLocation="false"
:isShowParentToLocation="false"
@updateData="updateData" @removePack="removePack">
</record-com-detail-card> </record-com-detail-card>
</view> </view>
@ -43,13 +45,10 @@
</view> </view>
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
</view> </view>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :allowModifyLocation='false'
:queryBalance="false"> <winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode">
</win-scan-pack-and-location> </winComScanBalance>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location>
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select>
</view> </view>
</template> </template>
@ -98,6 +97,7 @@
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
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'
export default { export default {
components: { components: {
@ -109,7 +109,8 @@
winScanPackAndLocation, winScanPackAndLocation,
recordComDetailCard, recordComDetailCard,
recordDetailCard, recordDetailCard,
balanceSelect balanceSelect,
winComScanBalance
}, },
data() { data() {
return { return {
@ -130,24 +131,16 @@
positionList: [], positionList: [],
show: false, show: false,
positionInfo: "请选择生产线", positionInfo: "请选择生产线",
resultData: {} resultData: {},
itemCode:""
}; };
}, },
onLoad(option) { onLoad(option) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: option.title title: option.title
}) })
this.clearData(); this.clearData();
getBusinessType(this.businessTypeCode, res => { this.getBusinessType()
if (res.success) {
this.businessType = res.businessType;
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList;
this.toLocationAreaTypeList = res.toLocationAreaTypeList;
this.showFromLocationPopup();
} else {
this.showErrorMessage(res.message)
}
});
// if (this.positionList.length == 0) { // if (this.positionList.length == 0) {
getWorkShopLineStation().then(res => { getWorkShopLineStation().then(res => {
@ -177,217 +170,65 @@
mounted() {}, mounted() {},
methods: { methods: {
getBalance(label, packageInfo, callback) {
var filters = [] getBusinessType() {
getBusinessType(this.businessTypeCode, res => {
if (packageInfo.parentNumber) { if (res.success) {
var packingNumber = packageInfo.parentNumber + "," + label.packingNumber; this.businessType = res.businessType;
filters.push({ this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses);
column: "packingNumber", this.fromLocationAreaTypeList = res.fromLocationAreaTypeList
action: "in", this.openScanPopup();
value: packingNumber
})
} else {
filters.push({
column: "packingNumber",
action: "==",
value: label.packingNumber
})
}
filters.push({
column: "itemCode",
action: "==",
value: label.itemCode
})
filters.push({
column: "batch",
action: "==",
value: label.batch
})
if (this.fromInventoryStatuses != null && this.fromInventoryStatuses != "") {
filters.push({
column: "inventoryStatus",
action: "in",
value: this.fromInventoryStatuses
})
}
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getBalanceByFilter(params).then(res => {
callback(res.data)
}).catch(err => {
this.showErrorMessage(err.message);
})
},
getScanResult(result) {
this.resultData = result;
let packageInfo = result.package;
this.getBalance(result.label, packageInfo, balances => {
//
let s = '';
if (!result.package.parentNumber) {
if (balances.list.length == 0) {
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else {
let newBalances = balances.list.filter(b => b.locationCode == this
.fromLocationCode);
if (newBalances.length == 0) {
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else if (newBalances.length == 1) {
let balance = newBalances[0];
result.balance = balance;
this.afterGetBalance(result);
} else {
this.showBalanceSelect(newBalances);
}
}
} else { } else {
// this.showErrorMessage(res.message)
if (balances.list.length == 0) {
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else {
//
let subPackitems = balances.list.filter(r => r.packingNumber == packageInfo
.number)
//
let subParentPackitems = balances.list.filter(r => r.packingNumber ==
packageInfo
.parentNumber && r.locationCode == this.fromLocationCode)
//
if (subPackitems.length == 0) {
//
if (subParentPackitems.length > 0) {
if (subParentPackitems.length == 1) {
let balance = subParentPackitems[0];
balance.qty = packageInfo.qty;
result.balance = balance;
this.afterGetBalance(result);
} else {
this.showBalanceSelect(subParentPackitems);
}
} else {
this.showErrorMessage('按外包装【' + packageInfo.parentNumber + '】和子包装【' +
packageInfo.number + '】都未查找到库存余额')
}
} else {
var locationCode = this.fromLocationCode
if (balances.list == 1) {
locationCode = balances.list[0].locationCode
} else {
var manyBlances = balances.list.filter(r => r.locationCode != this
.fromLocationCode)
if (manyBlances.length > 0) {
locationCode = manyBlances[0].locationCode;
}
}
this.showErrorMessage('该包装【' + packageInfo.number + '】在库位【' +
locationCode +
'】已经有库存余额,请重新扫描')
}
}
} }
}) });
},
showBalanceSelect(items) {
this.$refs.balanceSelect.openPopup(items);
}, },
selectBalanceItem(balance) { getScanResult(result) {
this.resultData.balance =balance; this.setData(result);
this.afterGetBalance(this.resultData);
}, },
setData(result) {
afterGetBalance(result){
let balance = result.balance; let balance = result.balance;
let label = result.label; let label = result.label;
let pack = result.package; let pack = result.package;
let packUnit = pack.packUnit;
let packQty =pack.packQty
var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) {
return res
}
})
if (this.fromWarehouseCode == '') {
this.fromWarehouseCode = balance.warehouseCode;
}
if (item == undefined) {
var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
newDetail.parentNumber =pack.parentNumber;
newDetail.packingNumber =pack.number
newDetail.packUnit =packUnit;
newDetail.packQty=packQty;
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
calcHandleQty(this.detailSource);
} else {
var detail = item.subList.find(r => { if (this.fromLocationCode && this.fromLocationCode != balance.locationCode) {
if (r.packingNumber == pack.number && this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]在库位[" + this
r.batch == balance.batch && .fromLocationCode + "]没有库存余额")
r.locationCode == balance.locationCode && return;
r.inventoryStatus == balance.inventoryStatus) {
return r;
}
})
if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack);
newDetail.parentNumber =pack.parentNumber;
newDetail.packingNumber =pack.number
newDetail.packUnit =packUnit;
newDetail.packQty=packQty;
item.subList.push(newDetail);
calcHandleQty(this.detailSource);
} else {
if (detail.scaned == true) {
this.showErrorMessage("箱码[" + detail.packingNumber + "]批次[" + balance.batch + "]已经在列表中")
}
}
} }
},
getScanResult1(result) {
let balance = result.balance;
let label = result.label;
let pack = result.package;
let packUnit = pack.packUnit;
let packQty = pack.packQty
var item = this.detailSource.find(res => { var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) { if (res.itemCode == balance.itemCode) {
return res return res
} }
}) })
if (this.fromWarehouseCode == '') {
this.fromWarehouseCode = balance.warehouseCode;
}
if (item == undefined) { if (item == undefined) {
if (this.itemCode != "" && this.itemCode != balance.itemCode) {
this.showErrorMessage("请扫描物料为【" + this.itemCode + "】的箱码")
return;
}
if (this.fromWarehouseCode == '') {
this.fromWarehouseCode = balance.warehouseCode;
}
var itemp = createItemInfo(balance, pack); var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); // let newDetail = createDetailInfo(balance, pack); //
newDetail.packUnit = packUnit; newDetail.parentNumber = pack.parentNumber;
newDetail.packQty = packQty; newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
this.detailSource.push(itemp) this.detailSource.push(itemp)
calcHandleQty(this.detailSource); this.itemCode = balance.itemCode;
this.fromLocationCode = balance.locationCode
this.scanPopupGetFocus()
} else { } else {
var detail = item.subList.find(r => { var detail = item.subList.find(r => {
if (r.packingNumber == balance.packingNumber && if (r.packingNumber == pack.number &&
r.batch == balance.batch && r.batch == balance.batch &&
r.locationCode == balance.locationCode && r.locationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) { r.inventoryStatus == balance.inventoryStatus) {
@ -396,50 +237,22 @@
}) })
if (detail == undefined) { if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack); let newDetail = createDetailInfo(balance, pack);
newDetail.packUnit = packUnit; newDetail.parentNumber = pack.parentNumber;
newDetail.packQty = packQty; newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
item.subList.push(newDetail); item.subList.push(newDetail);
calcHandleQty(this.detailSource); this.scanPopupGetFocus()
} else { } else {
if (detail.scaned == true) { if (detail.scaned == true) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中") this.showErrorMessage("箱码[" + detail.packingNumber + "批次[" + balance.batch + "]已经在列表中")
} }
} }
} }
}, calcHandleQty(this.detailSource);
//
getRecommendLocation(balance, pack, callback) {
uni.showLoading({
title: '扫描中...',
mask: true
})
let recommend = this.recommendLocationList.find(r => r.itemCode == balance.itemCode);
if (recommend == undefined) {
let param = {
itemCode: balance.itemCode,
batch: balance.batch,
inventoryStatus: balance.inventoryStatus,
supplierCode: pack.supplierCode,
businessCode: this.businessTypeCode
};
console.log(JSON.stringify(param))
getPutawayRecommendLocation(param).then(res => {
this.recommendLocationList.push({
itemCode: balance.itemCode,
locationCode: res.data.code
})
callback(res.data);
uni.hideLoading();
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error);
uni.hideLoading();
})
} else {
callback(recommend);
}
}, },
showErrorMessage(message) { showErrorMessage(message) {
@ -532,11 +345,11 @@
}, },
openScanPopup() { openScanPopup() {
if (this.fromLocationCode == "") { if (this.businessType) {
this.showFromLocationPopup(); this.$refs.scanPopup.openScanPopup(this.businessType);
return } else {
this.getBusinessType()
} }
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType);
}, },
showFromLocationPopup() { showFromLocationPopup() {
@ -675,16 +488,6 @@
this.fromLocationCode = code; this.fromLocationCode = code;
this.openScanPopup(); this.openScanPopup();
}, },
getToLocationCode(location, code) {
if (this.fromLocationCode == code) {
uni.showToast({
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致",
duration: 2000
})
return
}
this.toLocationCode = code;
},
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
@ -710,7 +513,8 @@
this.fromWarehouseCode = ''; this.fromWarehouseCode = '';
this.toWarehouseCode = ''; this.toWarehouseCode = '';
this.detailSource = []; this.detailSource = [];
this.positionInfo= "请选择生产线"; this.positionInfo = "请选择生产线";
this.itemCode=""
} }
} }
} }

719
src/pages/issue/record/directIssue2.vue

@ -0,0 +1,719 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view>
</view>
<view class="page-wraper" v-if="detailSource.length>0">
<view class="page-header">
<view class="header_item">
来源库位 : {{fromLocationCode}}
</view>
<view class='split_line'></view>
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowFromLocation="false" @removeItem="removeItem(index,item)"
:isShowToLocation="false" @updateData="updateData" @removePack="removePack">
</record-com-detail-card>
</view>
</view>
</scroll-view>
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="uni-row uni-flex">
<text>生产线:</text>
<view class="uni-flex u-col-center uni-row" @click="showSelect">
<view class="" style="margin-left: 20rpx;">
{{positionInfo}}
</view>
<u-select v-model="show" mode="mutil-column-auto" :list="positionList"
@confirm="confirmSelect"></u-select>
</view>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :allowModifyLocation='false'
:queryBalance="false">
</win-scan-pack-and-location>
<comMessage ref="comMessage"></comMessage>
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location>
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select>
</view>
</template>
<script>
import {
issueRecordSubmit,
getWorkShopLineStation,
getBalanceByFilter
} from '@/api/request2.js';
import {
goHome,
getPackingNumberAndBatchByList,
deepCopyData
} from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
import {
getInventoryStatusDesc,
getDirectoryItemArray
} from '@/common/directory.js';
import {
getBusinessType,
createItemInfo,
createDetailInfo,
calcTreeHandleQty,
calcHandleQty
} from '@/common/record.js';
import {
getManagementPrecisions,
getPrecisionStrategyList,
getPrecisionStrategyParams
} from '@/common/balance.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
export default {
components: {
winScanButton,
winScanPack,
requiredLocation,
comBlankView,
winScanLocation,
winScanPackAndLocation,
recordComDetailCard,
recordDetailCard,
balanceSelect
},
data() {
return {
id: '',
dataContent: {}, //
detailSource: [], //
fromLocationInfo: {},
fromLocationCode: "",
fromLocationAreaTypeList: [],
toLocationAreaTypeList: [],
inInventoryStatus: "", //
outInventoryStatus: "", //
businessType: {},
showToLoaction: true,
recommendLocationList: [], //
fromWarehouseCode: '', //
businessTypeCode: "Issue",
positionList: [],
show: false,
positionInfo: "请选择生产线",
resultData: {}
};
},
onLoad(option) {
uni.setNavigationBarTitle({
title: option.title
})
this.clearData();
getBusinessType(this.businessTypeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList;
this.toLocationAreaTypeList = res.toLocationAreaTypeList;
this.showFromLocationPopup();
} else {
this.showErrorMessage(res.message)
}
});
// if (this.positionList.length == 0) {
getWorkShopLineStation().then(res => {
if (res.data != null && res.data.length > 0) {
this.positionList = res.data
} else {
this.showErrorMessage('未查找到位置信息');
}
}).catch(error => {
this.showErrorMessage(error);
})
// }
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
//
onBackPress(e) {},
onPullDownRefresh() {},
mounted() {},
methods: {
getBalance(label, packageInfo, callback) {
var filters = []
if (packageInfo.parentNumber) {
var packingNumber = packageInfo.parentNumber + "," + label.packingNumber;
filters.push({
column: "packingNumber",
action: "in",
value: packingNumber
})
} else {
filters.push({
column: "packingNumber",
action: "==",
value: label.packingNumber
})
}
filters.push({
column: "itemCode",
action: "==",
value: label.itemCode
})
filters.push({
column: "batch",
action: "==",
value: label.batch
})
if (this.fromInventoryStatuses != null && this.fromInventoryStatuses != "") {
filters.push({
column: "inventoryStatus",
action: "in",
value: this.fromInventoryStatuses
})
}
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getBalanceByFilter(params).then(res => {
callback(res.data)
}).catch(err => {
this.showErrorMessage(err.message);
})
},
getScanResult(result) {
this.resultData = result;
let packageInfo = result.package;
this.getBalance(result.label, packageInfo, balances => {
//
let s = '';
if (!result.package.parentNumber) {
if (balances.list.length == 0) {
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else {
let newBalances = balances.list.filter(b => b.locationCode == this
.fromLocationCode);
if (newBalances.length == 0) {
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else if (newBalances.length == 1) {
let balance = newBalances[0];
result.balance = balance;
this.afterGetBalance(result);
} else {
this.showBalanceSelect(newBalances);
}
}
} else {
//
if (balances.list.length == 0) {
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else {
//
let subPackitems = balances.list.filter(r => r.packingNumber == packageInfo
.number)
//
let subParentPackitems = balances.list.filter(r => r.packingNumber ==
packageInfo
.parentNumber && r.locationCode == this.fromLocationCode)
//
if (subPackitems.length == 0) {
//
if (subParentPackitems.length > 0) {
if (subParentPackitems.length == 1) {
let balance = subParentPackitems[0];
balance.qty = packageInfo.qty;
result.balance = balance;
this.afterGetBalance(result);
} else {
this.showBalanceSelect(subParentPackitems);
}
} else {
this.showErrorMessage('按外包装【' + packageInfo.parentNumber + '】和子包装【' +
packageInfo.number + '】都未查找到库存余额')
}
} else {
var locationCode = this.fromLocationCode
if (balances.list == 1) {
locationCode = balances.list[0].locationCode
} else {
var manyBlances = balances.list.filter(r => r.locationCode != this
.fromLocationCode)
if (manyBlances.length > 0) {
locationCode = manyBlances[0].locationCode;
this.showErrorMessage('该包装【' + packageInfo.number + '】在库位【' +
locationCode +
'】已经有库存余额,请重新扫描')
} else {
this.afterGetBalance(result);
}
}
}
}
}
})
},
showBalanceSelect(items) {
this.$refs.balanceSelect.openPopup(items);
},
selectBalanceItem(balance) {
this.resultData.balance = balance;
this.afterGetBalance(this.resultData);
},
afterGetBalance(result) {
let balance = result.balance;
let label = result.label;
let pack = result.package;
let packUnit = pack.packUnit;
let packQty = pack.packQty
var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) {
return res
}
})
if (this.fromWarehouseCode == '') {
this.fromWarehouseCode = balance.warehouseCode;
}
if (item == undefined) {
var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = packUnit;
newDetail.packQty = packQty;
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
calcHandleQty(this.detailSource);
} else {
var detail = item.subList.find(r => {
if (r.packingNumber == pack.number &&
r.batch == balance.batch &&
r.locationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) {
return r;
}
})
if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack);
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = packUnit;
newDetail.packQty = packQty;
item.subList.push(newDetail);
calcHandleQty(this.detailSource);
} else {
if (detail.scaned == true) {
this.showErrorMessage("箱码[" + detail.packingNumber + "]批次[" + balance.batch + "]已经在列表中")
}
}
}
},
getScanResult1(result) {
let balance = result.balance;
let label = result.label;
let pack = result.package;
let packUnit = pack.packUnit;
let packQty = pack.packQty
var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) {
return res
}
})
if (this.fromWarehouseCode == '') {
this.fromWarehouseCode = balance.warehouseCode;
}
if (item == undefined) {
var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
newDetail.packUnit = packUnit;
newDetail.packQty = packQty;
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
calcHandleQty(this.detailSource);
} else {
var detail = item.subList.find(r => {
if (r.packingNumber == balance.packingNumber &&
r.batch == balance.batch &&
r.locationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) {
return r;
}
})
if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack);
newDetail.packUnit = packUnit;
newDetail.packQty = packQty;
item.subList.push(newDetail);
calcHandleQty(this.detailSource);
} else {
if (detail.scaned == true) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中")
}
}
}
},
//
getRecommendLocation(balance, pack, callback) {
uni.showLoading({
title: '扫描中...',
mask: true
})
let recommend = this.recommendLocationList.find(r => r.itemCode == balance.itemCode);
if (recommend == undefined) {
let param = {
itemCode: balance.itemCode,
batch: balance.batch,
inventoryStatus: balance.inventoryStatus,
supplierCode: pack.supplierCode,
businessCode: this.businessTypeCode
};
console.log(JSON.stringify(param))
getPutawayRecommendLocation(param).then(res => {
this.recommendLocationList.push({
itemCode: balance.itemCode,
locationCode: res.data.code
})
callback(res.data);
uni.hideLoading();
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error);
uni.hideLoading();
})
} else {
callback(recommend);
}
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {}
});
},
calcTreeHandleQty() {
for (let item of this.detailSource) {
item.qty = 0;
for (let detail of item.subList) {
if (detail != undefined) {
item.qty = calc.add(item.qty, detail.qty)
}
}
}
this.$forceUpdate();
},
showSelect() {
// if (this.editPosition) {
this.show = true
// }
},
confirmSelect(e) {
this.positionInfo = e[0].label + "-" + e[1].label + "-" + e[2].label
console.log("位置", this.positionInfo)
this.workshopCode = e[0].value
this.productionLineCode = e[1].value
this.workStationCode = e[2].value
this.workShopName = e[0].label
this.productionLineName = e[1].label
this.workStationName = e[2].label
let shop = this.positionList.find(shop => shop.value == this.workshopCode);
if (shop != undefined && shop.children != undefined) {
let prodLine = shop.children.find(line => line.value == this.productionLineCode);
if (prodLine != undefined && prodLine.children != undefined) {
let station = prodLine.children.find(r => r.value == this.workStationCode);
if (station.rawLocationCode == '' && station.rawLocationCode == null) {
this.showErrorMessage(this.workStationName + "的原材料库位为空,请重新选择")
return;
} else {
this.rawLocationCode = station.rawLocationCode;
this.fgLocationCode = station.fgLocationCode;
}
} else {
this.showErrorMessage("生产线-工位基础信息维护错误")
}
} else {
this.showErrorMessage("车间-生产线基础信息维护错误")
}
//
let toLocationCode = ''
this.positionList.forEach(item => {
if (this.workshopCode == item.value) { //
item.children.find(child => {
if (this.productionLineCode == child.value) {
toLocationCode = child.children.find(subChild => this.workStationCode ==
subChild.value).rawLocationCode;
}
})
}
})
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = toLocationCode
detail.productionLineCode = this.productionLineCode
detail.workStationCode = this.workStationCode
})
})
},
removeItem(index, item) {
this.detailSource.splice(index, 1)
},
removePack() {
for (var i = 0; i < this.detailSource.length; i++) {
var item = this.detailSource[i];
if (item.subList.length == 0) {
this.detailSource.splice(i, 1)
}
}
this.updateData();
},
openScanPopup() {
if (this.fromLocationCode == "") {
this.showFromLocationPopup();
return
}
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType);
},
showFromLocationPopup() {
this.$nextTick(() => {
this.$refs.scanLocationCode.openScanPopup();
})
},
closeScanPopup() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.closeScanPopup();
}
},
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus();
}
},
// scanLocationCode(location, code) {
// this.toLocationCode = code
// this.toLocationCode = location;
// },
commit() {
uni.showLoading({
title: "提交中....",
mask: true
});
//
let precisionStrategyParams = getPrecisionStrategyParams(this.detailSource);
//2:
getPrecisionStrategyList(precisionStrategyParams, res => {
if (res.success) {
this.managementList = res.list;
var params = {
...this.setRecordParams()
}
console.log("提交参数", JSON.stringify(params));
issueRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成直接发料记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
});
},
setRecordParams() {
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
detail.packingNumber, detail.toLocationCode, detail.batch);
var submitItem = deepCopyData(detail)
submitItem.toPackingNumber = info.packingNumber;
submitItem.toBatch = info.batch;
submitItem.toContainerNumber = detail.containerNumber;
submitItem.fromPackingNumber = info.packingNumber;
submitItem.fromBatch = info.batch;
submitItem.fromContainerNumber = detail.containerNumber;
submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode;
// detail.toInventoryStatus = detail.inventoryStatus
// detail.toLocationCode = detail.toLocationCode
submitItem.qty = detail.handleQty;
submitItem.package = "";
submitItem.recordList = [{
toInventoryStatus: detail.inventoryStatus,
fromParentPackingNumber: detail.parentNumber,
fromPackingNumber: info.packingNumber,
fromBatch: info.batch,
toPackingNumber: info.packingNumber,
toBatch: info.batch,
fromLocationCode: detail.locationCode,
toLocationCode: detail.toLocationCode,
handleQty: detail.handleQty,
fromPackUnit: detail.packUnit,
toPackUnit: detail.packUnit,
fromPackQty: detail.packQty,
toPackQty: detail.packQty
}]
subList.push(submitItem)
}
})
})
if (subList.length > 0) {
this.dataContent.toWarehouseCode = subList[0].toWarehouseCode;
}
this.dataContent.subList = subList
this.dataContent.creator = creator;
this.dataContent.fromWarehouseCode = this.fromWarehouseCode;
return this.dataContent;
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {}
});
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
closeScanMessage() {
this.scanPopupGetFocus();
},
getLocation(location, code) {
this.getFromLocationCode(location, code)
},
getFromLocationCode(location, code) {
this.fromLocationInfo = location;
this.fromLocationCode = code;
this.openScanPopup();
},
getToLocationCode(location, code) {
if (this.fromLocationCode == code) {
uni.showToast({
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致",
duration: 2000
})
return
}
this.toLocationCode = code;
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.clearData();
})
},
updateData() {
calcHandleQty(this.detailSource);
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
if (item.qty == 0) {
this.detailSource.splice(i, 1)
}
}
this.$forceUpdate();
},
clearData() {
this.fromLocationInfo = {};
this.fromLocationCode = '';
this.fromWarehouseCode = '';
this.toWarehouseCode = '';
this.detailSource = [];
this.positionInfo = "请选择生产线";
}
}
}
</script>
<style scoped lang="scss">
</style>

6
src/pages/package/record/overPackageRecord.vue

@ -63,7 +63,11 @@
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
</view> </view>
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' bussinessCode="OverPackage"> <winComScanBalance ref="scanPopup"
@getBalance='getScanResult'
bussinessCode="OverPackage"
:isCheckLocationBalance="false"
>
</winComScanBalance> </winComScanBalance>

5
src/pages/package/record/splitPackageRecord.vue

@ -38,7 +38,10 @@
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
</view> </view>
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="typeCode"> <winComScanBalance ref="scanPopup"
@getBalance='getScanResult'
:isCheckLocationBalance="false"
:bussinessCode="typeCode">
</winComScanBalance> </winComScanBalance>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>

6
src/pages/point/index.vue

@ -199,7 +199,8 @@
}, 1000) }, 1000)
} else { } else {
var url = this.picUrl[index] let i = this.picUrl.length - 1 - index
var url = this.picUrl[i]
// #ifdef APP // #ifdef APP
plus.io.resolveLocalFileSystemURL(url, (entry) => { plus.io.resolveLocalFileSystemURL(url, (entry) => {
// entrytest.html // entrytest.html
@ -207,7 +208,8 @@
let fileReader = new plus.io.FileReader(); let fileReader = new plus.io.FileReader();
fileReader.onloadend = (evt) => { fileReader.onloadend = (evt) => {
console.log("文件路径" + evt.target.result) console.log("文件路径" + evt.target.result)
this.data[index].barcodeBase64 = evt.target.result let i = this.data.length - 1 - index
this.data[i].barcodeBase64 = evt.target.result
this.generateBase64(index + 1) this.generateBase64(index + 1)
} }
fileReader.readAsDataURL(file); fileReader.readAsDataURL(file);

39
src/pages/pointPutawayJob/index.vue

@ -280,24 +280,29 @@
}, },
async onShow() { async onShow() {
// //
await getJimuPutawayJobDetail({ if(this.data.ids){
masterIds: this.data.ids await getJimuPutawayJobDetail({
}).then(res => { masterIds: this.data.ids
this.data.sublist = res.data }).then(res => {
this.getTableSubList() this.data.sublist = res.data
}) this.getTableSubList()
})
}
// //
await queryInspectionFreeFlag({ if(this.number){
number: this.number await queryInspectionFreeFlag({
}).then(async res1 => { number: this.number
this.data1 = res1.data }).then(async res1 => {
this.data1.inspectDTOList = this.data1.inspectDTOList.filter(item=>item.sampleQty>0) this.data1 = res1.data
// this.data1.inspectDTOList=[] this.data1.inspectDTOList = this.data1.inspectDTOList.filter(item=>item.sampleQty>0)
if(this.data1&&this.data1.inspectDTOList&&this.data1.inspectDTOList.length == 0){ // this.data1.inspectDTOList=[]
this.tabIndex =2 if(this.data1&&this.data1.inspectDTOList&&this.data1.inspectDTOList.length == 0){
} this.tabIndex =2
this.getTableInspectDTOList() }
}) this.getTableInspectDTOList()
})
}
this.getPointPutawayJobHtml() this.getPointPutawayJobHtml()
this.getPurchaseReceiptJobHtml() this.getPurchaseReceiptJobHtml()
}, },

109
src/pages/productPutaway/job/productPutawayJob.vue

@ -22,7 +22,7 @@
<uni-load-more :status="loadingType" v-if="jobList.length>0" /> <uni-load-more :status="loadingType" v-if="jobList.length>0" />
</view> </view>
<win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button> <win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button>
<winScanPackJob ref="scanPopup" @getResult='getScanResult' > <winScanPackJob ref="scanPopup" @getResult='getScanResult'>
</winScanPackJob> </winScanPackJob>
<jobList ref="jobList" @selectItem="selectItem"></jobList> <jobList ref="jobList" @selectItem="selectItem"></jobList>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
@ -79,14 +79,14 @@
status: '1,2', // status: '1,2', //
detailOptions: [], detailOptions: [],
detailGiveupOptions: [], detailGiveupOptions: [],
scanMessage:"" scanMessage: ""
}; };
}, },
props: { props: {
type: 'assemble', type: 'assemble',
title:{ title: {
required:false, required: false,
default:'' default: ''
} }
}, },
@ -130,13 +130,13 @@
} }
}, },
methods: { methods: {
onReach() { onReach() {
// //
if (this.loadingType == 'loading' || this.loadingType == 'nomore') { if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return; return;
} }
this.getList("more"); this.getList("more");
}, },
toHome() { toHome() {
goHome() goHome()
@ -173,11 +173,11 @@
action: "in", action: "in",
value: this.status value: this.status
}) })
filters.push({ filters.push({
column: "accept_user_id", column: "accept_user_id",
action: "==", action: "==",
value: this.$store.state.user.id value: this.$store.state.user.id
}) })
filters.push({ filters.push({
column: "type", column: "type",
@ -199,7 +199,7 @@
var list = res.data.list; var list = res.data.list;
this.totalCount = res.data.total this.totalCount = res.data.total
this.loadingType = "loadmore"; this.loadingType = "loadmore";
updateTitle(this.title+"(" + this.totalCount + ")"); updateTitle(this.title + "(" + this.totalCount + ")");
if (list == null || list.length == 0) { if (list == null || list.length == 0) {
this.loadingType = "nomore"; this.loadingType = "nomore";
return; return;
@ -211,8 +211,8 @@
}).catch(error => { }).catch(error => {
if (type === "refresh") { if (type === "refresh") {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
} }
updateTitle(this.title+"(" + this.totalCount + ")"); updateTitle(this.title + "(" + this.totalCount + ")");
this.loadingType = ""; this.loadingType = "";
uni.hideLoading(); uni.hideLoading();
that.showMessage(error) that.showMessage(error)
@ -221,9 +221,10 @@
openJobDetail(item, scanMessage = '') { openJobDetail(item, scanMessage = '') {
uni.navigateTo({ uni.navigateTo({
url: './productPutawayDetail?id=' + item.masterId + '&status=' + item.status + '&type=' + item.type + '&scanMessage=' + this.scanMessage +'&title='+this.title url: './productPutawayDetail?id=' + item.masterId + '&status=' + item.status + '&type=' + item
.type + '&scanMessage=' + this.scanMessage + '&title=' + this.title
}); });
this.scanMessage="" this.scanMessage = ""
}, },
showItemList(itemList) { showItemList(itemList) {
@ -337,11 +338,17 @@
}, },
getScanResult(result) { getScanResult(result) {
try { try {
this.scanMessage ="" this.scanMessage = ""
var filters = [{ var filters = [
// {
// column: "packingNumber",
// action: "==",
// value: result.label.packingNumber
// },
{
column: "packingNumber", column: "packingNumber",
action: "==", action: "in",
value: result.label.packingNumber value: result.package.number + "," + result.package.parentNumber
}, },
{ {
column: "batch", column: "batch",
@ -357,16 +364,16 @@
column: "itemCode", column: "itemCode",
action: "==", action: "==",
value: result.label.itemCode value: result.label.itemCode
}, },
{ {
column: "type", column: "type",
action: "==", action: "==",
value: this.type value: this.type
}, },
{ {
column: "status", column: "status",
action: "in", action: "in",
value: '1,2', value: '1,2',
}, },
{ {
column: "accept_user_id", column: "accept_user_id",
@ -384,19 +391,19 @@
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 100,
}).then(res => { }).then(res => {
this.scanMessage =result.scanMessage this.scanMessage = result.scanMessage
let resultList = res.data.list; let resultList = res.data.list;
if (resultList.length > 0) { if (resultList.length > 0) {
resultList.forEach(item => { resultList.forEach(item => {
item.title = item.number; item.title = item.number;
item.selected = false item.selected = false
}) })
let list = [] let list = []
resultList.forEach(item=>{ resultList.forEach(item => {
if(!list.find(subItem=>subItem.title==item.title)){ if (!list.find(subItem => subItem.title == item.title)) {
list.push(item) list.push(item)
} }
}) })
console.log('list', list) console.log('list', list)
if (list.length > 1) { if (list.length > 1) {
this.$refs.jobList.openList(list) this.$refs.jobList.openList(list)
@ -404,10 +411,10 @@
this.selectItem(list[0]) this.selectItem(list[0])
} }
} else { } else {
this.showMessage("未查找到任务<br>"+"扫描["+result.scanMessage+"]") this.showMessage("未查找到任务<br>" + "扫描[" + result.scanMessage + "]")
} }
}).catch(error => { }).catch(error => {
this.showMessage(error+"<br>扫描["+result.scanMessage+"]") this.showMessage(error + "<br>扫描[" + result.scanMessage + "]")
}) })
} catch (e) { } catch (e) {

4
src/pages/productPutaway/job/semiProductPutawayJob.vue

@ -25,7 +25,9 @@
this.$refs.productPutawayJob.refresh(); this.$refs.productPutawayJob.refresh();
} }
}, },
onReachBottom() {
this.$refs.productPutawayJob.onReach();
},
onPullDownRefresh() { onPullDownRefresh() {
this.$refs.productPutawayJob.refresh(); this.$refs.productPutawayJob.refresh();
}, },

2
src/pages/productReceipt/job/ccProductReceiptDetail.vue

@ -346,6 +346,8 @@
if (!this.checkLocation()) { if (!this.checkLocation()) {
return return
} }
}else{
this.toLocationCode = this.jobToLocationCode
} }

35
src/pages/productReceipt/job/ccProductReceiptJob.vue

@ -80,8 +80,8 @@
detailOptions: [], detailOptions: [],
detailGiveupOptions: [], detailGiveupOptions: [],
type: 'assemble', type: 'assemble',
title:"", title: "",
scanMessage:"" scanMessage: ""
}; };
}, },
// type = 'assemble' // type = 'assemble'
@ -92,12 +92,12 @@
// default: '' // default: ''
// }, // },
// }, // },
onLoad(option){ onLoad(option) {
this.title = option.title this.title = option.title
}, },
onShow(){ onShow() {
this.detailOptions = getDetailOption(); this.detailOptions = getDetailOption();
this.detailGiveupOptions = getDetailGiveupOption(); this.detailGiveupOptions = getDetailGiveupOption();
this.getList('refresh'); this.getList('refresh');
@ -126,7 +126,7 @@
this.$refs.filter.openFilter(); this.$refs.filter.openFilter();
} }
}, },
onReachBottom() { onReachBottom() {
console.log('onReachBottom', this.loadingType) console.log('onReachBottom', this.loadingType)
// //
@ -211,10 +211,11 @@
openJobDetail(item, scanMessage = '') { openJobDetail(item, scanMessage = '') {
uni.navigateTo({ uni.navigateTo({
url: './ccProductReceiptDetail?id=' + item.masterId + '&status=' + item.status + '&scanMessage=' + url: './ccProductReceiptDetail?id=' + item.masterId + '&status=' + item.status +
'&scanMessage=' +
scanMessage + '&title=' + this.title scanMessage + '&title=' + this.title
}); });
this.scanMessage ="" this.scanMessage = ""
// if (this.type == 'predict') { // if (this.type == 'predict') {
// uni.navigateTo({ // uni.navigateTo({
// url: './productReceiptDetail?id=' + item.masterId + '&status=' + item.status + '&scaned=' + packingNumber +'&title='+this.title // url: './productReceiptDetail?id=' + item.masterId + '&status=' + item.status + '&scaned=' + packingNumber +'&title='+this.title
@ -348,11 +349,17 @@
}, },
getScanResult(result) { getScanResult(result) {
try { try {
this.scanMessage ="" this.scanMessage = ""
var filters = [{ var filters = [
// {
// column: "packingNumber",
// action: "==",
// value: result.label.packingNumber
// },
{
column: "packingNumber", column: "packingNumber",
action: "==", action: "in",
value: result.label.packingNumber value: result.package.number + "," + result.package.parentNumber
}, },
{ {
column: "batch", column: "batch",
@ -390,7 +397,7 @@
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 100,
}).then(res => { }).then(res => {
this.scanMessage =result.scanMessage this.scanMessage = result.scanMessage
let resultList = res.data.list; let resultList = res.data.list;
if (resultList.length > 0) { if (resultList.length > 0) {
resultList.forEach(item => { resultList.forEach(item => {

9
src/pages/productReceipt/job/fgProductReceiptDetail.vue

@ -232,9 +232,9 @@
that.jobStatus = res.data.status that.jobStatus = res.data.status
that.jobToLocationCode = that.subList[0].toLocationCode that.jobToLocationCode = that.subList[0].toLocationCode
that.productionLineCode = that.subList[0].productionLineCode; that.productionLineCode = that.subList[0].productionLineCode;
if (that.jobContent.allowModifyLocation == 'FALSE') { // if (that.jobContent.allowModifyLocation == 'FALSE') {
that.toLocationCode = that.subList[0].toLocationCode // that.toLocationCode = that.subList[0].toLocationCode
} // }
that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes) that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes)
that.detailSource = getDataSource(that.subList) that.detailSource = getDataSource(that.subList)
@ -441,13 +441,14 @@
// this.showErrorMessage("0,") // this.showErrorMessage("0,")
// return; // return;
// } // }
var valiDate = getSwitchInfoByCode("fgProductReceipCommitValidate") var valiDate = getSwitchInfoByCode("fgProductReceipCommitValidate")
// //
if(valiDate){ if(valiDate){
if (!this.checkLocation()) { if (!this.checkLocation()) {
return return
} }
}else{
this.toLocationCode = this.jobToLocationCode
} }
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(subitem => { item.subList.forEach(subitem => {

111
src/pages/productReceipt/job/productReceiptJob.vue

@ -21,7 +21,7 @@
<uni-load-more :status="loadingType" v-if="jobList.length>0" /> <uni-load-more :status="loadingType" v-if="jobList.length>0" />
<win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button> <win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button>
<winScanPackJob ref="scanPopup" @getResult='getScanResult' ></winScanPackJob> <winScanPackJob ref="scanPopup" @getResult='getScanResult'></winScanPackJob>
<jobList ref="jobList" @selectItem="selectItem"></jobList> <jobList ref="jobList" @selectItem="selectItem"></jobList>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
@ -79,16 +79,16 @@
status: '1,2', // status: '1,2', //
detailOptions: [], detailOptions: [],
detailGiveupOptions: [], detailGiveupOptions: [],
scanMessage:"" scanMessage: ""
}; };
}, },
// type = 'assemble' // type = 'assemble'
// type = 'predict' // type = 'predict'
props: { props: {
type: 'assemble', type: 'assemble',
title: { title: {
type: String, type: String,
default: '' default: ''
}, },
}, },
@ -99,7 +99,7 @@
this.getList('refresh'); this.getList('refresh');
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.getList('refresh'); this.getList('refresh');
@ -125,14 +125,14 @@
} }
}, },
methods: { methods: {
onReachBottom() { onReachBottom() {
console.log('onReachBottom',this.loadingType) console.log('onReachBottom', this.loadingType)
// //
if (this.loadingType == 'loading' || this.loadingType == 'noMore') { if (this.loadingType == 'loading' || this.loadingType == 'noMore') {
return; return;
} }
this.getList("more"); this.getList("more");
}, },
refresh() { refresh() {
this.getList('refresh'); this.getList('refresh');
@ -161,11 +161,11 @@
column: "status", column: "status",
action: "in", action: "in",
value: this.status value: this.status
}) })
filters.push({ filters.push({
column: "accept_user_id", column: "accept_user_id",
action: "==", action: "==",
value: this.$store.state.user.id value: this.$store.state.user.id
}) })
filters.push({ filters.push({
column: "type", column: "type",
@ -187,8 +187,8 @@
var list = res.data.list; var list = res.data.list;
this.totalCount = res.data.total this.totalCount = res.data.total
// //
updateTitle(this.title+"(" + this.totalCount + ")"); updateTitle(this.title + "(" + this.totalCount + ")");
this.loadingType = "more"; this.loadingType = "more";
if (list == null || list.length == 0) { if (list == null || list.length == 0) {
this.loadingType = "noMore"; this.loadingType = "noMore";
@ -202,7 +202,7 @@
if (type === "refresh") { if (type === "refresh") {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
} }
updateTitle(this.title+"(" + this.totalCount + ")"); updateTitle(this.title + "(" + this.totalCount + ")");
this.loadingType = ""; this.loadingType = "";
uni.hideLoading(); uni.hideLoading();
that.showMessage(error) that.showMessage(error)
@ -212,18 +212,21 @@
openJobDetail(item, scanMessage = '') { openJobDetail(item, scanMessage = '') {
if (this.type == 'predict') { if (this.type == 'predict') {
uni.navigateTo({ uni.navigateTo({
url: './productReceiptDetail?id=' + item.masterId + '&status=' + item.status + '&scanMessage=' + scanMessage +'&title='+this.title url: './productReceiptDetail?id=' + item.masterId + '&status=' + item.status +
'&scanMessage=' + scanMessage + '&title=' + this.title
}); });
} else if (this.type == 'assemble') { } else if (this.type == 'assemble') {
uni.navigateTo({ uni.navigateTo({
url: './fgProductReceiptDetail?id=' + item.masterId + '&status=' + item.status + '&scanMessage=' + scanMessage +'&title='+this.title url: './fgProductReceiptDetail?id=' + item.masterId + '&status=' + item.status +
'&scanMessage=' + scanMessage + '&title=' + this.title
}); });
} else { } else {
uni.navigateTo({ uni.navigateTo({
url: './scrapReceiptDetail?id=' + item.masterId + '&status=' + item.status + '&scanMessage=' + scanMessage +'&title='+this.title url: './scrapReceiptDetail?id=' + item.masterId + '&status=' + item.status +
'&scanMessage=' + scanMessage + '&title=' + this.title
}); });
} }
this.scanMessage ="" this.scanMessage = ""
}, },
showItemList(itemList) { showItemList(itemList) {
@ -349,11 +352,11 @@
}, },
getScanResult(result) { getScanResult(result) {
try { try {
this.scanMessage ="" this.scanMessage = ""
var filters = [{ var filters = [{
column: "packingNumber", column: "packingNumber",
action: "==", action: "in",
value: result.label.packingNumber value: result.package.number + "," + result.package.parentNumber
}, },
{ {
column: "batch", column: "batch",
@ -369,16 +372,16 @@
column: "itemCode", column: "itemCode",
action: "==", action: "==",
value: result.label.itemCode value: result.label.itemCode
}, },
{ {
column: "type", column: "type",
action: "==", action: "==",
value: this.type value: this.type
}, },
{ {
column: "status", column: "status",
action: "in", action: "in",
value: '1,2', value: '1,2',
}, },
{ {
column: "accept_user_id", column: "accept_user_id",
@ -391,29 +394,29 @@
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 100,
}).then(res => { }).then(res => {
this.scanMessage =result.scanMessage this.scanMessage = result.scanMessage
let resultList = res.data.list; let resultList = res.data.list;
if (resultList.length > 0) { if (resultList.length > 0) {
resultList.forEach(item => { resultList.forEach(item => {
item.title = item.number; item.title = item.number;
item.selected = false item.selected = false
}) })
let list = [] let list = []
resultList.forEach(item=>{ resultList.forEach(item => {
if(!list.find(subItem=>subItem.title==item.title)){ if (!list.find(subItem => subItem.title == item.title)) {
list.push(item) list.push(item)
} }
}) })
if (list.length > 1) { if (list.length > 1) {
this.$refs.jobList.openList(list) this.$refs.jobList.openList(list)
} else { } else {
this.selectItem(list[0]) this.selectItem(list[0])
} }
} else { } else {
this.showMessage("未查找到任务<br>"+"扫描["+result.scanMessage+"]") this.showMessage("未查找到任务<br>" + "扫描[" + result.scanMessage + "]")
} }
}).catch(error => { }).catch(error => {
this.showMessage(error+"<br>扫描["+result.scanMessage+"]") this.showMessage(error + "<br>扫描[" + result.scanMessage + "]")
}) })
} catch (e) { } catch (e) {

2
src/pages/productRecycle/job/productRecycleJobDetail.vue

@ -276,7 +276,7 @@
// //
if (this.jobContent.allowModifyInventoryStatus == "TRUE") { if (this.jobContent.allowModifyInventoryStatus == "TRUE") {
this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus +
']不一致,是否继续退货?', res => { ']不一致,是否继续回收?', res => {
if (res) { if (res) {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.handleQty = Number(result.balance.qty); itemDetail.handleQty = Number(result.balance.qty);

11
src/pages/productionReceipt/job/productionReceiptJob.vue

@ -3,8 +3,7 @@
<com-empty-view v-if="jobList.length==0"></com-empty-view> <com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday" <job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday" @switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask" :isShowProductionLineCode="true" :checkedWaitTask="checkedWaitTask" :isShowProductionLineCode="true" @productionLineCode="productionLineCode"
@productionLineCode="productionLineCode"
:productionline="productionLineList"> :productionline="productionLineList">
</job-filter> </job-filter>
<view v-if="jobList.length>0"> <view v-if="jobList.length>0">
@ -85,7 +84,7 @@
title: '', title: '',
scanMessage: "", scanMessage: "",
productionLineList: [], productionLineList: [],
productionLine:"" productionLine: ""
}; };
}, },
onLoad(option) { onLoad(option) {
@ -136,7 +135,7 @@
methods: { methods: {
productionLineCode(productionLineCode) { productionLineCode(productionLineCode) {
this.productionLine = productionLineCode this.productionLine = productionLineCode
this.getList('refresh', this.productionLine) this.getList('refresh', this.productionLine)
}, },
getProductionReceiptJobByProductionline() { getProductionReceiptJobByProductionline() {
getProductionReceiptJobByProductionline().then(res => { getProductionReceiptJobByProductionline().then(res => {
@ -353,8 +352,8 @@
this.scanMessage = "" this.scanMessage = ""
var filters = [{ var filters = [{
column: "packingNumber", column: "packingNumber",
action: "==", action: "in",
value: result.label.packingNumber value: result.package.number + "," + result.package.parentNumber
}, },
{ {
column: "batch", column: "batch",

8
src/pages/purchaseReceipt/job/receiptJob.vue

@ -391,10 +391,10 @@
}] }]
} else { } else {
filters = [{ filters = [{
column: "packingNumber", column: "packingNumber",
action: "==", action: "in",
value: result.label.packingNumber value: result.package.number + "," + result.package.parentNumber
}, },
{ {
column: "batch", column: "batch",
action: "==", action: "==",

96
src/pages/putaway/job/putawayJob.vue

@ -56,7 +56,9 @@
import putawayJobListPopup from '@/pages/putaway/coms/putawayJobListPopup.vue' import putawayJobListPopup from '@/pages/putaway/coms/putawayJobListPopup.vue'
import putawayInfoPopup from '@/pages/putaway/coms/putawayInfoPopup.vue' import putawayInfoPopup from '@/pages/putaway/coms/putawayInfoPopup.vue'
import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue" import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue"
import { Exception } from 'sass'; import {
Exception
} from 'sass';
export default { export default {
name: 'Putaway', name: 'Putaway',
@ -83,18 +85,18 @@ import { Exception } from 'sass';
status: '1,2', // status: '1,2', //
detailOptions: [], detailOptions: [],
detailGiveupOptions: [], detailGiveupOptions: [],
title:'', title: '',
scanMessage:"" scanMessage: ""
}; };
}, },
onLoad(option){ onLoad(option) {
this.title = option.title this.title = option.title
}, },
onShow() { onShow() {
this.getList('refresh'); this.getList('refresh');
}, },
onReady() { onReady() {
@ -179,7 +181,7 @@ import { Exception } from 'sass';
var list = res.data.list; var list = res.data.list;
this.totalCount = res.data.total this.totalCount = res.data.total
updateTitle(this.title+"(" + this.totalCount + ")"); updateTitle(this.title + "(" + this.totalCount + ")");
this.loadingType = "loadmore"; this.loadingType = "loadmore";
if (list == null || list.length == 0) { if (list == null || list.length == 0) {
this.loadingType = "nomore"; this.loadingType = "nomore";
@ -201,9 +203,9 @@ import { Exception } from 'sass';
openJobDetail(item) { openJobDetail(item) {
uni.navigateTo({ uni.navigateTo({
url: './putawayDetail?id=' + item.masterId + '&status=' + item.status + '&title='+this.title url: './putawayDetail?id=' + item.masterId + '&status=' + item.status + '&title=' + this.title
}); });
this.scanMessage="" this.scanMessage = ""
}, },
showItemList(itemList) { showItemList(itemList) {
@ -279,7 +281,7 @@ import { Exception } from 'sass';
action: "==", action: "==",
value: code value: code
}) })
filters.push({ filters.push({
column: "accept_user_id", column: "accept_user_id",
action: "==", action: "==",
@ -318,27 +320,27 @@ import { Exception } from 'sass';
selectItem(item) { selectItem(item) {
this.$refs.scanPopup.closeScanPopup(); this.$refs.scanPopup.closeScanPopup();
uni.navigateTo({ uni.navigateTo({
url: './putawayDetail?id=' url: './putawayDetail?id=' +
+ item.masterId item.masterId +
+ '&status=' + item.status '&status=' + item.status +
+'&scaned='+item.packingNumber '&scaned=' + item.packingNumber +
+ '&title='+this.title '&title=' + this.title +
+"&scanMessage="+this.scanMessage "&scanMessage=" + this.scanMessage
}); });
this.scanMessage="" this.scanMessage = ""
}, },
getScanResult(result) { getScanResult(result) {
try { try {
this.scanMessage ="" this.scanMessage = ""
var filters = [{ var filters = [{
column: "packingNumber", column: "packingNumber",
action: "==", action: "in",
value: result.label.packingNumber value: result.package.number + "," + result.package.parentNumber
}, },
{ {
column: "batch", column: "batch",
action: "==", action: "==",
value: result.label.batch value: result.package.batch
}, },
// { // {
// column: "qty", // column: "qty",
@ -348,12 +350,12 @@ import { Exception } from 'sass';
{ {
column: "itemCode", column: "itemCode",
action: "==", action: "==",
value: result.label.itemCode value: result.package.itemCode
}, },
{ {
column: "status", column: "status",
action: "in", action: "in",
value: '1,2,3', value: '1,2',
}, },
// { // {
// column: "accept_user_id", // column: "accept_user_id",
@ -371,7 +373,7 @@ import { Exception } from 'sass';
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 100,
}).then(res => { }).then(res => {
this.scanMessage =result.scanMessage this.scanMessage = result.scanMessage
let resultList = res.data.list; let resultList = res.data.list;
if (resultList.length > 0) { if (resultList.length > 0) {
resultList.forEach(item => { resultList.forEach(item => {
@ -379,38 +381,40 @@ import { Exception } from 'sass';
item.selected = false item.selected = false
}) })
let list = [] let list = []
resultList.forEach(item=>{ resultList.forEach(item => {
if(!list.find(subItem=>subItem.title==item.title)){ if (!list.find(subItem => subItem.title == item.title)) {
list.push(item) list.push(item)
} }
}) })
if(list.length==1){ if (list.length == 1) {
// //
if(list[0].status==1){ if (list[0].status == 1) {
this.selectItem(list[0]) this.selectItem(list[0])
}else if(list[0].status==2){ } else if (list[0].status == 2) {
// //
if(list[0].acceptUserId==this.$store.state.user.id){ if (list[0].acceptUserId == this.$store.state.user.id) {
this.selectItem(list[0]) this.selectItem(list[0])
}else { } else {
this.showMessage("该任务已经被["+list[0].acceptUserName+"]承接"+"<br>任务号["+list[0].number+"]扫描["+result.scanMessage+"]") this.showMessage("该任务已经被[" + list[0].acceptUserName + "]承接" + "<br>任务号[" +
} list[0].number + "]扫描[" + result.scanMessage + "]")
}else if(list[0].status==3){ }
this.showMessage("该任务已经完成<br>承接人["+list[0].acceptUserName+"]<br>任务号["+list[0].number+"]扫描["+result.scanMessage+"]") } else if (list[0].status == 3) {
} this.showMessage("该任务已经完成<br>承接人[" + list[0].acceptUserName + "]<br>任务号[" +
}else { list[0].number + "]扫描[" + result.scanMessage + "]")
this.showMessage("查询到多条任务<br>"+"扫描["+result.scanMessage+"]") }
} else {
this.showMessage("查询到多条任务<br>" + "扫描[" + result.scanMessage + "]")
} }
} else { } else {
this.showMessage("未查找到任务<br>"+"扫描["+result.scanMessage+"]") this.showMessage("未查找到任务<br>" + "扫描[" + result.scanMessage + "]")
} }
}).catch(error => { }).catch(error => {
this.showMessage(error+"<br>扫描["+result.scanMessage+"]") this.showMessage(error + "<br>扫描[" + result.scanMessage + "]")
}) })
} catch (e) { } catch (e) {
this.showMessage(e+"<br>扫描["+result.scanMessage+"]") this.showMessage(e + "<br>扫描[" + result.scanMessage + "]")
} }
}, },
} }

3
src/pages/repleinsh/coms/comRepleishDetailCard.vue

@ -35,7 +35,8 @@
<text class="card_content ">{{record.parentPackingNumber}}</text> <text class="card_content ">{{record.parentPackingNumber}}</text>
</view> --> </view> -->
<handle-balance :detail="record" :isShowLocation="false" <handle-balance :detail="record" :isShowLocation="false"
:isShowBatch="batch.packingNumber!=null" :isShowStatus='true'> :isShowStatus='true'>
<!-- :isShowBatch="batch.packingNumber!=null" -->
</handle-balance> </handle-balance>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>

333
src/pages/repleinsh/coms/comScanReplishPack.vue

@ -8,7 +8,7 @@
<text class="fr" @click="closeScanPopup()">关闭</text> <text class="fr" @click="closeScanPopup()">关闭</text>
</view> </view>
<view class="uni-flex uni-row" style="align-items: center; <!-- <view class="uni-flex uni-row" style="align-items: center;
background-color: #fff; background-color: #fff;
margin-left: 20rpx; margin-left: 20rpx;
margin-right: 20rpx; margin-right: 20rpx;
@ -21,7 +21,7 @@
<uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请选择库位" <uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请选择库位"
@confirm="fromLocationUpdate"></uni-combox> @confirm="fromLocationUpdate"></uni-combox>
</view> </view>
</view> </view> -->
<view class=""> <view class="">
<view class=""> <view class="">
@ -83,13 +83,14 @@
} from '@/common/array.js'; } from '@/common/array.js';
import { import {
getWorkShopLineStation, getWorkShopLineStation,
getBalanceByFilter getBalanceByFilter,
getBalanceByParams
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
calc calc
} from '@/common/calc.js'; } from '@/common/calc.js';
import { import {
uniqueArray uniqueArray
} from '@/common/basic.js'; } from '@/common/basic.js';
@ -100,8 +101,8 @@
import { import {
getDirectoryItemArray getDirectoryItemArray
} from '../../../common/directory.js'; } from '../../../common/directory.js';
import { import {
getLabelInfo getLabelInfo
} from '@/common/label.js'; } from '@/common/label.js';
@ -162,8 +163,8 @@
this.$refs.popup.open('bottom') this.$refs.popup.open('bottom')
}, 500) }, 500)
}, },
openScanPopupForJobSimulate(content, jobcontent,scanMessage) { openScanPopupForJobSimulate(content, jobcontent, scanMessage) {
this.issueRecord = []; this.issueRecord = [];
this.dataContent = content; this.dataContent = content;
this.jobContent = jobcontent; this.jobContent = jobcontent;
@ -174,7 +175,7 @@
} else { } else {
this.showErrorMessage(callback.message) this.showErrorMessage(callback.message)
} }
}) })
}, },
@ -192,7 +193,7 @@
that.fromInventoryStatuses = this.jobContent.outInventoryStatuses that.fromInventoryStatuses = this.jobContent.outInventoryStatuses
that.toLocation = that.dataContent[0]; that.toLocation = that.dataContent[0];
that.toLocationCode = that.dataContent[0].toLocationCode; that.toLocationCode = that.dataContent[0].toLocationCode;
that.fromLocationList = that.getFromLocationList(); // that.fromLocationList = that.getFromLocationList();
} }
}, },
@ -200,26 +201,26 @@
this.$refs.balanceSelect.openPopup(items); this.$refs.balanceSelect.openPopup(items);
}, },
getFromLocationList() { // getFromLocationList() {
let list = []; // let list = [];
let location = this.dataContent.find(r => r.toLocationCode == this.toLocationCode); // let location = this.dataContent.find(r => r.toLocationCode == this.toLocationCode);
if (location != undefined) { // if (location != undefined) {
location.Items.forEach(item => { // location.Items.forEach(item => {
item.Locations.forEach(f => { // item.Locations.forEach(f => {
list.push(f.fromLocationCode) // list.push(f.fromLocationCode)
}) // })
}) // })
// // //
list = uniqueArray(list); // list = uniqueArray(list);
this.fromLocationCode = list[0]; // this.fromLocationCode = list[0];
return list; // return list;
} else { // } else {
this.$refs.comMessage.showErrorMessages('需求库位【' + this.toLocationCode + '】不存在', res => { // this.$refs.comMessage.showErrorMessages('' + this.toLocationCode + '', res => {
this.toLocationCode = ''; // this.toLocationCode = '';
}); // });
} // }
}, // },
fromLocationUpdate(fromlocation) { fromLocationUpdate(fromlocation) {
let location = this.fromLocationList.find(r => r == fromlocation) let location = this.fromLocationList.find(r => r == fromlocation)
@ -228,15 +229,44 @@
this.showErrorMessage('发料库位【' + fromlocation + '】不存在') this.showErrorMessage('发料库位【' + fromlocation + '】不存在')
} }
}, },
onScan(result) { onScan(result) {
if (!result.package) {
this.showErrorMessage('扫描数据错误[' + result.label.code + "]",
res => {
this.getfocus();
}
)
return;
}
if (this.toLocation && result.package.packUnit) {
let item = this.toLocation.Items.find(r => r.itemCode == result.package.itemCode);
if (!item) {
this.showErrorMessage('扫描物料代码不属于该任务');
return
}
if (result.package.packUnit !== item.packUnit) {
this.$refs.comMessage.showQuestionMessage(
`扫描物料包装【${result.package.packUnit}】与任务推荐包装规格【${item.packUnit}】不一致.是否要继续发料?`, res => {
if (res) {
this.onScanResult(result)
}
});
} else {
this.onScanResult(result)
}
}
},
onScanResult(result) {
try { try {
let that = this; let that = this;
if (that.fromLocationCode == '') { // if (that.fromLocationCode == '') {
that.showErrorMessage('请选择来源库位', res => { // that.showErrorMessage('', res => {
that.$refs.toLocationCombox.onFocus(); // that.$refs.toLocationCombox.onFocus();
}); // });
return; // return;
} // }
let packageInfo = result.package; let packageInfo = result.package;
let itemCode = result.label.itemCode; let itemCode = result.label.itemCode;
let packingCode = result.label.packingNumber; let packingCode = result.label.packingNumber;
@ -250,115 +280,50 @@
) )
return; return;
} else { } else {
//
var params = {
itemCode: result.package.itemCode,
batch: result.label.batch,
packingNumber: result.label.packingNumber,
parentPackingNumber: result.package.parentNumber,
inventoryStatus: this.jobContent.outInventoryStatuses.split(','),
areaType: this.jobContent.fromAreaTypes.split(','),
bussinessCode: this.jobContent.businessType
}
uni.showLoading({ uni.showLoading({
title: '加载中', title: '查询中',
mask: true mask: true
}) })
getBalanceByParams(params).then(res => {
this.getBalance(result.label, packageInfo, balances => { if (res.data.length == 0) {
this.packageInfo = packageInfo; var status = getInventoryStatusDesc(params.inventoryStatus)
// var areaType = getListLocationAreaTypeDesc(params.areaType)
let s = ''; var hint =
if (!result.package.parentNumber) { "按物料号 [" + params.itemCode + "] <br>" +
if (balances.list.length == 0) { "包装号 [" + params.packingNumber + "] <br>" +
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描') "批次 [" + params.batch + "] <br>" +
"状态 [" + status + "] <br>" +
"库区 [" + areaType + "] <br>" +
"未查找到库存余额"
this.showErrorMessage(hint)
} else if (res.data.length == 1) {
result.balance = res.data[0]
if (result.label.packingNumber != result.balance.packingNumber) {
result.balance.handleQty = Number(result.label.qty)
} else { } else {
let newBalances = balances.list.filter(b => b.locationCode == that result.balance.handleQty = Number(result.balance.qty)
.fromLocationCode);
if (newBalances.length == 0) {
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else if (newBalances.length == 1) {
let balance = newBalances[0];
this.afterGetBalance(result.label, balance, packageInfo);
} else {
this.showBalanceSelect(newBalances);
}
} }
this.afterGetBalance(result.label, result.balance, result.package);
} else { } else {
// //
if (balances.list.length == 0) { this.$refs.balanceSelect.openPopup(res.data);
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else {
//
let subPackitems = balances.list.filter(r => r.packingNumber == packageInfo
.number)
//
let subParentPackitems = balances.list.filter(r => r.packingNumber ==
packageInfo
.parentNumber && r.locationCode == this.fromLocationCode)
//
if (subPackitems.length == 0) {
//
if (subParentPackitems.length > 0) {
if (subParentPackitems.length == 1) {
let balance = subParentPackitems[0];
balance.qty = packageInfo.qty;
this.afterGetBalance(result.label, balance, packageInfo);
} else {
this.showBalanceSelect(subParentPackitems);
}
} else {
this.showErrorMessage('按外包装【' + packageInfo.parentNumber + '】和子包装【' +
packageInfo.number + '】都未查找到库存余额')
}
} else {
var locationCode = this.fromLocationCode
if (balances.list == 1) {
locationCode = balances.list[0].locationCode
} else {
var manyBlances = balances.list.filter(r => r.locationCode != this
.fromLocationCode)
if (manyBlances.length > 0) {
locationCode = manyBlances[0].locationCode;
}
}
this.showErrorMessage('该包装【' + packageInfo.number + '】在库位【' +
locationCode +
'】已经有库存余额,请重新扫描')
}
// //
// if (subitems.length == 0 && subParentPackitems.length > 0) {
// this.afterGetBalance(result.label, null, packageInfo);
// } else if (subitems.length > 0 && subParentPackitems.length == 0) {
// //
// this.showErrorMessage('' + balances.list[0].locationCode +
// ',')
// } else {
// }
}
} }
uni.hideLoading(); uni.hideLoading()
}); }).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
// getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses, })
// balanceRes => {
// if (balanceRes.success) {
// let s = '';
// if (balanceRes.data.list.length == 0) {
// this.afterGetBalance(result.label, null, packageInfo);
// } else if (balanceRes.data.list.length == 1) {
// let balance = balanceRes.data.list[0];
// this.afterGetBalance(result.label, balance, packageInfo);
// } else {
// this.showBalanceSelect(balanceRes.data.list);
// }
// } else {
// this.showErrorMessage(balanceRes.message.message);
// }
// uni.hideLoading();
// });
} }
} catch (e) { } catch (e) {
this.showErrorMessage(e.stack) this.showErrorMessage(e.stack)
@ -366,55 +331,6 @@
} }
}, },
getBalance(label, packageInfo, callback) {
var filters = []
if (packageInfo.parentNumber) {
var packingNumber = packageInfo.parentNumber + "," + label.packingNumber;
filters.push({
column: "packingNumber",
action: "in",
value: packingNumber
})
} else {
filters.push({
column: "packingNumber",
action: "==",
value: label.packingNumber
})
}
filters.push({
column: "itemCode",
action: "==",
value: label.itemCode
})
filters.push({
column: "batch",
action: "==",
value: label.batch
})
if (this.fromInventoryStatuses != null && this.fromInventoryStatuses != "") {
filters.push({
column: "inventoryStatus",
action: "in",
value: this.fromInventoryStatuses
})
}
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getBalanceByFilter(params).then(res => {
callback(res.data)
}).catch(err => {
this.showErrorMessage(err.message);
})
},
selectBalanceItem(balance) { selectBalanceItem(balance) {
this.afterGetBalance(this.label, balance, this.packageInfo); this.afterGetBalance(this.label, balance, this.packageInfo);
}, },
@ -426,7 +342,10 @@
let packingCode = label.packingNumber; let packingCode = label.packingNumber;
let lot = label.batch; let lot = label.batch;
let item = that.toLocation.Items.find(r => r.itemCode == itemCode); let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
that.fromLocationCode = balance.locationCode;
let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode); let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode);
//
if (fromLocation != undefined) { if (fromLocation != undefined) {
let batch = fromLocation.Batchs.find(r => r.batch == lot); let batch = fromLocation.Batchs.find(r => r.batch == lot);
if (batch != undefined) { if (batch != undefined) {
@ -483,11 +402,8 @@
} }
} }
} else { } else {
that.showErrorMessage('未查找到推荐库位【' + that.fromLocationCode + '】的发料明细', let locaion = that.createLocationInfo(label, balance, packageInfo);
res => { item.Locations.push(locaion);
that.getfocus();
}
)
} }
} catch (e) { } catch (e) {
this.showErrorMessage(e.stack, this.showErrorMessage(e.stack,
@ -498,20 +414,35 @@
} }
}, },
//
createLocationInfo(label, balance, packageInfo) {
let location = {
fromLocationCode: balance.locationCode,
qty: balance.qty,
uom: balance.uom,
handleQty: 0,
Batchs: []
}
let batch = this.createBatchInfo(label, balance, packageInfo);
batch.detail = balance;
batch.detail.fromLocationCode = balance.locationCode;
location.Batchs.push(batch);
return location;
},
createBatchInfo(label, balance, packageInfo) { createBatchInfo(label, balance, packageInfo) {
let batch = { let batch = {
batch: label.batch, batch: label.batch,
qty: 0, qty: 0,
uom: label.uom, uom: label.uom,
Records: [] Records: []
} }
let record = {} let record = {}
if (balance == null) { if (balance != null) {
record = this.creatRecordByBalance(label, packageInfo); record = this.creatRecordByBalance(balance, packageInfo);
batch.handleQty = Number(label.qty) batch.handleQty = Number(label.qty)
} else { } else {
record = this.creatRecordByLabel(balance, packageInfo); record = this.creatRecordByLabel(label, packageInfo);
batch.handleQty = Number(balance.qty) batch.handleQty = Number(balance.qty)
} }
@ -535,7 +466,7 @@
toLocationCode: this.toLocationCode, toLocationCode: this.toLocationCode,
supplierCode: label.supplierCode, supplierCode: label.supplierCode,
packUnit: packageInfo.packUnit, packUnit: packageInfo.packUnit,
packQty: packageInfo.packQty packQty: packageInfo.packQty,
} }
return record; return record;
}, },
@ -659,16 +590,16 @@
}, },
packGetFocus() { packGetFocus() {
if(this.$refs.comscan){ if (this.$refs.comscan) {
this.$refs.comscan.getfocus(); this.$refs.comscan.getfocus();
} }
}, },
packLoseFocus() { packLoseFocus() {
if(this.$refs.comscan){ if (this.$refs.comscan) {
this.$refs.comscan.losefocus(); this.$refs.comscan.losefocus();
} }
}, },
showMessage(message, callback) { showMessage(message, callback) {
setTimeout(r => { setTimeout(r => {

42
src/pages/repleinsh/job/repleinshDetail.vue

@ -196,9 +196,9 @@
.jobContent, that.scanMessage); .jobContent, that.scanMessage);
} }
let timer = setTimeout(r => { let timer = setTimeout(r => {
that.resizeCollapse(); that.resizeCollapse();
if(timer){ if (timer) {
timer = null timer = null
clearTimeout(timer) clearTimeout(timer)
} }
@ -278,7 +278,6 @@
}); });
var params = this.setParams() var params = this.setParams()
console.log("提交参数", JSON.stringify(params)); console.log("提交参数", JSON.stringify(params));
repleinshJobSubmit(params).then(res => { repleinshJobSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
@ -333,43 +332,6 @@
record.toPackUnit = r.packUnit; record.toPackUnit = r.packUnit;
record.toBatch = r.batch; record.toBatch = r.batch;
// if (r.parentPackingNumber != '' && r
// .parentPackingNumber != null) {
// record.fromPackingNumber = r
// .parentPackingNumber;
// record.toPackingNumber = r
// .packingNumber;
// // record.fromPackUnit = r.packUnit;
// record.toPackUnit = r.packUnit;
// } else {
// record.fromPackingNumber = r
// .packingNumber;
// record.toPackingNumber = r
// .packingNumber;
// record.toPackUnit = r.packUnit;
// }
// record.toBatch = r.batch;
// //使
// if (this.jobContent
// .useOnTheWayLocation ==
// 'TRUE') {
// record.toPackingNumber = r
// .packingNumber;
// record.toBatch = r.batch;
// } else {
// var info =
// getPackingNumberAndBatch(
// this.managementList, r
// .itemCode,
// r.packingNumber, r
// .batch);
// record.toPackingNumber = info
// .packingNumber;
// record.toBatch = info.batch;
// }
subItem.recordList.push(record); subItem.recordList.push(record);
}) })
commitSubList.push(deepCopyData(subItem)); commitSubList.push(deepCopyData(subItem));

125
src/pages/repleinsh/job/repleinshJob.vue

@ -1,9 +1,16 @@
<template> <template>
<view class=""> <view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view> <com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter :isShowFromLocationCode="true" ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday" <!-- <job-filter :isShowFromLocationCode="true" ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday" @switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday" :isShowItemCode="true"
:checkedWaitTask="checkedWaitTask" @fromLocationCode="fromLocationCode"> :checkedWaitTask="checkedWaitTask" @fromLocationCode="fromLocationCode">
</job-filter> -->
<job-filter :isShowFromLocationCode="true" :isShowProductionLineCode="false"
:productionline="productionlineList" ref="filter" otherTitle="" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask" :isShowItemCode="true" @productionLineCode="productionLineCode"
@fromLocationCode="fromLocationCode" :isShowQurery='true' @onQuery="getListByFilter">
</job-filter> </job-filter>
<view v-if="jobList.length>0"> <view v-if="jobList.length>0">
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
@ -95,6 +102,10 @@
scanBalance: {}, scanBalance: {},
inInventoryStatus: "", // inInventoryStatus: "", //
outInventoryStatus: "", // outInventoryStatus: "", //
productionLineCode: "",
productionlineList: [],
fromLocationCode:'',
filterItemCode:''
}; };
}, },
onLoad(option) { onLoad(option) {
@ -135,10 +146,12 @@
if (this.loadingType == 'loading' || this.loadingType == 'nomore') { if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return; return;
} }
this.getList("more"); this.getList('more', this.fromLocationCode, this.filterItemCode)
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.getList('refresh'); this.getList('refresh', this.fromLocationCode, this.filterItemCode)
}, },
methods: { methods: {
@ -146,7 +159,7 @@
getBusinessType(this.businessTypeCode, res => { getBusinessType(this.businessTypeCode, res => {
if (res.success) { if (res.success) {
this.businessType = res.businessType; this.businessType = res.businessType;
this.fromInventoryStatuses =res.fromInventoryStatuses.split(','); this.fromInventoryStatuses = res.fromInventoryStatuses.split(',');
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList this.fromLocationAreaTypeList = res.fromLocationAreaTypeList
// this.openScanPopup(); // this.openScanPopup();
} else { } else {
@ -155,7 +168,8 @@
}); });
}, },
getList(type, fromLocationCode = '') { getList(type, fromLocationCode = '',filterItemCode='') {
let that = this; let that = this;
uni.showLoading({ uni.showLoading({
title: "加载中­....", title: "加载中­....",
@ -196,12 +210,20 @@
value: fromLocationCode value: fromLocationCode
}) })
} }
if (filterItemCode != '') {
//
filters.push({
column: "itemCode",
action: "like",
value: filterItemCode
})
}
var params = { var params = {
filters: filters, filters: filters,
pageNo: this.pageNo, pageNo: this.pageNo,
pageSize: this.pageSize, pageSize: this.pageSize,
sort: 'number', // sort: 'number',
by: 'desc' // by: 'desc'
} }
getRepleinshJobList(params).then(res => { getRepleinshJobList(params).then(res => {
@ -231,12 +253,88 @@
that.showMessage(error) that.showMessage(error)
}) })
}, },
getListByFilter(params) {
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
var filters = []
if (this.checkedToday) {
filters.push({
column: "create_time",
action: "betweeen",
value: this.todayTime
})
}
filters.push({
column: "status",
action: "in",
value: this.status
})
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
if (params.fromLocationCode) {
//
this.fromLocationCode = params.fromLocationCode
filters.push({
column: "fromLocationCode",
action: "==",
value: params.fromLocationCode
})
}else{
this.fromLocationCode = ''
}
if (params.itemCode) {
//
this.filterItemCode = params.itemCode
filters.push({
column: "itemCode",
action: "like",
value: params.itemCode
})
}else{
this.filterItemCode = ''
}
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
this.getList('refresh', this.fromLocationCode, this.filterItemCode)
// getRepleinshJobList(params).then(res => {
// uni.hideLoading();
// if (res.data.total == 0) {
// that.showMessage('');
// } else if (res.data.total == 1) {
// that.openJobDetail(res.data.list[0]);
// } else {
// that.showItemList(res.data.list);
// }
// }).catch(error => {
// that.showMessage(error)
// })
},
fromLocationCode(fromLocationCode) { fromLocationCode(fromLocationCode) {
console.log('fromLocationCode', fromLocationCode) console.log('fromLocationCode', fromLocationCode)
this.getList('refresh', fromLocationCode, '') this.fromLocationCode = fromLocationCode
this.getList('refresh', this.fromLocationCode, this.filterItemCode)
}, },
openJobDetail(item, scanMessage='') { openJobDetail(item, scanMessage = '') {
uni.navigateTo({ uni.navigateTo({
url: './repleinshDetail?id=' + item.masterId + '&status=' + item.status + '&scanMessage=' + url: './repleinshDetail?id=' + item.masterId + '&status=' + item.status + '&scanMessage=' +
scanMessage + '&title=' + this.title scanMessage + '&title=' + this.title
@ -245,7 +343,7 @@
}, },
showItemList(itemList) { showItemList(itemList) {
this.$refs.scanList.openPopup(itemList); this.$refs.jobListPopup.openPopup(itemList);
}, },
selectedItem(item) { selectedItem(item) {
@ -450,8 +548,9 @@
this.selectItem(list[0]) this.selectItem(list[0])
} }
} else { } else {
this.showMessage("物料号[" + result.label.itemCode + "]批次[" + result.label.batch + this.showMessage("按来源库位[" + balance.locationCode + "]批次[" + result.label.batch +
']未查找到任务<br>' + "扫描[" + result.scanMessage + "]") "]物料号[" + result.label.itemCode + "]未查找到任务<br>" + "扫描[" + result
.scanMessage + "]")
} }
}).catch(error => { }).catch(error => {
this.showMessage(error + "<br>扫描[" + result.scanMessage + "]") this.showMessage(error + "<br>扫描[" + result.scanMessage + "]")

133
src/pages/repleinsh/record/directRepleinshRecord.vue

@ -6,10 +6,11 @@
</view> </view>
<view class="page-wraper" v-if="detailSource.length>0"> <view class="page-wraper" v-if="detailSource.length>0">
<view class="page-header"> <view class="page-header">
<view class="header_item" style="font-size:35rpx; padding: 10rpx;" > <view class="header-view">
来源库位 : {{fromLocationCode}} <view class="header_item" style="font-size:35rpx; padding: 10rpx;">
来源库位 : {{fromLocationCode}}
</view>
</view> </view>
<u-line />
</view> </view>
<view class="page-main"> <view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
@ -18,10 +19,10 @@
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" <record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowFromLocation="false" @removeItem="removeItem(index,item)" :isShowFromLocation="false" @removeItem="removeItem(index,item)"
:isShowToLocation="false" :isShowToLocation="false"
@updateData="updateData" @removePack="removePack"> :isShowParentToLocation="false"
@updateData="updateData" @removePack="removePack">
</record-com-detail-card> </record-com-detail-card>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
@ -31,7 +32,8 @@
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode" <requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode"
@getLocation='getToLocationCode' :locationAreaTypeList="toLocationAreaTypeList"></requiredLocation> @getLocation='getToLocationCode' :locationAreaTypeList="toLocationAreaTypeList">
</requiredLocation>
</view> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> <button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
@ -119,9 +121,9 @@
recommendLocationList: [], // recommendLocationList: [], //
fromWarehouseCode: '', // fromWarehouseCode: '', //
businessTypeCode: "Repleinment", businessTypeCode: "Repleinment",
toLocationCode:"", toLocationCode: "",
resultData:{}, resultData: {},
itemCode:"" itemCode: ""
}; };
}, },
onLoad(option) { onLoad(option) {
@ -145,10 +147,10 @@
mounted() {}, mounted() {},
methods: { methods: {
getBusinessType(){ getBusinessType() {
getBusinessType(this.businessTypeCode, res => { getBusinessType(this.businessTypeCode, res => {
if (res.success) { if (res.success) {
this.businessType=res.businessType; this.businessType = res.businessType;
this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses); this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses);
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList this.fromLocationAreaTypeList = res.fromLocationAreaTypeList
this.openScanPopup(); this.openScanPopup();
@ -159,7 +161,7 @@
}, },
getBalance(label, packageInfo, callback) { getBalance(label, packageInfo, callback) {
var filters = [] var filters = []
if (packageInfo.parentNumber) { if (packageInfo.parentNumber) {
var packingNumber = packageInfo.parentNumber + "," + label.packingNumber; var packingNumber = packageInfo.parentNumber + "," + label.packingNumber;
filters.push({ filters.push({
@ -174,7 +176,7 @@
value: label.packingNumber value: label.packingNumber
}) })
} }
filters.push({ filters.push({
column: "itemCode", column: "itemCode",
action: "==", action: "==",
@ -185,7 +187,7 @@
action: "==", action: "==",
value: label.batch value: label.batch
}) })
if (this.fromInventoryStatuses != null && this.fromInventoryStatuses != "") { if (this.fromInventoryStatuses != null && this.fromInventoryStatuses != "") {
filters.push({ filters.push({
column: "inventoryStatus", column: "inventoryStatus",
@ -193,7 +195,7 @@
value: this.fromInventoryStatuses value: this.fromInventoryStatuses
}) })
} }
var params = { var params = {
filters: filters, filters: filters,
pageNo: 1, pageNo: 1,
@ -205,20 +207,23 @@
this.showErrorMessage(err.message); this.showErrorMessage(err.message);
}) })
}, },
getScanResult(result) { getScanResult(result) {
this.setData(result); this.setData(result);
}, },
setData(result) { setData(result) {
let balance = result.balance; let balance = result.balance;
let label = result.label; let label = result.label;
let pack = result.package; let pack = result.package;
if(this.fromLocationCode&&this.fromLocationCode!=balance.locationCode){
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]在库位["+this.fromLocationCode+"]没有库存余额")
if (this.fromLocationCode && this.fromLocationCode != balance.locationCode) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]在库位[" + this
.fromLocationCode + "]没有库存余额")
return; return;
} }
var item = this.detailSource.find(res => { var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) { if (res.itemCode == balance.itemCode) {
return res return res
@ -234,17 +239,17 @@
} }
var itemp = createItemInfo(balance, pack); var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); // let newDetail = createDetailInfo(balance, pack); //
newDetail.parentNumber =pack.parentNumber; newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber =pack.number newDetail.packingNumber = pack.number
newDetail.packUnit =pack.packUnit; newDetail.packUnit = pack.packUnit;
newDetail.packQty=pack.packQty; newDetail.packQty = pack.packQty;
if(balance.lableQty){ if (balance.lableQty) {
newDetail.handleQty =balance.lableQty newDetail.handleQty = balance.lableQty
} }
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
this.detailSource.push(itemp) this.detailSource.push(itemp)
this.itemCode = balance.itemCode; this.itemCode = balance.itemCode;
this.fromLocationCode =balance.locationCode this.fromLocationCode = balance.locationCode
this.scanPopupGetFocus() this.scanPopupGetFocus()
} else { } else {
var detail = item.subList.find(r => { var detail = item.subList.find(r => {
@ -257,12 +262,12 @@
}) })
if (detail == undefined) { if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack); let newDetail = createDetailInfo(balance, pack);
newDetail.parentNumber =pack.parentNumber; newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber =pack.number newDetail.packingNumber = pack.number
newDetail.packUnit =pack.packUnit; newDetail.packUnit = pack.packUnit;
newDetail.packQty=pack.packQty; newDetail.packQty = pack.packQty;
if(balance.lableQty){ if (balance.lableQty) {
newDetail.handleQty =balance.lableQty newDetail.handleQty = balance.lableQty
} }
item.subList.push(newDetail); item.subList.push(newDetail);
this.scanPopupGetFocus() this.scanPopupGetFocus()
@ -274,8 +279,8 @@
} }
calcHandleQty(this.detailSource); calcHandleQty(this.detailSource);
}, },
showErrorMessage(message) { showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, res => {
@ -295,7 +300,7 @@
} }
} }
this.$forceUpdate(); this.$forceUpdate();
}, },
removeItem(index, item) { removeItem(index, item) {
@ -314,9 +319,9 @@
}, },
openScanPopup() { openScanPopup() {
if(this.businessType){ if (this.businessType) {
this.$refs.scanPopup.openScanPopup(this.businessType); this.$refs.scanPopup.openScanPopup(this.businessType);
}else { } else {
this.getBusinessType() this.getBusinessType()
} }
}, },
@ -339,18 +344,18 @@
}, },
commit() { commit() {
if(this.toLocationCode==""){ if (this.toLocationCode == "") {
this.showMessage("请输入目标库位") this.showMessage("请输入目标库位")
return; return;
} }
this.detailSource.forEach(item=>{ this.detailSource.forEach(item => {
item.subList.forEach(detail=>{ item.subList.forEach(detail => {
detail.toLocationCode=this.toLocationCode detail.toLocationCode = this.toLocationCode
detail.fromLocation =this.fromLocationCode detail.fromLocation = this.fromLocationCode
}) })
}) })
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
@ -408,25 +413,23 @@
// detail.toLocationCode = detail.toLocationCode // detail.toLocationCode = detail.toLocationCode
submitItem.qty = detail.handleQty; submitItem.qty = detail.handleQty;
submitItem.package = ""; submitItem.package = "";
submitItem.recordList=[ submitItem.recordList = [{
{ toInventoryStatus: detail.inventoryStatus,
toInventoryStatus:detail.inventoryStatus, fromPackingNumber: info.packingNumber,
fromPackingNumber:info.packingNumber, fromParentPackingNumber: detail.parentNumber,
fromParentPackingNumber: detail.parentNumber, fromBatch: info.batch,
fromBatch:info.batch,
toPackingNumber: info.packingNumber,
toPackingNumber:info.packingNumber,
toBatch: info.batch,
toBatch:info.batch, fromLocationCode: detail.locationCode,
fromLocationCode:detail.locationCode, toLocationCode: detail.toLocationCode,
toLocationCode:detail.toLocationCode, handleQty: detail.handleQty,
handleQty:detail.handleQty, fromPackUnit: detail.packUnit,
fromPackUnit:detail.packUnit, toPackUnit: detail.packUnit,
toPackUnit:detail.packUnit, fromPackQty: detail.packQty,
fromPackQty:detail.packQty, toPackQty: detail.packQty
toPackQty:detail.packQty }]
}
]
subList.push(submitItem) subList.push(submitItem)
} }
}) })
@ -480,7 +483,7 @@
this.toWarehouseCode = ''; this.toWarehouseCode = '';
this.detailSource = []; this.detailSource = [];
this.toLocationCode = ""; this.toLocationCode = "";
this.itemCode="" this.itemCode = ""
} }
} }
} }

Loading…
Cancel
Save