Browse Source

Merge branch 'hella_online_20240803' into master_hella

hella_online_20240829
陈薪名 3 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_IMAGE=http://172.21.32.13:81/admin-api
VITE_BASE_URL=http://172.22.32.9:81/api/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_IMAGE=http://172.21.32.13:81/admin-api
VITE_BASE_URL=http://172.22.32.8:81/api/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_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) {
var isCheck = false
var resultInfo = ""
if (switchList.length == 0) {
switchList = uni.getStorageSync("switch")
}
switchList = uni.getStorageSync("switch")
for (let item of switchList) {
if (item.code == code) {

43
src/common/label.js

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

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

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

4
src/mycomponents/balance/level.vue

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

4
src/mycomponents/common/comMessage.vue

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

144
src/mycomponents/job/jobFilter.vue

@ -1,40 +1,53 @@
<template>
<uni-popup ref="popup" >
<uni-popup ref="popup">
<view class="maskbox" @tap="maskClick"></view>
<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;">
<view class="uni-flex space-between u-col-center" style="width: 100%;">
<view class="" style="font-size: 32rpx;">
只看当天
</view>
<u-switch v-model="checkedTodayModel" active-color="#4DD865" inactive-color="#eee" size="35" @change="switchChangeToday"></u-switch>
<view class="" style="font-size: 32rpx;">
只看当天
</view>
<u-switch v-model="checkedTodayModel" active-color="#4DD865" inactive-color="#eee" size="35"
@change="switchChangeToday"></u-switch>
</view>
<view class="uni-flex space-between u-col-center" style="width: 100%;margin-top: 30rpx;">
<view class="" style="font-size: 32rpx;">
只看待处理
</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 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>
<!-- <u-input style="margin-left: 20rpx;" v-model="productionLineCode" :border="true"
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 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>
<u-input style="margin-left: 20rpx;" confirmType="search" v-model="fromLocationCode" :border="true"
placeholder="请输入来源库位" @confirm="fromLocationCodeConfirm" />
</view>
<view class="">
<!-- <view class="">
<view class="uni-flex u-row-center" style="margin-top: 30rpx;" v-if="isShowAsn">
<button class="filter_button" hover-class="filter_button_after"
@click="scanOtherClick">扫描ASN单号</button>
@ -43,8 +56,13 @@
<button class="filter_button" hover-class="filter_button_after"
@click="scanNumberClick">扫描任务编号</button>
</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>
</uni-popup>
<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>
@ -59,12 +77,14 @@
import winScanAsnNumber from "@/mycomponents/scan/winScanAsnNumber.vue"
export default {
emits: ["switchChangeToday", "switchChangeWait", "onScanNumber", "onScanAsnNumber","productionLineCode","fromLocationCode","fromLocationCodeConfirm"],
emits: ["switchChangeToday", "switchChangeWait", "onScanNumber", "onScanAsnNumber", "productionLineCode",
"fromLocationCode", "fromLocationCodeConfirm", "itemCodeConfirm", "onQuery"
],
components: {
winScanJobNumber,
winScanAsnNumber
},
props: {
checkedToday: {
type: Boolean,
@ -78,34 +98,45 @@
type: String,
default: ""
},
isShowAsn:{
isShowAsn: {
type: Boolean,
default: false
},
isShowJob:{
isShowJob: {
type: Boolean,
default: true
},
isShowFromLocationCode:{
isShowFromLocationCode: {
type: Boolean,
default: false
},
isShowProductionLineCode:{
isShowProductionLineCode: {
type: Boolean,
default: false
},
productionline:{
productionline: {
type: Array,
default: []
},
isShowItemCode: {
type: Boolean,
default: false
},
isShowQurery: {
type: Boolean,
default: false
}
},
data() {
return {
dataContent: {},
checkedTodayModel:false,
checkedWaitModel:false,
productionLineCode:'',// 线
fromLocationCode:'',//
checkedTodayModel: false,
checkedWaitModel: false,
productionLineCode: '', // 线
fromLocationCode: '', //
itemCode: '', //
creationTime: '',
status: ''
}
},
watch: {
@ -124,18 +155,47 @@
deep: true
}
},
mounted() {
},
mounted() {},
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){
var lineCode=e
this.$emit("productionLineCode", lineCode)
productionLineCodeConfirm(e) {
var lineCode = e
this.productionLineCode = e;
// this.$emit("productionLineCode", lineCode)
},
//
fromLocationCodeConfirm(){
this.$emit("fromLocationCode", this.fromLocationCode)
fromLocationCodeConfirm() {
// this.$emit("fromLocationCode", this.fromLocationCode)
},
itemCodeConfirm() {
},
//
maskClick() {
@ -149,22 +209,26 @@
this.$refs.popup.close()
},
switchChangeToday(isOn) {
let creationTime = '';
if (isOn) {
creationTime = getTodayDate();
}
this.creationTime = creationTime;
this.$emit("switchChangeToday", isOn, creationTime)
this.closeScanPopup()
if (!this.isShowQurery) {
this.closeScanPopup()
}
},
switchChangeWait(isOn) {
let status = "1,2";
if(isOn){
status="1"
if (isOn) {
status = "1"
}
this.status = status;
this.$emit("switchChangeWait", isOn, status)
this.closeScanPopup()
if (!this.isShowQurery) {
this.closeScanPopup()
}
},
scanNumberClick() {
@ -199,4 +263,4 @@
height: 100vh;
z-index: 0;
}
</style>
</style>

6
src/mycomponents/record/recordComDetailCard.vue

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

83
src/mycomponents/scan/winComScanBalance.vue

@ -34,7 +34,8 @@
import {
getBalanceByParams,
getBasicItemByCode
getBasicItemByCode,
getBalanceByFilter
} from '@/api/request2.js';
import {
@ -77,6 +78,10 @@
verifyCategory: {
type: Boolean,
default: false
},
isCheckLocationBalance: {
type: Boolean,
default: true
}
},
data() {
@ -91,6 +96,7 @@
fromLocation: '',
fromLocationList: [],
fromLocationAreaTypeList: [],
toLocationAreaTypeList: [],
locationOnFocus: false,
businessType: {},
inventoryStatus: [],
@ -109,9 +115,9 @@
this.businessType = businessType
this.fromInventoryStatuses = getDirectoryItemArray(businessType.outInventoryStatuses)
this.fromLocationAreaTypeList = getDirectoryItemArray(businessType.outAreaTypes)
this.toLocationAreaTypeList = getDirectoryItemArray(businessType.inAreaTypes)
this.itemTypesList = getDirectoryItemArray(businessType.itemTypes)
this.$refs.popup.open('bottom')
},
getScanResult(result) {
@ -121,7 +127,70 @@
return;
}
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)
})
},
getItemCodeType(itemCode, callBack) {
uni.showLoading({
title: "加载中",
@ -186,9 +255,7 @@
if (this.verifyCategory) {
if (result.category == 'LCJ' || result.category == 'BJ') {
callBack()
}
else
{
} else {
this.showErrorMessage("扫描物料的种类不是【量产件】或者【备件】")
}
} else {
@ -213,6 +280,7 @@
this.showErrorMessage(error)
})
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
@ -222,6 +290,7 @@
}
});
},
selectBalanceItem(item) {
this.resultData.balance = item
this.$emit("getBalance", this.resultData)

2
src/pages.json

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

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

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

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

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

3
src/pages/fg/fgChange.vue

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

28
src/pages/fg/receiptByPlan.vue

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -35,7 +35,7 @@
</view> -->
<!-- <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;
margin-left: 20rpx;
margin-right: 20rpx;
@ -49,7 +49,7 @@
placeholder="请选择库位" @confirm="fromLocationUpdate"
:inputStyle="inputStyleObject"></uni-combox>
</view>
</view>
</view> -->
<view class="">
<view class="">
@ -231,7 +231,7 @@
that.fromInventoryStatuses = this.jobContent.outInventoryStatuses
that.toLocation = that.dataContent[0];
that.toLocationCode = that.dataContent[0].toLocationCode;
that.fromLocationList = that.getFromLocationList();
// that.fromLocationList = that.getFromLocationList();
}
},
@ -239,23 +239,23 @@
this.$refs.balanceSelect.openPopup(items);
},
getFromLocationList() {
let list = [];
this.dataContent.forEach(location => {
location.Items.forEach(item => {
item.Locations.forEach(f => {
let item = list.find(l => l == f.fromLocationCode);
if (item == undefined) {
list.push(f.fromLocationCode)
}
})
})
});
//
list = uniqueArray(list);
this.fromLocationCode = list[0];
return list;
},
// getFromLocationList() {
// let list = [];
// this.dataContent.forEach(location => {
// location.Items.forEach(item => {
// item.Locations.forEach(f => {
// let item = list.find(l => l == f.fromLocationCode);
// if (item == undefined) {
// list.push(f.fromLocationCode)
// }
// })
// })
// });
// //
// list = uniqueArray(list);
// this.fromLocationCode = list[0];
// return list;
// },
fromLocationUpdate(fromlocation) {
let location = this.fromLocationList.find(r => r == fromlocation)
@ -268,12 +268,12 @@
onScanResult(result) {
try {
let that = this;
if (that.fromLocationCode == '') {
that.showErrorMessage('请选择来源库位', res => {
that.$refs.toLocationCombox.onFocus();
});
return;
}
// if (that.fromLocationCode == '') {
// that.showErrorMessage('', res => {
// that.$refs.toLocationCombox.onFocus();
// });
// return;
// }
let packageInfo = result.package;
let itemCode = result.label.itemCode;
let packingCode = result.label.packingNumber;
@ -287,7 +287,7 @@
)
return;
} else {
var params = {
itemCode: result.package.itemCode,
batch: result.label.batch,
@ -318,9 +318,7 @@
if (result.label.packingNumber != result.balance.packingNumber) {
result.balance.handleQty = Number(result.label.qty)
}
else
{
} else {
result.balance.handleQty = Number(result.balance.qty)
}
this.afterGetBalance(result.label, result.balance, result.package);
@ -333,91 +331,6 @@
uni.hideLoading()
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) {
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) {
this.afterGetBalance(this.label, balance, this.packageInfo);
},
@ -569,6 +427,7 @@
let packingCode = label.packingNumber;
let lot = label.batch;
let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
that.fromLocationCode = balance.locationCode;
let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode);
if (fromLocation != undefined) {
let batch = fromLocation.Batchs.find(r => r.batch == lot);
@ -580,7 +439,7 @@
let record = batch.Records.find(r => r.packingNumber == packingCode);
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);
if (recommend != undefined) {
that.addRecord(batch, label, balance, packageInfo)
@ -631,11 +490,8 @@
}
}
} else {
that.showErrorMessage('未查找到推荐库位【' + that.fromLocationCode + '】的发料明细',
res => {
that.getfocus();
}
)
let locaion = that.createLocationInfo(label, balance, packageInfo);
item.Locations.push(locaion);
}
} catch (e) {
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) {
let batch = {
batch: data.batch,
@ -672,7 +545,7 @@
// qty: Number(balance.qty),
// qty: Number(label.qty) > Number(balance.qty) ? Number(balance.qty) : Number(label.qty),
qty: balance.handleQty,
handleQty:balance.handleQty,
handleQty: balance.handleQty,
uom: balance.uom,
inventoryStatus: balance.inventoryStatus,
balance: balance,
@ -681,7 +554,7 @@
packUnit: packageInfo.packUnit,
packQty: packageInfo.packQty
}
return record;
},

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

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

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

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

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

@ -1,7 +1,7 @@
<template>
<view class="page-wraper">
<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 class="page-wraper" v-if="detailSource.length>0">
<view class="page-header">
@ -16,7 +16,9 @@
<view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowFromLocation="false" @removeItem="removeItem(index,item)"
:isShowToLocation="false" @updateData="updateData" @removePack="removePack">
:isShowToLocation="false"
:isShowParentToLocation="false"
@updateData="updateData" @removePack="removePack">
</record-com-detail-card>
</view>
@ -43,13 +45,10 @@
</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>
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode">
</winComScanBalance>
<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>
@ -98,6 +97,7 @@
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
export default {
components: {
@ -109,7 +109,8 @@
winScanPackAndLocation,
recordComDetailCard,
recordDetailCard,
balanceSelect
balanceSelect,
winComScanBalance
},
data() {
return {
@ -130,24 +131,16 @@
positionList: [],
show: false,
positionInfo: "请选择生产线",
resultData: {}
resultData: {},
itemCode:""
};
},
onLoad(option) {
uni.setNavigationBarTitle({
title: option.title
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)
}
});
this.getBusinessType()
// if (this.positionList.length == 0) {
getWorkShopLineStation().then(res => {
@ -177,217 +170,65 @@
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);
}
}
getBusinessType() {
getBusinessType(this.businessTypeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses);
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList
this.openScanPopup();
} 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 +
'】已经有库存余额,请重新扫描')
}
}
this.showErrorMessage(res.message)
}
})
},
showBalanceSelect(items) {
this.$refs.balanceSelect.openPopup(items);
});
},
selectBalanceItem(balance) {
this.resultData.balance =balance;
this.afterGetBalance(this.resultData);
getScanResult(result) {
this.setData(result);
},
afterGetBalance(result){
setData(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 + "]已经在列表中")
}
}
if (this.fromLocationCode && this.fromLocationCode != balance.locationCode) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]在库位[" + this
.fromLocationCode + "]没有库存余额")
return;
}
},
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) {
if (this.itemCode != "" && this.itemCode != balance.itemCode) {
this.showErrorMessage("请扫描物料为【" + this.itemCode + "】的箱码")
return;
}
if (this.fromWarehouseCode == '') {
this.fromWarehouseCode = balance.warehouseCode;
}
var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
newDetail.packUnit = packUnit;
newDetail.packQty = packQty;
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
calcHandleQty(this.detailSource);
this.itemCode = balance.itemCode;
this.fromLocationCode = balance.locationCode
this.scanPopupGetFocus()
} else {
var detail = item.subList.find(r => {
if (r.packingNumber == balance.packingNumber &&
if (r.packingNumber == pack.number &&
r.batch == balance.batch &&
r.locationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) {
@ -396,50 +237,22 @@
})
if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack);
newDetail.packUnit = packUnit;
newDetail.packQty = packQty;
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
item.subList.push(newDetail);
calcHandleQty(this.detailSource);
this.scanPopupGetFocus()
} else {
if (detail.scaned == true) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中")
this.showErrorMessage("箱码[" + detail.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);
}
calcHandleQty(this.detailSource);
},
showErrorMessage(message) {
@ -532,11 +345,11 @@
},
openScanPopup() {
if (this.fromLocationCode == "") {
this.showFromLocationPopup();
return
if (this.businessType) {
this.$refs.scanPopup.openScanPopup(this.businessType);
} else {
this.getBusinessType()
}
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType);
},
showFromLocationPopup() {
@ -675,16 +488,6 @@
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 => {
@ -710,7 +513,8 @@
this.fromWarehouseCode = '';
this.toWarehouseCode = '';
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>
</view>
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' bussinessCode="OverPackage">
<winComScanBalance ref="scanPopup"
@getBalance='getScanResult'
bussinessCode="OverPackage"
:isCheckLocationBalance="false"
>
</winComScanBalance>

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

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

6
src/pages/point/index.vue

@ -199,7 +199,8 @@
}, 1000)
} else {
var url = this.picUrl[index]
let i = this.picUrl.length - 1 - index
var url = this.picUrl[i]
// #ifdef APP
plus.io.resolveLocalFileSystemURL(url, (entry) => {
// entrytest.html
@ -207,7 +208,8 @@
let fileReader = new plus.io.FileReader();
fileReader.onloadend = (evt) => {
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)
}
fileReader.readAsDataURL(file);

39
src/pages/pointPutawayJob/index.vue

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

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

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

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

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

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

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

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

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

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

@ -232,9 +232,9 @@
that.jobStatus = res.data.status
that.jobToLocationCode = that.subList[0].toLocationCode
that.productionLineCode = that.subList[0].productionLineCode;
if (that.jobContent.allowModifyLocation == 'FALSE') {
that.toLocationCode = that.subList[0].toLocationCode
}
// if (that.jobContent.allowModifyLocation == 'FALSE') {
// that.toLocationCode = that.subList[0].toLocationCode
// }
that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes)
that.detailSource = getDataSource(that.subList)
@ -441,13 +441,14 @@
// this.showErrorMessage("0,")
// return;
// }
var valiDate = getSwitchInfoByCode("fgProductReceipCommitValidate")
//
if(valiDate){
if (!this.checkLocation()) {
return
}
}else{
this.toLocationCode = this.jobToLocationCode
}
this.detailSource.forEach(item => {
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" />
<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>
<comMessage ref="comMessage"></comMessage>
</view>
@ -79,16 +79,16 @@
status: '1,2', //
detailOptions: [],
detailGiveupOptions: [],
scanMessage:""
scanMessage: ""
};
},
// type = 'assemble'
// type = 'predict'
props: {
type: 'assemble',
title: {
type: String,
default: ''
type: 'assemble',
title: {
type: String,
default: ''
},
},
@ -99,7 +99,7 @@
this.getList('refresh');
},
onPullDownRefresh() {
this.getList('refresh');
@ -125,14 +125,14 @@
}
},
methods: {
onReachBottom() {
console.log('onReachBottom',this.loadingType)
//
if (this.loadingType == 'loading' || this.loadingType == 'noMore') {
return;
}
this.getList("more");
methods: {
onReachBottom() {
console.log('onReachBottom', this.loadingType)
//
if (this.loadingType == 'loading' || this.loadingType == 'noMore') {
return;
}
this.getList("more");
},
refresh() {
this.getList('refresh');
@ -161,11 +161,11 @@
column: "status",
action: "in",
value: this.status
})
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
filters.push({
column: "type",
@ -187,8 +187,8 @@
var list = res.data.list;
this.totalCount = res.data.total
//
updateTitle(this.title+"(" + this.totalCount + ")");
//
updateTitle(this.title + "(" + this.totalCount + ")");
this.loadingType = "more";
if (list == null || list.length == 0) {
this.loadingType = "noMore";
@ -202,7 +202,7 @@
if (type === "refresh") {
uni.stopPullDownRefresh();
}
updateTitle(this.title+"(" + this.totalCount + ")");
updateTitle(this.title + "(" + this.totalCount + ")");
this.loadingType = "";
uni.hideLoading();
that.showMessage(error)
@ -212,18 +212,21 @@
openJobDetail(item, scanMessage = '') {
if (this.type == 'predict') {
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') {
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 {
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) {
@ -349,11 +352,11 @@
},
getScanResult(result) {
try {
this.scanMessage =""
this.scanMessage = ""
var filters = [{
column: "packingNumber",
action: "==",
value: result.label.packingNumber
action: "in",
value: result.package.number + "," + result.package.parentNumber
},
{
column: "batch",
@ -369,16 +372,16 @@
column: "itemCode",
action: "==",
value: result.label.itemCode
},
{
column: "type",
action: "==",
value: this.type
},
{
column: "status",
action: "in",
value: '1,2',
},
{
column: "type",
action: "==",
value: this.type
},
{
column: "status",
action: "in",
value: '1,2',
},
{
column: "accept_user_id",
@ -391,29 +394,29 @@
pageNo: 1,
pageSize: 100,
}).then(res => {
this.scanMessage =result.scanMessage
this.scanMessage = result.scanMessage
let resultList = res.data.list;
if (resultList.length > 0) {
resultList.forEach(item => {
item.title = item.number;
item.selected = false
})
let list = []
resultList.forEach(item=>{
if(!list.find(subItem=>subItem.title==item.title)){
list.push(item)
}
})
if (resultList.length > 0) {
resultList.forEach(item => {
item.title = item.number;
item.selected = false
})
let list = []
resultList.forEach(item => {
if (!list.find(subItem => subItem.title == item.title)) {
list.push(item)
}
})
if (list.length > 1) {
this.$refs.jobList.openList(list)
} else {
this.selectItem(list[0])
}
} else {
this.showMessage("未查找到任务<br>"+"扫描["+result.scanMessage+"]")
this.showMessage("未查找到任务<br>" + "扫描[" + result.scanMessage + "]")
}
}).catch(error => {
this.showMessage(error+"<br>扫描["+result.scanMessage+"]")
this.showMessage(error + "<br>扫描[" + result.scanMessage + "]")
})
} catch (e) {

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

@ -276,7 +276,7 @@
//
if (this.jobContent.allowModifyInventoryStatus == "TRUE") {
this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus +
']不一致,是否继续退货?', res => {
']不一致,是否继续回收?', res => {
if (res) {
itemDetail.scaned = true;
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>
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask" :isShowProductionLineCode="true"
@productionLineCode="productionLineCode"
:checkedWaitTask="checkedWaitTask" :isShowProductionLineCode="true" @productionLineCode="productionLineCode"
:productionline="productionLineList">
</job-filter>
<view v-if="jobList.length>0">
@ -85,7 +84,7 @@
title: '',
scanMessage: "",
productionLineList: [],
productionLine:""
productionLine: ""
};
},
onLoad(option) {
@ -136,7 +135,7 @@
methods: {
productionLineCode(productionLineCode) {
this.productionLine = productionLineCode
this.getList('refresh', this.productionLine)
this.getList('refresh', this.productionLine)
},
getProductionReceiptJobByProductionline() {
getProductionReceiptJobByProductionline().then(res => {
@ -353,8 +352,8 @@
this.scanMessage = ""
var filters = [{
column: "packingNumber",
action: "==",
value: result.label.packingNumber
action: "in",
value: result.package.number + "," + result.package.parentNumber
},
{
column: "batch",

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

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

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

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

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

@ -8,7 +8,7 @@
<text class="fr" @click="closeScanPopup()">关闭</text>
</view>
<view class="uni-flex uni-row" style="align-items: center;
<!-- <view class="uni-flex uni-row" style="align-items: center;
background-color: #fff;
margin-left: 20rpx;
margin-right: 20rpx;
@ -21,7 +21,7 @@
<uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请选择库位"
@confirm="fromLocationUpdate"></uni-combox>
</view>
</view>
</view> -->
<view class="">
<view class="">
@ -83,13 +83,14 @@
} from '@/common/array.js';
import {
getWorkShopLineStation,
getBalanceByFilter
getBalanceByFilter,
getBalanceByParams
} from '@/api/request2.js';
import {
calc
} from '@/common/calc.js';
import {
uniqueArray
} from '@/common/basic.js';
@ -100,8 +101,8 @@
import {
getDirectoryItemArray
} from '../../../common/directory.js';
import {
getLabelInfo
} from '@/common/label.js';
@ -162,8 +163,8 @@
this.$refs.popup.open('bottom')
}, 500)
},
openScanPopupForJobSimulate(content, jobcontent,scanMessage) {
openScanPopupForJobSimulate(content, jobcontent, scanMessage) {
this.issueRecord = [];
this.dataContent = content;
this.jobContent = jobcontent;
@ -174,7 +175,7 @@
} else {
this.showErrorMessage(callback.message)
}
})
},
@ -192,7 +193,7 @@
that.fromInventoryStatuses = this.jobContent.outInventoryStatuses
that.toLocation = that.dataContent[0];
that.toLocationCode = that.dataContent[0].toLocationCode;
that.fromLocationList = that.getFromLocationList();
// that.fromLocationList = that.getFromLocationList();
}
},
@ -200,26 +201,26 @@
this.$refs.balanceSelect.openPopup(items);
},
getFromLocationList() {
let list = [];
let location = this.dataContent.find(r => r.toLocationCode == this.toLocationCode);
if (location != undefined) {
location.Items.forEach(item => {
item.Locations.forEach(f => {
list.push(f.fromLocationCode)
})
})
//
list = uniqueArray(list);
this.fromLocationCode = list[0];
return list;
} else {
this.$refs.comMessage.showErrorMessages('需求库位【' + this.toLocationCode + '】不存在', res => {
this.toLocationCode = '';
});
}
},
// getFromLocationList() {
// let list = [];
// let location = this.dataContent.find(r => r.toLocationCode == this.toLocationCode);
// if (location != undefined) {
// location.Items.forEach(item => {
// item.Locations.forEach(f => {
// list.push(f.fromLocationCode)
// })
// })
// //
// list = uniqueArray(list);
// this.fromLocationCode = list[0];
// return list;
// } else {
// this.$refs.comMessage.showErrorMessages('' + this.toLocationCode + '', res => {
// this.toLocationCode = '';
// });
// }
// },
fromLocationUpdate(fromlocation) {
let location = this.fromLocationList.find(r => r == fromlocation)
@ -228,15 +229,44 @@
this.showErrorMessage('发料库位【' + fromlocation + '】不存在')
}
},
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 {
let that = this;
if (that.fromLocationCode == '') {
that.showErrorMessage('请选择来源库位', res => {
that.$refs.toLocationCombox.onFocus();
});
return;
}
// if (that.fromLocationCode == '') {
// that.showErrorMessage('', res => {
// that.$refs.toLocationCombox.onFocus();
// });
// return;
// }
let packageInfo = result.package;
let itemCode = result.label.itemCode;
let packingCode = result.label.packingNumber;
@ -250,115 +280,50 @@
)
return;
} 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({
title: '加载中',
title: '查询中',
mask: true
})
this.getBalance(result.label, packageInfo, balances => {
this.packageInfo = packageInfo;
//
let s = '';
if (!result.package.parentNumber) {
if (balances.list.length == 0) {
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
getBalanceByParams(params).then(res => {
if (res.data.length == 0) {
var status = getInventoryStatusDesc(params.inventoryStatus)
var areaType = getListLocationAreaTypeDesc(params.areaType)
var hint =
"按物料号 [" + params.itemCode + "] <br>" +
"包装号 [" + params.packingNumber + "] <br>" +
"批次 [" + 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 {
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);
}
result.balance.handleQty = Number(result.balance.qty)
}
this.afterGetBalance(result.label, result.balance, result.package);
} 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 +
'】已经有库存余额,请重新扫描')
}
// //
// 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 {
// }
}
//
this.$refs.balanceSelect.openPopup(res.data);
}
uni.hideLoading();
});
// 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();
// });
uni.hideLoading()
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
}
} catch (e) {
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) {
this.afterGetBalance(this.label, balance, this.packageInfo);
},
@ -426,7 +342,10 @@
let packingCode = label.packingNumber;
let lot = label.batch;
let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
that.fromLocationCode = balance.locationCode;
let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode);
//
if (fromLocation != undefined) {
let batch = fromLocation.Batchs.find(r => r.batch == lot);
if (batch != undefined) {
@ -483,11 +402,8 @@
}
}
} else {
that.showErrorMessage('未查找到推荐库位【' + that.fromLocationCode + '】的发料明细',
res => {
that.getfocus();
}
)
let locaion = that.createLocationInfo(label, balance, packageInfo);
item.Locations.push(locaion);
}
} catch (e) {
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) {
let batch = {
batch: label.batch,
qty: 0,
uom: label.uom,
Records: []
}
let record = {}
if (balance == null) {
record = this.creatRecordByBalance(label, packageInfo);
if (balance != null) {
record = this.creatRecordByBalance(balance, packageInfo);
batch.handleQty = Number(label.qty)
} else {
record = this.creatRecordByLabel(balance, packageInfo);
record = this.creatRecordByLabel(label, packageInfo);
batch.handleQty = Number(balance.qty)
}
@ -535,7 +466,7 @@
toLocationCode: this.toLocationCode,
supplierCode: label.supplierCode,
packUnit: packageInfo.packUnit,
packQty: packageInfo.packQty
packQty: packageInfo.packQty,
}
return record;
},
@ -659,16 +590,16 @@
},
packGetFocus() {
if(this.$refs.comscan){
if (this.$refs.comscan) {
this.$refs.comscan.getfocus();
}
},
packLoseFocus() {
if(this.$refs.comscan){
if (this.$refs.comscan) {
this.$refs.comscan.losefocus();
}
},
showMessage(message, callback) {
setTimeout(r => {

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

@ -196,9 +196,9 @@
.jobContent, that.scanMessage);
}
let timer = setTimeout(r => {
let timer = setTimeout(r => {
that.resizeCollapse();
if(timer){
if (timer) {
timer = null
clearTimeout(timer)
}
@ -278,7 +278,6 @@
});
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
repleinshJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
@ -333,43 +332,6 @@
record.toPackUnit = r.packUnit;
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);
})
commitSubList.push(deepCopyData(subItem));

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

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

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

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

Loading…
Cancel
Save