Browse Source

Merge branch 'hella_online_20240803' into master_hella

hella_online_20240829
陈薪名 3 months ago
parent
commit
77f4d90376
  1. 46
      src/api/request2.js
  2. 17
      src/common/record.js
  3. 7
      src/mycomponents/balance/balance.vue
  4. 2
      src/mycomponents/job/jobFilter.vue
  5. 134
      src/mycomponents/query/balanceQuery.vue
  6. 20
      src/mycomponents/record/recordComDetailCard.vue
  7. 5
      src/mycomponents/scan/winComScanFg.vue
  8. 52
      src/mycomponents/scan/winScanPackage.vue
  9. 274
      src/mycomponents/scan/winScanParentPackage.vue
  10. 55
      src/pages.json
  11. 59
      src/pages/fg/receiptByPlan.vue
  12. 51
      src/pages/inventoryMove/coms/comMoveJob.vue
  13. 2
      src/pages/inventoryMove/job/okToHoldMoveJob.vue
  14. 69
      src/pages/issue/coms/comScanIssuePack.vue
  15. 732
      src/pages/issue/coms/comScanIssuePack0816.vue
  16. 27
      src/pages/issue/job/issueDetail.vue
  17. 608
      src/pages/issue/job/issueDetail0816.vue
  18. 95
      src/pages/issue/job/issueJob.vue
  19. 746
      src/pages/issue/job/issueJob0816.vue
  20. 90
      src/pages/issue/record/directIssue.vue
  21. 256
      src/pages/issue/record/directIssue0816.vue
  22. 27
      src/pages/login/index.vue
  23. 21
      src/pages/productPutaway/record/productPutawayRecord.vue
  24. 9
      src/pages/productReceipt/job/fgProductReceiptDetail.vue
  25. 13
      src/pages/productReceipt/job/productReceiptDetail.vue
  26. 2
      src/pages/productionReceipt/job/productionReceiptDetail.vue
  27. 11
      src/pages/productionReceipt/job/productionReceiptJob.vue
  28. 91
      src/pages/putaway/record/putawayRecord.vue
  29. 53
      src/pages/repleinsh/coms/comScanReplishPack.vue
  30. 59
      src/pages/repleinsh/job/repleinshDetail.vue
  31. 64
      src/pages/repleinsh/job/repleinshJob.vue
  32. 79
      src/pages/repleinsh/record/directRepleinshRecord.vue

46
src/api/request2.js

@ -568,7 +568,7 @@ export function getBasicItemByCodeSenior(itemCode) {
}],
pageNo: 1,
pageSize: 1000
}
}
return request({
url: baseApi + "/wms/itembasic/senior",
method: "post",
@ -4114,6 +4114,21 @@ export function getBalanceByFilter(param) {
});
}
/**
* 查询库存事务
* @param {*}
*
*/
export function getTransactionByFilter(param) {
return request({
url: baseApi + "/wms/transaction/senior",
method: "post",
data: param,
});
}
/**
* 查询管理精度多个物料多个库位
* @param {*}
@ -4492,4 +4507,31 @@ export function fgChangeCommit(params) {
method: "post",
data: params,
});
}
}
/**
* 查询物料与库位关系
*/
export function checkItemCodeAndLocation(params) {
return request({
url: baseApi + "/wms/location/checkRecommendLocation",
method: "post",
data: params,
});
}
/**
* 库存余额根据业务类型汇总接口
*/
export function getBalanceByBusinessType(params) {
return request({
url: baseApi + "/wms/balance/summaryByBusinessType",
method: "get",
data: params,
});
}

17
src/common/record.js

@ -39,7 +39,7 @@ export function createDetailInfo(balance, pack) {
let detail = deepCopyData(balance);
detail.balanceQty = new Decimal(detail.qty).toNumber()
detail.qty = new Decimal(detail.qty).toNumber();
detail.packQty = pack.packQty?new Decimal(pack.packQty).toNumber():0
detail.packQty = pack.packQty ? new Decimal(pack.packQty).toNumber() : 0
detail.packUnit = pack.packUnit
detail.handleQty = new Decimal(detail.qty).toNumber();
detail.package = pack;
@ -49,6 +49,21 @@ export function createDetailInfo(balance, pack) {
return detail;
}
export function createDetailByPackInfo(pack) {
// data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus;
// data.inventoryStatus = data.inventoryStatus;
let detail = deepCopyData(pack); detail.scaned = true;
detail.balanceQty = new Decimal(detail.qty).toNumber()
detail.qty = new Decimal(detail.qty).toNumber();
detail.packQty = pack.packQty ? new Decimal(pack.packQty).toNumber() : 0
detail.packUnit = pack.packUnit
detail.handleQty = new Decimal(detail.qty).toNumber();
detail.package = pack;
return detail;
}
//计算实际数量
export function calcHandleQty(detailSource) {
for (let item of detailSource) {

7
src/mycomponents/balance/balance.vue

@ -2,7 +2,8 @@
<view :class="dataContent.scaned?'scan_view':''" style="background-color: #ffffff;margin-bottom: 1px; ">
<view class="uni-flex uni-row space-between" style="align-items: center">
<view>
<pack v-if="dataContent.parentNumber" title="父包装" :packingCode="dataContent.parentNumber"></pack>
<pack v-if="isShowParentPack &&dataContent.parentNumber" title="父包装"
:packingCode="dataContent.parentNumber"></pack>
<pack v-if="isShowPack && dataContent.packingNumber" :packingCode="dataContent.packingNumber"></pack>
<batch v-if="isShowBatch && dataContent.batch" :batch="dataContent.batch"></batch>
<location title="来源库位" v-if="isShowFromLocation" :locationCode="dataContent.locationCode"></location>
@ -91,6 +92,10 @@
type: Boolean,
default: false
},
isShowParentPack: {
type: Boolean,
default: true
},
},
watch: {

2
src/mycomponents/job/jobFilter.vue

@ -198,6 +198,8 @@
return params;
},
reset(){
this.checkedTodayModel = false
this.checkedWaitModel = false
this.productionLineCode = ''
this.fromLocationCode = ''
this.fromAreaCode = ''//

134
src/mycomponents/query/balanceQuery.vue

@ -39,28 +39,28 @@
</view>
<view class="split_line"></view>
</view>
<scroll-view scroll-x="true" v-if="tableData.length>0" style="width: 330px; display: flex; align-items: center; justify-content: center; ">
<view style="width: 330px; display: flex;justify-content: center; background-color: #fff; padding-bottom: 150rpx;">
<scroll-view scroll-x="true" v-if="tableData.length>0"
style="width: 330px; display: flex; align-items: center; justify-content: center; ">
<view
style="width: 330px; display: flex;justify-content: center; background-color: #fff; padding-bottom: 150rpx;">
<uni-table border stripe emptyText="暂无更多数据">
<!-- 表头行 -->
<uni-tr>
<uni-th width="60" style="font-weight: 800;" align="left">序号</uni-th>
<uni-th width="60" align="left">批次</uni-th>
<uni-th width="50" align="left">库位</uni-th>
<uni-th width="100" align="left">库位</uni-th>
<uni-th width="60" align="left">状态</uni-th>
<uni-th width="120" align="left">数量</uni-th>
</uni-tr>
<!-- 表格数据行 -->
<uni-tr v-for="(item, index) in tableData" :key="index">
<uni-td>{{index+1}}</uni-td>
<uni-td>{{item.batch}}</uni-td>
<uni-td>{{item.locationCode}}</uni-td>
<uni-td>{{statusDesc(item.inventoryStatus)}}</uni-td>
<uni-td>{{item.qty}}</uni-td>
<uni-td>{{item.totalQty}}</uni-td>
</uni-tr>
</uni-table>
<view class="uni-flex" style=" flex-direction: column; position: fixed; bottom: 0; margin-bottom: 100rpx; background-color: #fff; width: 100%; align-items: center;" >
<!-- <view class="uni-flex" style=" flex-direction: column; position: fixed; bottom: 0; margin-bottom: 100rpx; background-color: #fff; width: 100%; align-items: center;" >
<view class="" style="width: 100%; display: flex; justify-content: center; font-size: 32rpx;margin-top: 10rpx;margin-bottom: 10rpx;">
<view class="" >当前页{{ current }}总数{{ total }}每页{{ pageSize }}
</view>
@ -68,24 +68,26 @@
</view>
<uni-pagination :current="current" :total="total" :show-icon="true"
@change="change" />
</view>
</view> -->
</view>
</scroll-view>
</scroll-view>
<button @click="closeDrawer" type="primary" style="padding-left: 20rpx;">关闭</button>
<button @click="closeDrawer" type="primary" style="padding-left: 20rpx; width: 100%;">关闭</button>
</view>
</uni-drawer>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getBasicItemByCodeSenior,
getBalanceByBusinessType
} from '@/api/request2.js';
import {
@ -102,80 +104,7 @@
itemCodeResult: [],
current: 1,
total: 18,
tableData: [{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 1
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 2
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 3
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 4
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 3
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 4
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 3
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 4
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 3
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 4
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 3
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 4
}
]
tableData: []
}
},
props: {
@ -183,10 +112,10 @@
// type: Object,
// default: {}
// },
// isShowPack: {
// type: Boolean,
// default: true
// }
businessTypeCode: {
type: String,
default: ""
}
},
watch: {
@ -211,30 +140,35 @@
selectItemCode(item) {
this.itemCode = item.code
this.itemCodeResult = []
this.getBalanceByBusiness(this.itemCode, this.businessTypeCode)
},
clearItemCode() {
this.itemCode = ""
this.itemCodeResult = []
this.tableData =[]
},
onConfirmItemCode() {
if (!this.itemCode) {
this.showErrorMessage("物料号为空,请先输入物料号")
return;
}
this.tableData=[]
uni.showLoading({
title: "加载中",
mask: true
})
getBasicItemByCodeSenior(this.itemCode).then(res => {
uni.hideLoading()
if (res.data && res.data.list.length > 0) {
if (res.data.list.length == 1) {
if (res.data.list.length == 1) {
this.itemCode = res.data.list[0].code
this.getBalanceByBusiness(this.itemCode, this.businessTypeCode)
} else {
uni.hideLoading()
this.itemCodeResult = res.data.list
}
} else {
uni.hideLoading()
this.showErrorMessage("未查找到物料[" + this.itemCode + "]")
}
@ -243,6 +177,26 @@
this.showErrorMessage(error)
})
},
getBalanceByBusiness(itemCode, businessType) {
var params = {
itemCode: itemCode,
businessType: businessType,
inOrOut:"out"
}
getBalanceByBusinessType(params).then(res => {
uni.hideLoading()
if (res.data && res.data.length > 0) {
this.tableData = res.data
} else {
this.showErrorMessage("系统异常:按"+res.msg+"未查找到库存")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
showDrawer() {
this.$refs.showRight.open();
},

20
src/mycomponents/record/recordComDetailCard.vue

@ -9,7 +9,8 @@
:isShowBalanceQty="isShowBalanceQty"></item-qty>
<view style="margin-left: 10px; margin-top: 5px;">
<pack title='父包装' :packingCode='dataContent.containerNumber'></pack>
<location v-if="isShowParentToLocation" title='目标库位' :locationCode='dataContent.toLocationCode'></location>
<location v-if="isShowParentToLocation" title='目标库位'
:locationCode='dataContent.toLocationCode'></location>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
@ -21,7 +22,7 @@
:right-options="detail.scaned?scanOptions:detailOptions">
<balance :dataContent="detail" :isShowStdPack="false" :isShowStatus="isShowStatus"
:isShowPack="true" :isShowFromLocation="isShowFromLocation"
:isShowToLocation="isShowToLocation">
:isShowToLocation="isShowToLocation" :isShowParentPack="isShowParentPack">
</balance>
</uni-swipe-action-item>
</uni-swipe-action>
@ -100,6 +101,17 @@
type: Boolean,
default: false
},
isShowParentPack: {
type: Boolean,
default: true
},
isShowModifedLocation: {
type: Boolean,
default: false
},
},
watch: {
@ -137,7 +149,7 @@
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getDetailEditRemoveOption();
this.removeOptions = getEditLocationRemoveOption();
this.removeOptions = this.isShowModifedLocation ?getEditLocationRemoveOption():getClearOption();
},
methods: {
@ -146,7 +158,7 @@
this.$refs.comMessage.showQuestionMessage("确定清空物料及箱码信息?",
res => {
if (res) {
this.$emit('removeItem',dataContent)
this.$emit('removeItem', dataContent)
// this.$emit('removeItem', this.dataContent)
}
});

5
src/mycomponents/scan/winComScanFg.vue

@ -188,6 +188,11 @@
// let productDate = content.substr(lengthMat, 8);
// let batch = content.substr(lengthMat + 8, 3);
let order = content.substr(-8);
if(content.length!=lengthBc){
that.clear();
throw new Error("解析错误:扫描标签长度与配置条码的长度不一致")
}
if (scanPartNumber != partNumber) {
that.clear();
throw new Error("解析错误:扫描的客户物料号【" + scanPartNumber +

52
src/mycomponents/scan/winScanPackage.vue

@ -32,7 +32,13 @@
import {
getBalanceByFilter
} from '@/api/request2.js';
import {
getInventoryStatusDesc,
getDirectoryItemArray,
getLocationAreaTypeName
} from '@/common/directory.js';
export default {
name: 'winScanPack',
components: {
@ -55,7 +61,8 @@
data() {
return {
show: false,
businessType: null
businessType: null,
scanResult:{}
}
},
created() {
@ -104,6 +111,7 @@
getScanResult(result) {
if (result.success) {
this.scanResult=result
this.getBalance(result, res => {
result.balance = res;
this.$emit("getResult", result);
@ -130,14 +138,14 @@
value: this.businessType.outInventoryStatuses
})
}
if (this.businessType.outAreaTypes != null) {
if (this.businessType.outAreaTypes ) {
filters.push({
column: "areaType",
action: "in",
value: this.businessType.outAreaTypes
})
}
if (this.businessType.outAreaCodes != null) {
if (this.businessType.outAreaCodes ) {
filters.push({
column: "areaCode",
action: "in",
@ -146,6 +154,30 @@
}
return filters;
},
getQueryCondition() {
let condition = '按照以下条件:\n';
let label = this.scanResult.label;
let status = getInventoryStatusDesc(getDirectoryItemArray(this.businessType.outInventoryStatuses));
let areaType =getLocationAreaTypeName(this.businessType.outAreaTypes)
condition = condition + '物料号=[' + label.itemCode
+ ']\n箱码=[' + label.packingNumber +
']\n批次=[' +
label.batch +
']'
if (status) {
condition = condition + '\n库存状态=[' + status + ']'
}
if (areaType) {
condition = condition + '\n库区类型=[' + areaType + ']'
}
if (this.businessType.outAreaCodes) {
condition = condition + '\n库区代码=[' + this.businessType.outAreaCodes + ']'
}
return condition;
},
getBalance(result, callback) {
let filters = [];
@ -176,7 +208,7 @@
getBalanceByFilter(params).then(res => {
if (res.data.list.length > 0) {
res.data.list.forEach(r => {
if (packageInfo.parentNumber !== null) {
if (packageInfo.parentNumber) {
r.parentPackingNumber = packageInfo.parentNumber
} else {
r.parentPackingNumber = packageInfo.number
@ -201,9 +233,7 @@
params.filters = filters;
getBalanceByFilter(params).then(res1 => {
if (res1.data.list.length == 0) {
this.showErrorMessage('未查找到该包装的库存余额', res => {
this.packGetFocus();
})
this.showErrorMessage(this.getQueryCondition()+'\n未查找到该包装的库存余额')
} else {
res1.data.list.forEach(r => r.parentPackingNumber = packageInfo.number)
callback(res1.data.list)
@ -212,9 +242,7 @@
this.showErrorMessage(err.message);
})
} else {
this.showErrorMessage('未查找到该包装的库存余额', res => {
this.packGetFocus();
})
this.showErrorMessage(this.getQueryCondition()+'\n未查找到该包装的库存余额')
}
}
}).catch(err => {
@ -230,7 +258,7 @@
},
losefocus() {
if (this.$refs.comscan ) {
if (this.$refs.comscan) {
this.$refs.comscan.losefocus();
}
},

274
src/mycomponents/scan/winScanParentPackage.vue

@ -0,0 +1,274 @@
<template>
<view>
<uni-popup ref="popup" @change="change" :mask-click="false">
<view class="popup_box">
<view class="pop_title uni-flex space-between">
<view class="" style="font-size: 35rpx;">
扫描{{title}}
</view>
<view class="">
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg"
@click="closeScanPopup()"></image>
</view>
</view>
<view class="">
<view class="">
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult"
:headerType="headerType" :isShowHistory="isShowHistory" :clearResult="true"></win-com-scan>
</view>
</view>
</view>
</uni-popup>
<!-- 模拟扫描功能 -->
<win-com-scan v-show="false" ref="comscansimulate" @getResult="getScanResult" :headerType="headerType"
:isShowHistory="false" :clearResult="true"></win-com-scan>
<comMessage ref="comMessage" @afterClose="getfocus"></comMessage>
</view>
</template>
<script>
import winComScan from '@/mycomponents/scan/winComScan.vue'
import {
getBalanceByFilter
} from '@/api/request2.js';
export default {
name: 'winScanParentPackage',
components: {
winComScan,
},
props: {
title: {
type: String,
default: '箱标签'
},
isShowHistory: {
type: Boolean,
default: true
},
headerType: {
type: String,
default: 'HPQ,HMQ'
}
},
data() {
return {
show: false,
businessType: null
}
},
created() {
},
methods: {
simulateScan(item) {
this.$refs.comscansimulate.setItemCodeSimulate(item.copyContent)
this.$refs.comscansimulate.clickScanMsg();
},
openScanPopup() {
this.$refs.popup.open('bottom')
setTimeout(res => {
this.getfocus()
}, 500)
},
openScanPopupByBusinessType(businessType) {
this.$refs.popup.open('bottom')
setTimeout(res => {
this.getfocus()
this.businessType = businessType;
}, 500)
},
closeScanPopup() {
this.losefocus()
this.$refs.popup.close();
this.$emit("close", '');
},
scanClick() {
if (this.$refs.comscan) {
this.$refs.comscan.clickScanMsg();
}
},
cancelClick() {
if (this.$refs.comscan) {
this.$refs.comscan.clearScanValue();
}
},
getScanResult(result) {
if (result.success) {
this.getBalance(result, res => {
result.balance = res;
this.$emit("getResult", result);
})
} else {
this.showMessage(result.message)
}
},
getParams(label) {
let filters = [{
column: "itemCode",
action: "==",
value: label.itemCode
}, {
column: "batch",
action: "==",
value: label.batch
}];
if (this.businessType.outInventoryStatuses != null) {
filters.push({
column: "inventoryStatus",
action: "in",
value: this.businessType.outInventoryStatuses
})
}
if (this.businessType.outAreaTypes != null) {
filters.push({
column: "areaType",
action: "in",
value: this.businessType.outAreaTypes
})
}
if (this.businessType.outAreaCodes != null) {
filters.push({
column: "areaCode",
action: "in",
value: this.businessType.outAreaCodes
})
}
return filters;
},
getBalance(result, callback) {
let filters = [];
let packageInfo = result.package;
let comfilters = this.getParams(packageInfo);
let balance = {
parentBalance: {},
childBalance: []
};
let parentPackingNumber = packageInfo.parentNumber;
let childPackingNumber = packageInfo.number;
//packageInfo.subList0
//1.
if (parentPackingNumber) {
let packingNumber = parentPackingNumber + "," + childPackingNumber;
filters.push({
column: "packingNumber",
action: "in",
value: packingNumber
})
} else {
filters.push({
column: "packingNumber",
action: "==",
value: childPackingNumber
})
}
filters = filters.concat(comfilters);
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getBalanceByFilter(params).then(res => {
res.data.list.forEach(r => {
if (packageInfo.parentNumber) {
r.parentPackingNumber = parentPackingNumber
} else {
r.parentPackingNumber = childPackingNumber
}
})
//
if (packageInfo.subList.length > 0) {
let packparams = '';
packageInfo.subList.forEach(pack => {
packparams = packparams + pack.number + ','
})
packparams = packparams.trimEnd(',');
filters = [];
filters.push({
column: "packingNumber",
action: "in",
value: packparams
})
filters = filters.concat(comfilters);
params.filters = filters;
getBalanceByFilter(params).then(res1 => {
if (res1.data.list.length == 0) {
this.showErrorMessage('未查找到该包装的库存余额', res => {
this.packGetFocus();
})
} else {
res1.data.list.forEach(r => r.parentPackingNumber = childPackingNumber)
balance.parentBalance = res.data.list.filter(r => r.packingNumber ==
childPackingNumber)
balance.childBalance = res1.data.list;
callback(balance);
}
}).catch(err => {
this.showErrorMessage(err.message);
})
} else {
//
//()
balance.childBalance = res.data.list.filter(r => r.packingNumber == childPackingNumber)
balance.parentBalance = res.data.list.filter(r => r.packingNumber == parentPackingNumber)
callback(balance);
}
}).catch(err => {
this.showErrorMessage(err.message);
})
},
getfocus() {
if (this.$refs.comscan) {
this.$refs.comscan.getfocus();
}
},
losefocus() {
if (this.$refs.comscan) {
this.$refs.comscan.losefocus();
}
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
change(e) {
this.show = e.show
},
showErrorMessage(message) {
this.losefocus()
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.getfocus();
}
});
},
}
}
</script>
<style lang="scss">
.scroll-view {
overflow-y: scroll;
height: auto;
max-height: 300rpx;
}
</style>

55
src/pages.json

@ -629,6 +629,41 @@
"enablePullDownRefresh": false
}
},
{
"path": "pages/issue/job/issueJob0816",
"style": {
"navigationBarTitleText": "发料任务0816",
"enablePullDownRefresh": true,
"titleNView": {
"autoBackButton": "true",
"buttons": [
//
{
"float": "right",
"fontSize": "58rpx", //
"text": "\ue696",
"fontSrc": "/static/ali_icon/iconfont.ttf"
},
{
"float": "right",
"fontSize": "52rpx", //
"text": "\ue6e2",
"fontSrc": "/static/ali_icon/iconfont.ttf"
}
]
}
}
},
{
"path": "pages/issue/job/issueDetail0816",
"style": {
"navigationBarTitleText": "发料任务详情0816",
"enablePullDownRefresh": false
}
},
{
"path": "pages/issue/record/issueRecord",
"style": {
@ -784,7 +819,25 @@
"navigationBarTitleText": "直接补料",
"enablePullDownRefresh": false,
"titleNView": {
"autoBackButton": "true"
"autoBackButton": "true",
"buttons": [
//
{
"float": "right",
"fontSize": "58rpx", //
"text": "\ue696",
"fontSrc": "/static/ali_icon/iconfont.ttf"
},
{
"float": "right",
"fontSize": "52rpx", //
"text": "\ue6e2",
"fontSrc": "/static/ali_icon/iconfont.ttf"
}
]
}
}
},

59
src/pages/fg/receiptByPlan.vue

@ -273,30 +273,43 @@ import { nextTick } from 'vue';
console.log(JSON.stringify(params))
let list = []
var planData = await planReceiptSubmit(params)
if (planData.data) {
planData.data.forEach(item => {
list.push({
itemCode: item.itemCode, //
itemName: item.itemName, //
packName: item.packName, //
packageCode: item.toPackingNumber, //
batch: item.toBatch, //
parentNumber: item.parentNumber, //
itemType: item.itemType, //
asnNumber: item.asnNumber, //ASN
supplierCode: item.supplierCode, //
qty: item.qty, //
printTimes: getCurrDateTime(), //
productionLineCode: item.productionLineCode, //线
barcodeString: item.barcodeString, //
barcodeBase64: '',
requestNumber: item.requestNumber
try{
var planData = await planReceiptSubmit(params)
console.log('planData',planData)
if (planData.data) {
planData.data.forEach(item => {
list.push({
itemCode: item.itemCode, //
itemName: item.itemName, //
packName: item.packName, //
packageCode: item.toPackingNumber, //
batch: item.toBatch, //
parentNumber: item.parentNumber, //
itemType: item.itemType, //
asnNumber: item.asnNumber, //ASN
supplierCode: item.supplierCode, //
qty: item.qty, //
printTimes: getCurrDateTime(), //
productionLineCode: item.productionLineCode, //线
barcodeString: item.barcodeString, //
barcodeBase64: '',
requestNumber: item.requestNumber
})
})
})
} else {
throw new Error("提交失败")
} else {
throw new Error("提交失败")
}
}catch(error){
console.log('异常',error)
if(error.indexOf('请返回开工阶段')>-1){
uni.hideLoading()
this.showErrorMessage('计划已完成')
this.clearData()
this.openFg();
return
}
}
//

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

@ -1,9 +1,9 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday"
<job-filter ref="filter" :isShowItemCode="isShowItemCode" :isShowQurery="isShowQurery" otherTitle="ASN" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask">
:checkedWaitTask="checkedWaitTask" @onQuery="getListByFilter">
</job-filter>
<view v-if="jobList.length>0">
@ -67,7 +67,15 @@
title: {
type: String,
default: ""
}
},
isShowItemCode: {
type: Boolean,
default: false
},
isShowQurery: {
type: Boolean,
default: false
},
},
data() {
return {
@ -82,7 +90,8 @@
status: '1,2', //
detailOptions: [],
detailGiveupOptions: [],
titleName:""
titleName:"",
filterItemCode:''
};
},
@ -172,6 +181,15 @@
value: this.status
})
if(this.filterItemCode){
//
filters.push({
column: "itemCode",
action: "like",
value: this.filterItemCode
})
}
filters.push({
column: "accept_user_id",
action: "==",
@ -194,14 +212,14 @@
uni.stopPullDownRefresh();
}
var list = res.data.list;
let list = res.data.list;
this.totalCount = res.data.total
this.loadingType = "loadmore";
this.jobList = type === "refresh" ? list : this.jobList.concat(list);
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
this.jobList = type === "refresh" ? list : this.jobList.concat(list);
this.pageNo++;
this.updateTitle();
}).catch(error => {
@ -260,6 +278,27 @@
this.showMessage(error)
})
},
getListByFilter(params) {
console.log('getListByFilter',params)
if (params.itemCode) {
//
this.filterItemCode = params.itemCode
}else{
this.filterItemCode = ''
}
if (params.status) {
this.status = params.status
}else{
this.status = "1,2"
}
if(params.creationTime==""){
this.checkedToday = false;
}
this.todayTime = params.creationTime
this.getList('refresh')
},
switchChangeToday(state, creationTime) {
this.checkedToday = state;

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

@ -1,6 +1,6 @@
<template>
<view class="page-wraper">
<comMoveJob :title="title" ref="comMoveJob" businessTypeCode='OkToHold' > </comMoveJob>
<comMoveJob :isShowItemCode="true" :isShowQurery="true" :title="title" ref="comMoveJob" businessTypeCode='OkToHold' > </comMoveJob>
</view>
</template>

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

@ -10,6 +10,7 @@
</view>
<view class="">
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg"
@click="closeScanPopup()"></image>
</view>
@ -178,7 +179,7 @@
fontSize: "100rpx"
},
bussinessCode: 'Issue',
toLocationAreaTypeList:[]
toLocationAreaTypeList: []
}
},
created() {
@ -234,7 +235,7 @@
that.fromInventoryStatuses = this.jobContent.outInventoryStatuses
that.toLocation = that.dataContent[0];
that.toLocationCode = that.dataContent[0].toLocationCode;
that.toLocationAreaTypeList=getDirectoryItemArray(this.jobContent.toAreaTypes)
that.toLocationAreaTypeList = getDirectoryItemArray(this.jobContent.toAreaTypes)
// that.fromLocationList = that.getFromLocationList();
}
},
@ -317,9 +318,9 @@
"库区 [" + areaType + "] \n" +
"未查找到库存余额"
this.showErrorMessage(hint,
res => {
that.getfocus();
})
res => {
that.getfocus();
})
} else if (res.data.length == 1) {
result.balance = res.data[0]
@ -337,15 +338,15 @@
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error,
res => {
that.getfocus();
})
res => {
that.getfocus();
})
})
}
} catch (e) {
this.showErrorMessage(e.stack,res => {
that.getfocus();
})
this.showErrorMessage(e.stack, res => {
that.getfocus();
})
uni.hideLoading();
}
},
@ -427,7 +428,7 @@
}
}
},
//
getToLocationBalance(result) {
uni.showLoading({
@ -449,7 +450,7 @@
value: result.package.number
})
}
filters.push({
column: "itemCode",
action: "==",
@ -460,14 +461,14 @@
action: "==",
value: result.package.batch
})
filters.push({
column: "areaType",
action: "in",
value: this.toLocationAreaTypeList.join(',')
})
var params = {
filters: filters,
pageNo: 1,
@ -486,7 +487,7 @@
this.showErrorMessage(err.message);
})
},
selectBalanceItem(balance) {
this.afterGetBalance(this.label, balance, this.packageInfo);
},
@ -500,7 +501,7 @@
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) {
if (fromLocation &&!fromLocation.isNewAdd) {
let batch = fromLocation.Batchs.find(r => r.batch == lot);
if (batch != undefined) {
if (batch.Records == undefined) {
@ -530,7 +531,7 @@
} else {
that.addRecord(batch, label, balance, packageInfo)
}
that.$emit("afterScan");
} else {
that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱',
res => {
@ -550,6 +551,7 @@
batch.detail = fromLocation.Batchs[0].detail;
}
fromLocation.Batchs.unshift(batch);
this.getfocus();
that.$emit("afterScan");
}
})
@ -561,8 +563,22 @@
}
}
} else {
let locaion = that.createLocationInfo(label, balance, packageInfo);
item.Locations.push(locaion);
if (this.jobContent.allowModifyLocation == "TRUE") {
this.showQuestionMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode +
"】与推荐的库位不一致,是否要继续发料?", res => {
if (res) {
let locaion = that.createLocationInfo(label, balance, packageInfo);
item.Locations.push(locaion);
this.getfocus();
that.$emit("afterScan");
}
})
} else {
this.showErrorMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode +
"】与推荐的库位不一致,不允许继续发料?")
}
}
} catch (e) {
that.showErrorMessage(e.stack,
@ -573,18 +589,19 @@
}
},
//
//
createLocationInfo(label, balance, packageInfo) {
let location = {
fromLocationCode: balance.locationCode,
qty: balance.qty,
uom: balance.uom,
handleQty: 0,
isNewAdd:true,
Batchs: []
}
let batch = this.createBatchInfo(label, balance, packageInfo);
batch.detail = balance;
batch.detail.fromLocationCode=balance.locationCode;
batch.detail.fromLocationCode = balance.locationCode;
location.Batchs.push(batch);
return location;
},
@ -615,8 +632,8 @@
batch: label.batch,
// qty: Number(balance.qty),
// qty: Number(label.qty) > Number(balance.qty) ? Number(balance.qty) : Number(label.qty),
qty: Number(balance.qty),
handleQty: Number(balance.qty),
qty: Number(balance.qty),
handleQty: Number(balance.qty),
uom: balance.uom,
inventoryStatus: balance.inventoryStatus,
balance: balance,
@ -644,6 +661,7 @@
this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch);
this.getfocus();
this.$emit("afterScan");
},
getfocus() {
@ -691,7 +709,6 @@
this.issueRecord.splice(index, 1)
let item = this.toLocation.Items.find(r => r.itemCode == record.itemCode);
if (item != undefined) {
item.Locations.forEach(l => {

732
src/pages/issue/coms/comScanIssuePack0816.vue

@ -0,0 +1,732 @@
<template>
<view>
<uni-popup ref="popup" :maskClick='false'>
<view class="">
<view class="popup_box">
<view class="pop_title uni-flex space-between">
<view class="" style="font-size: 35rpx;">
扫描箱码
</view>
<view class="">
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg"
@click="closeScanPopup()"></image>
</view>
</view>
<view class="">
<view class="">
<win-com-scan ref="comscan" placeholder="箱标签" @getResult="onScan" :clearResult="true"
headerType="HPQ,HMQ" :isShowHistory="false">
</win-com-scan>
<view style="width: 100%;">
<view style="width: 100%;" v-if="issueRecord.length>0">
<view class="uni-flex uni-row space-between u-col-center">
<view class="" style="padding: 10rpx;">
历史记录
</view>
<view class="" style="padding-right: 10rpx;">
<u-icon :name="expendIcon" size="35rpx" @click="expands()"></u-icon>
</view>
</view>
<u-line class='line_color' style='padding-top: 10rpx;padding-bottom: 20rpx;'>
</u-line>
<scroll-view scroll-y="true" class="scroll-view"
v-if="expand&&issueRecord.length>0">
<view class="uni-flex u-col" v-for="(record,index) in issueRecord">
<view style="width: 100%;">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,record,index)"
:right-options="scanOptions">
<view style="padding: 0px 10px">
<balance :dataContent="record" :isShowFromLocation="false"
:isShowStdPack="false"></balance>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
<u-line class='line_color'></u-line>
</view>
</view>
</scroll-view>
</view>
</view>
</view>
</view>
</view>
</view>
</uni-popup>
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select>
<comMessage ref="comMessage"></comMessage>
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true"></balance-qty-edit>
<!-- 模拟扫描功能 -->
<!-- <win-com-scan v-show="false" ref="comscansimulate" placeholder="箱标签" @getResult="onScan" :clearResult="true"
headerType="HPQ,HMQ" :isShowHistory="false">
</win-com-scan> -->
</view>
</template>
<script>
import winComScan from '@/mycomponents/scan/winComScan.vue'
import balance from '@/mycomponents/balance/balance.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import {
getDetailOption,
getDetailEditRemoveOption
} from '@/common/array.js';
import {
getWorkShopLineStation,
getBalanceByFilter,
getBalanceByParams,
} from '@/api/request2.js';
import {
uniqueArray
} from '@/common/basic.js';
import {
getLabelInfo
} from '@/common/label.js';
import {
calc
} from '@/common/calc.js';
import {
getBalanceByManagementPrecision
} from '@/common/balance.js';
import {
getDirectoryItemArray
} from '../../../common/directory.js';
export default {
name: 'winScanPack',
emits: ["afterScan", "closeScan"],
components: {
winComScan,
balance,
balanceQtyEdit,
balanceSelect
},
props: {
title: {
type: String,
default: ''
},
},
data() {
return {
dataContent: {},
jobContent: {},
expendIcon: 'arrow-down',
show: false,
scanList: [],
toLocation: null,
toLocationCode: '',
fromLocationList: [],
fromLocationCode: '',
fromLocation: null,
issueRecord: [], //
expand: true,
scanOptions: {},
editItem: {},
positionInfo: "请选择位置",
positionList: [],
defaultValueList: [],
fromInventoryStatuses: "",
packageInfo: {},
label: {},
inputStyleObject: {
fontSize: "100rpx"
},
bussinessCode: 'Issue',
toLocationAreaTypeList: []
}
},
created() {
},
watch: {},
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getDetailEditRemoveOption();
},
methods: {
openScanPopupForJobSimulate(content, jobcontent, scanMessage) {
this.issueRecord = [];
this.dataContent = content;
this.jobContent = jobcontent;
this.initData();
getLabelInfo(scanMessage, "HPQ,HMQ", callback => {
if (callback.success) {
this.onScan(callback);
} else {
this.showErrorMessage(callback.message, res => {})
}
})
},
openScanPopup(content, jobcontent) {
this.issueRecord = [];
this.dataContent = content;
this.jobContent = jobcontent;
this.initData();
// this.positionInfo = this.jobContent.workShopCode + "-" + this.jobContent.subList[0].productionLineCode +
// "-" + this.jobContent.subList[0].workStationCode
this.$refs.popup.open('bottom')
setTimeout(res => {
this.getfocus();
}, 500)
},
closeScanPopup() {
this.losefocus()
this.$refs.popup.close();
this.$emit("closeScan")
//
// Object.assign(this.$data, this.$options.data());
},
initData() {
let that = this;
that.fromLocationList = [];
if (that.dataContent != null) {
that.fromInventoryStatuses = this.jobContent.outInventoryStatuses
that.toLocation = that.dataContent[0];
that.toLocationCode = that.dataContent[0].toLocationCode;
that.toLocationAreaTypeList = getDirectoryItemArray(this.jobContent.toAreaTypes)
// that.fromLocationList = that.getFromLocationList();
}
},
showBalanceSelect(items) {
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;
// },
fromLocationUpdate(fromlocation) {
let location = this.fromLocationList.find(r => r == fromlocation)
if (location == undefined) {
this.fromLocationCode = ''
this.showErrorMessage('发料库位【' + fromlocation + '】不存在')
}
},
queryBalance(result) {
try {
let that = this;
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 {
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: '查询中',
mask: true
})
getBalanceByParams(params).then(res => {
if (res.data.length == 0) {
var status = getInventoryStatusDesc(params.inventoryStatus)
var areaType = getListLocationAreaTypeDesc(params.areaType)
var hint =
"按物料号 [" + params.itemCode + "] \n" +
"包装号 [" + params.packingNumber + "] \n" +
"批次 [" + params.batch + "] \n" +
"状态 [" + status + "] \n" +
"库区 [" + areaType + "] \n" +
"未查找到库存余额"
this.showErrorMessage(hint,
res => {
that.getfocus();
})
} else if (res.data.length == 1) {
result.balance = res.data[0]
if (result.label.packingNumber != result.balance.packingNumber) {
result.balance.qty = Number(result.label.qty)
} else {
result.balance.qty = Number(result.balance.qty)
}
this.afterGetBalance(result.label, result.balance, result.package);
} else {
//
this.$refs.balanceSelect.openPopup(res.data);
}
uni.hideLoading()
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error,
res => {
that.getfocus();
})
})
}
} catch (e) {
this.showErrorMessage(e.stack, res => {
that.getfocus();
})
uni.hideLoading();
}
},
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);
})
},
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('扫描物料【' + result.package.itemCode + '】不属于该任务');
return
}
if (result.package.packUnit !== item.packUnit) {
this.$refs.comMessage.showQuestionMessage(
`扫描物料包装【${result.package.packUnit}】与任务推荐包装规格【${item.packUnit}】不一致.是否要继续发料?`, res => {
if (res) {
this.getToLocationBalance(result)
}
});
} else {
this.getToLocationBalance(result)
}
}
},
//
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(result);
}
// callback(res.data)
}).catch(err => {
uni.hideLoading()
this.showErrorMessage(err.message);
})
},
selectBalanceItem(balance) {
this.afterGetBalance(this.label, balance, this.packageInfo);
},
afterGetBalance(label, balance, packageInfo) {
let that = this;
try {
let itemCode = label.itemCode;
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) {
if (batch.Records == undefined) {
batch.Records = [];
}
let record = batch.Records.find(r => r.packingNumber == packingCode);
if (record == undefined) {
//
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)
} else {
//
if (this.jobContent.allowModifyPackingNumber == 'TRUE') {
that.addRecord(batch, label, balance, packageInfo);
} else {
that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细',
res => {
that.getfocus();
return;
}
)
}
}
} else {
that.addRecord(batch, label, balance, packageInfo)
}
that.$emit("afterScan");
} else {
that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱',
res => {
that.getfocus();
}
)
}
} else {
if (this.jobContent.allowModifyBatch == "TRUE") {
this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,未查找到批次【' + lot +
'】的发料明细,是否要继续发料?', res => {
if (res) {
let batch = that.createBatchInfo(label, balance, packageInfo);
//details
if (fromLocation.Batchs.length > 0) {
batch.detail = fromLocation.Batchs[0].detail;
}
fromLocation.Batchs.unshift(batch);
that.$emit("afterScan");
}
})
} else {
that.showErrorMessage('未查找到批次【' + lot + '】的发料明细',
res => {
that.getfocus();
});
}
}
} else {
let locaion = that.createLocationInfo(label, balance, packageInfo);
item.Locations.push(locaion);
}
} catch (e) {
that.showErrorMessage(e.stack,
res => {
that.getfocus();
}
)
}
},
//
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,
qty: 0,
uom: data.uom,
handleQty: Number(balance.qty),
Records: []
}
let record = this.creatRecord(data, balance, packageInfo);
batch.Records.push(record);
this.issueRecord.unshift(record)
return batch;
},
creatRecord(label, balance, packageInfo) {
balance.packQty = packageInfo.packQty
balance.packUnit = packageInfo.packUnit
let record = {
scaned: true,
itemCode: label.itemCode,
packingNumber: label.packingNumber,
parentPackingNumber: packageInfo.parentNumber,
batch: label.batch,
// qty: Number(balance.qty),
// qty: Number(label.qty) > Number(balance.qty) ? Number(balance.qty) : Number(label.qty),
qty: Number(balance.qty),
handleQty: Number(balance.qty),
uom: balance.uom,
inventoryStatus: balance.inventoryStatus,
balance: balance,
toLocationCode: this.toLocationCode,
supplierCode: label.supplierCode,
packUnit: packageInfo.packUnit,
packQty: packageInfo.packQty
}
return record;
},
calcBatchHandleQty(batch) {
let handleQty = 0;
batch.Records.forEach(res => {
handleQty = calc.add(handleQty, res.qty)
})
batch.handleQty = handleQty;
},
addRecord(batch, label, balance, packageInfo) {
let record = this.creatRecord(label, balance, packageInfo);
batch.Records.push(record);
this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch);
this.getfocus();
},
getfocus() {
if (this.$refs.comscan != undefined) {
this.$refs.comscan.getfocus();
}
},
losefocus() {
if (this.$refs.comscan != undefined) {
this.$refs.comscan.losefocus();
}
},
expands() {
this.expand = !this.expand;
this.expendIcon = this.expand == true ? "arrow-down" : "arrow-up"
},
swipeClick(e, item, index) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
this.remove(item, index)
}
},
edit(item) {
this.editItem = item;
// item.balance.balanceQty = item.balance.qty;
item.balance.balanceQty = item.balance.qty;
this.$refs.balanceQtyEdit.openEditPopup(item.balance, item.qty);
},
detail(item) {
this.showItem = item;
this.$refs.receiptHint.openScanPopup()
},
remove(record, index) {
this.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
record.qty = 0;
this.issueRecord.splice(index, 1)
let item = this.toLocation.Items.find(r => r.itemCode == record.itemCode);
if (item != undefined) {
item.Locations.forEach(l => {
let batch = l.Batchs.find(b => b.packingNumber == record.packingNumber && b
.batch == record.batch);
if (batch && batch.Records && batch.Records.length > 0) {
let rIndex = batch.Records.findIndex(r => r.packingNumber == record
.packingNumber && r.batch == record.batch);
batch.Records.splice(rIndex, 1);
}
})
}
this.$emit('updateData', item);
}
});
},
packGetFocus() {
if (this.$refs.comscan) {
this.$refs.comscan.getfocus();
}
},
packLoseFocus() {
if (this.$refs.comscan) {
this.$refs.comscan.losefocus();
}
},
showMessage(message, callback) {
setTimeout(r => {
this.packLoseFocus();
this.$refs.comMessage.showMessage(message, callback);
})
},
showErrorMessage(message, callback) {
setTimeout(r => {
this.packLoseFocus();
this.$refs.comMessage.showErrorMessage(message, callback);
})
},
showQuestionMessage(message, callback) {
setTimeout(r => {
this.packLoseFocus();
this.$refs.comMessage.showQuestionMessage(message, callback);
})
},
confirm(val) {
this.editItem.qty = Number(val);
this.$emit('updateData', this.editItem)
},
cancle() {
this.closeScanPopup()
}
}
}
</script>
<style lang="scss">
button {
border: none;
}
button::after {
border: none
}
.scroll-view {
overflow-y: scroll;
height: auto;
max-height: 300rpx;
padding: 10rpx;
}
.my-combox {
font-size: 50px;
}
</style>

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

@ -32,7 +32,7 @@
<view class="">
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="submit()">提交</button>
<button class="btn_single_commit" hover-class="btn_commit_after" @click="autoCommit()">提交</button>
</view>
</view>
</view>
@ -449,9 +449,16 @@
afterScan() {
this.resizeCollapse();
let str = ""
this.autoCommit()
},
autoCommit(){
let str=""
var totalQty =0;
var taskQty =0;
this.detailSource.forEach(detail => {
detail.Items.forEach(item => {
taskQty =calc.add(taskQty,item.qty)
item.Locations.forEach(lco => {
lco.Batchs.forEach(batch => {
batch.Records.forEach(record => {
@ -466,16 +473,23 @@
str +=
`包装号【${record.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${batch.qty}】不一致\n`
}
}
if(record){
var hanleQty =record.qty?record.qty:0
totalQty = calc.add(totalQty,hanleQty)
}
})
})
})
})
})
if (str) {
if(str){
str = '任务明细未全部完成,是否提交?\n' + str
}
if(totalQty!=taskQty){
str ="扫描数量["+totalQty+"]与任务数量不一致["+taskQty+"],是否提交"
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
//
@ -484,10 +498,9 @@
this.scanPopupGetFocus()
}
});
} else {
}else {
//
this.$throttle(this.submit, 2000, this)()
}
},

608
src/pages/issue/job/issueDetail0816.vue

@ -0,0 +1,608 @@
<template>
<view class="page-wraper">
<view class="page-header">
<view class="header-view">
<view class="header_job_top">
<job-top :dataContent="jobContent"></job-top>
</view>
<work-station :workshopCode="jobContent.workShopCode"
:productionLineCode="jobContent.detailProductionLineCode"
:workStationCode="jobContent.detailWorkStationCode"
:rawLocationCode="jobContent.detailToLocationCode">
</work-station>
</view>
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view v-for="(toLocation, index) in detailSource">
<!-- <work-station :workshopCode="jobContent.workShopCode"
:productionLineCode="toLocation.productionLineCode"
:workStationCode="toLocation.workStationCode" :rawLocationCode="toLocation.toLocationCode">
</work-station> -->
<com-issue-detail-card ref='comIssueDetailCard' :dataContent="toLocation" @updateData='updateData'>
</com-issue-detail-card>
<view class="split_line"></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="">
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="autoCommit()">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanDetailPopup'></win-scan-button>
<com-scan-issue-pack ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'
@afterScan='afterScan'>
</com-scan-issue-pack>
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
takeIssueJob,
cancleTakeIssueJob,
getIssueJobDetail,
issueJobSubmit
} from '@/api/request2.js';
import {
goHome,
navigateBack,
getRemoveOption,
getCurrDateTime,
getDirectoryItemArray,
getPackingNumberAndBatch,
deepCopyData
} from '@/common/basic.js';
import {
getDataSource
} from '@/pages/issue/js/issue.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
import {
calc
} from '@/common/calc.js';
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import comIssueDetailCard from '@/pages/issue/coms/comIssueDetailCard.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
import workStation from '@/mycomponents/workStation/workStation.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
export default {
name: 'issueDetail',
components: {
jobDetailPopup,
winScanButton,
comIssueDetailCard,
comScanIssuePack,
jobTop,
workStation,
balanceSelect
},
data() {
return {
id: '',
jobContent: {}, //
subList: [], //subList
detailSource: [], //
detailOptions: [],
scanOptions: [],
jobStatus: "",
scanMessage: ''
};
},
props: {
},
onLoad(option) {
uni.setNavigationBarTitle({
title: option.title + '详情'
});
this.id = option.id;
this.scanMessage = option.scanMessage || '';
if (this.id != undefined) {
//
if (option.status == "1") {
this.receive((callback => {
this.getDetail();
}));
} else {
this.getDetail();
}
}
},
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
//
onBackPress(e) {
//
if (e.from === 'backbutton') {
if (this.jobStatus == "2") {
//
cancleTakeIssueJob(this.id).then(res => {
uni.navigateBack();
}).catch(error => {
uni.navigateBack();
})
} else {
uni.navigateBack();
}
return true;
}
},
watch: {
locationTypes(newVal) {
let value = newVal;
},
},
mounted: function() {
// this.resizeCollapse();
},
methods: {
resizeCollapse() {
this.$nextTick(r => {
this.$refs.comIssueDetailCard.forEach(r => {
r.resizeCollapse();
})
});
},
//
receive(callback) {
if (this.id != null) {
takeIssueJob(this.id).then(res => {
callback();
}).catch(error => {
this.showErrorMessage(error)
})
}
},
getDetail() {
var that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getIssueJobDetail(that.id).then(res => {
uni.hideLoading();
if (res.data == null) {
that.showMessage('未获取到详情');
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.jobStatus = res.data.status
that.subList = res.data.subList;
that.detailSource = getDataSource(that.detailSource, that.subList)
that.jobContent.detailToLocationCode = res.data.subList[0].toLocationCode
//
if (this.scanMessage) {
this.openScanPopupSimulate(this.scanMessage);
}
setTimeout(r => {
that.resizeCollapse();
}, 100)
// that.detailSource.forEach(r => {
// r.subList.forEach(s => {
// if (this.scanedPackingNumber && this.scanedPackingNumber == s
// .packingNumber) {
// s.scaned = true
// s.cancleScanedHiht = true
// //
// this.openScanPopupSimulate(s);
// this.scanedPackingNumber = ''
// }
// })
// })
} else {
that.showMessage('列表数据为0');
}
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
closeScan() {
this.resizeCollapse();
},
// submit() {
//3.
//:XXX
// var isOutIn = getApp().globalData.feed_configList.filter(
// res => {
// if (res.name == 'feed_isOutIn') {
// return res;
// }
// });
// this.dataContent.itemCodeList.forEach(res => {
// if (res.handleQty > res.recommendQty) {
// this.$refs.modal.showConfirmMessageModal(',?', confirm => {
// if (confirm) {
// //
// uni.showToast({
// title: ""
// })
// }
// })
// } else {
// uni.showToast({
// title: "" + res.handleQty + "][" + res.recommendQty + "]"
// })
// }
// })
// },
submit() {
uni.showLoading({
title: "提交中....",
mask: true
});
//
var itemCodes = []
let locationCode = this.detailSource[0].toLocationCode
this.detailSource.forEach(toLocation => {
toLocation.Items.forEach(item => {
itemCodes.push(item.itemCode)
})
})
//
getManagementPrecisions(itemCodes, locationCode, res => {
if (res.success) {
this.managementList = res.list;
this.submitJob();
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
});
},
submitJob() {
var params = this.setParams()
if (!params.subList || params.subList.length == 0) {
uni.hideLoading()
this.showErrorMessage("请扫描您需要提交的发料任务")
return
}
console.log("提交参数", JSON.stringify(params));
issueJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功\n生成发料记录\n" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
setParams() {
var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id
this.detailSource.forEach(toLocationCode => {
toLocationCode.Items.forEach(item => {
item.Locations.forEach(fromLocation => {
fromLocation.Batchs.forEach(batch => {
let subItem = batch.detail;
if (subItem != undefined) {
subItem.recordList = [];
if (batch.Records.length > 0) {
batch.Records.forEach(r => {
let record = {};
record.handleQty = r.qty;
record.fromPackingNumber = r
.packingNumber;
record.fromBatch = r.batch;
record.fromContainerNumber = r
.ContainerNumber;
record.toContainerNumber = r
.ContainerNumber;
record.toInventoryStatus = r
.inventoryStatus;
// record.toLocationCode = subItem
// .toLocationCode;
record.toLocationCode = this.jobContent
.detailToLocationCode;
record.supplierCode = r.supplierCode;
let single_price = r.balance
.singlePrice == null ? 0 : r
.balance
.singlePrice;
record.singlePrice = single_price;
record.amount = single_price * r.qty;
//使
if (item.onTheWayLocationCode) {
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;
}
record.fromParentPackingNumber = r
.parentPackingNumber;
subItem.recordList.push(record);
})
subList.push(deepCopyData(subItem));
}
}
})
})
})
})
this.jobContent.subList = subList
this.jobContent.createTime = createTime;
this.jobContent.creator = creator;
return this.jobContent;
},
cancel() {
let that = this;
this.$refs.comMessage.showQuestionMessage('是否要清空已扫描的物料和目标库位信息?', res => {
if (res) {
that.clearInfo();
}
});
},
clearInfo() {
this.dataContent.itemCodeList.forEach(res => {
if (res.recommendList != null) {
res.recommendList.forEach(res1 => {
if (res1.locationCodeList != null) {
res1.locationCodeList.forEach(res2 => {
if (res2.packingCodeList != null) {
res2.packingCodeList.forEach(res3 => {
res3.itemCode = "";
res3.qty = 0;
})
}
})
}
})
}
})
},
updateData(record) {
console.log('updateData', record)
console.log('this.detailSource', this.detailSource)
let requestLocation = this.detailSource.find(r => r.toLocationCode == record.toLocationCode);
let item = requestLocation.Items.find(r => r.itemCode == record.itemCode);
let itemHandleQty = 0;
if (item != undefined) {
item.Locations.forEach(l => {
let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b
.packingNumber == null || b.packingNumber == '') && b.batch == record.batch);
let handleQty = 0;
if (batch != undefined) {
batch.Records.forEach(res => {
handleQty = calc.add(handleQty, res.qty)
})
batch.handleQty = handleQty;
itemHandleQty = calc.add(itemHandleQty, handleQty)
}
})
}
this.resizeCollapse();
item.handleQty = itemHandleQty;
},
afterScan() {
this.resizeCollapse();
this.autoCommit()
},
autoCommit(){
let str=""
var totalQty =0;
var taskQty =0;
this.detailSource.forEach(detail => {
detail.Items.forEach(item => {
taskQty =calc.add(taskQty,item.qty)
item.Locations.forEach(lco => {
lco.Batchs.forEach(batch => {
batch.Records.forEach(record => {
if (batch.qty != record.qty) {
var tempHandleQty = 0
if (record.qty) {
tempHandleQty = record.qty
} else {
tempHandleQty = 0
}
if (batch.qty != 0) {
str +=
`包装号【${record.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${batch.qty}】不一致\n`
}
}
if(record){
var hanleQty =record.qty?record.qty:0
totalQty = calc.add(totalQty,hanleQty)
}
})
})
})
})
})
if(str){
str = '任务明细未全部完成,是否提交?\n' + str
}
if(totalQty!=taskQty){
str ="扫描数量["+totalQty+"]与任务数量不一致["+taskQty+"],是否提交"
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
//
this.$throttle(this.submit, 2000, this)()
} else {
this.scanPopupGetFocus()
}
});
}else {
//
this.$throttle(this.submit, 2000, this)()
}
},
scanPopupGetFocus() {
if (this.$refs.comScanIssuePack) {
this.$refs.comScanIssuePack.getfocus();
}
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
showCommitSuccess() {
this.$refs.comMessage.showCommitSuccess();
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
navigateBack(1)
})
},
showRescanMessage(message) {
this.$refs.comMessage.showRescanMessage(message);
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
closeScanMessage() {
this.scanPopupGetFocus();
},
confirm(data) {
this.dataContent = data;
},
confirmResult(result) {
this.dataContent = result;
this.$forceUpdate();
},
openScanDetailPopup() {
var datacontent = {}
//
// Object.assign(datacontent, this.detailSource);
this.$refs.comScanIssuePack.openScanPopup(this.detailSource, this.jobContent);
},
openScanPopupSimulate(scanMessage) {
this.$refs.comScanIssuePack.openScanPopupForJobSimulate(this.detailSource, this.jobContent, scanMessage);
},
closeScanPopup() {
this.updateCommitBtn();
},
}
};
</script>
<style scoped lang="scss">
.uni-numbox__value {
width: 40px;
}
button[disabled] {
background-color: #3C9CFF;
color: #fff;
opacity: 0.7;
}
// /deep/ .input-value {
// font-size: 16px;
// }
// /deep/ .uni-collapse-item__title-text {
// font-size: 16px;
// }
// /deep/ .uni-collapse-item--border {
// border-bottom-width: 0px;
// border-bottom-color: #ebeef5;
// }
// /deep/ .uni-collapse-item--border {
// border-bottom-width: 1px;
// border-bottom-color: #ebeef5;
// }
</style>

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

@ -329,82 +329,91 @@
title: "加载中­....",
mask: true
});
var filters = []
if (this.checkedToday) {
filters.push({
column: "create_time",
action: "betweeen",
value: this.todayTime
})
// var filters = []
// if (this.checkedToday) {
// filters.push({
// column: "create_time",
// action: "betweeen",
// value: this.todayTime
// })
// }
// filters.push({
// column: "status",
// action: "in",
// value: this.status
// })
if (params.status) {
this.status = params.status
}else{
this.status = "1,2"
}
if(params.creationTime==""){
this.checkedToday = false;
}
filters.push({
column: "status",
action: "in",
value: this.status
})
if (params.fromLocationCode) {
//
this.fromLocation = params.fromLocationCode
filters.push({
column: "fromLocationCode",
action: "==",
value: 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
})
// 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
})
// filters.push({
// column: "itemCode",
// action: "like",
// value: params.itemCode
// })
}else{
this.filterItemCode = ''
}
if (params.fromAreaCode) {
//
this.fromAreaCode = params.fromAreaCode
filters.push({
column: "fromAreaCode",
action: "==",
value: params.fromAreaCode
})
// filters.push({
// column: "fromAreaCode",
// action: "==",
// value: params.fromAreaCode
// })
}else{
this.fromAreaCode = ''
}
if (params.toAreaCode) {
//
this.toAreaCode = params.toAreaCode
filters.push({
column: "toAreaCode",
action: "==",
value: params.toAreaCode
})
// filters.push({
// column: "toAreaCode",
// action: "==",
// value: params.toAreaCode
// })
}else{
this.toAreaCode = ''
}
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
// var params = {
// filters: filters,
// pageNo: 1,
// pageSize: 100,
// }
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
// getIssueJobList(params).then(res => {

746
src/pages/issue/job/issueJob0816.vue

@ -0,0 +1,746 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter :isShowFromLocationCode="true" :isShowFromAreaCode="true" :isShowToAreaCode="true" :isShowProductionLineCode="true" :productionline="productionlineList"
ref="filter" otherTitle=""
:checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask"
@switchChangeWait="switchChangeWait"
@switchChangeToday="switchChangeToday"
: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">
<view v-for="(item, index) in jobList" :key="index">
<uni-swipe-action-item
:right-options="item.status=='2'?detailGiveupOptions:item.status=='1'?detailCloseOptions:detailOptions"
@click="swipeClick($event,item)">
<com-issue-job-card :dataContent="item" @click='openJobDetail(item)'></com-issue-job-card>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
<job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></job-list-popup>
<job-info-popup ref='jobInfoPopup'></job-info-popup>
<uni-load-more :status="loadingType" v-if="jobList.length>0" />
</view>
<win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button>
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode">
</winComScanBalance>
<!-- <winScanPackJob ref="scanPopup" @getResult='getScanResult'></winScanPackJob> -->
<jobList ref="jobList" @selectItem="selectItem"></jobList>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
cancleTakeIssueJob,
getIssueJobList,
getIssueJobByProductionline,
closeTakeIssueJob
} from '@/api/request2.js';
import {
goHome,
updateTitle
} from '@/common/basic.js';
import {
getBusinessType
} from '@/common/record.js';
import {
planRefreshTime
} from '@/common/config.js';
import {
getDetailOption,
getDetailGiveupOption,
getDetailCloseOption
} from '@/common/array.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comIssueJobCard from '@/pages/issue/coms/comIssueJobCard.vue'
import jobListPopup from '@/pages/issue/coms/jobListPopup.vue'
import jobInfoPopup from '@/pages/issue/coms/jobInfoPopup.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue"
import jobList from '@/mycomponents/jobList/jobList.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
export default {
name: 'issue',
components: {
comEmptyView,
jobFilter,
comIssueJobCard,
jobListPopup,
jobInfoPopup,
winScanPackJob,
winScanButton,
jobList,
winComScanBalance
},
data() {
return {
jobList: [],
pageNo: 1,
pageSize: 10,
totalCount: 0,
loadingType: "nomore",
checkedToday: false,
checkedWaitTask: false,
todayTime: "",
status: '1,2', //
detailOptions: [],
detailGiveupOptions: [],
productionlineList: [],
detailCloseOptions: [],
title: '',
productionLine: "",
fromLocation: "",
fromAreaCode: '', //
toAreaCode: '', //
filterItemCode: "",
businessTypeCode: "Issue",
businessType: null,
timer:null
};
},
onLoad(option) {
this.title = option.title
this.getIssueJobByProductionline()
},
onShow() {
this.timerRefresh();
},
onHide() {
this.stopRefresh();
},
onUnload(){
this.stopRefresh();
},
onReady() {
this.detailOptions = getDetailOption();
this.detailGiveupOptions = getDetailGiveupOption();
this.detailCloseOptions = getDetailCloseOption();
},
onReachBottom() {
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList('more', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
},
onPullDownRefresh() {
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
},
//退
onBackPress(options) {
if (options.from === 'navigateBack') {
uni.navigateBack({
delta: 1
})
return false;
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
this.$refs.filter.openFilter();
}
},
methods: {
timerRefresh() {
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
this.stopRefresh();
var that = this;
this.timer = setInterval(function() {
that.getList('refresh', that.fromLocation, that.productionLine, that.filterItemCode,this.fromAreaCode,this.toAreaCode)
console.log('发料刷新');
}, planRefreshTime)
},
stopRefresh() {
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
}
},
getBusinessTypeFunc() {
getBusinessType(this.businessTypeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.fromInventoryStatuses = res.fromInventoryStatuses.split(',');
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList
// this.openScanPopup();
this.$refs.scanPopup.openScanPopup(this.businessType);
} else {
this.showErrorMessage(res.message)
}
});
},
getIssueJobByProductionline() {
getIssueJobByProductionline().then(res => {
if (res.code == 0) {
this.productionlineList = res.data.map(item => ({
value: item.value,
text: item.name
}))
this.productionlineList.unshift({
value: "",
text: "全部"
})
} else {
this.productionlineList = []
}
})
},
getList(type, fromLocation = '', productionLine = '',filterItemCode='',fromAreaCode='',toAreaCode='') {
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.jobList = [];
}
var filters = []
if (this.checkedToday) {
filters.push({
column: "create_time",
action: "betweeen",
value: this.todayTime
})
}
filters.push({
column: "status",
action: "in",
value: this.status
})
if (fromLocation) {
//
filters.push({
column: "fromLocationCode",
action: "==",
value: fromLocation
})
}
if(fromAreaCode){
//
filters.push({
column: "fromAreaCode",
action: "==",
value: fromAreaCode
})
}
if(toAreaCode){
//
filters.push({
column: "toAreaCode",
action: "==",
value: toAreaCode
})
}
if (productionLine) {
// 线
filters.push({
column: "productionLineCode",
action: "==",
value: productionLine
})
}
if(filterItemCode){
//
filters.push({
column: "itemCode",
action: "like",
value: filterItemCode
})
}
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: 100,
}
getIssueJobList(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
this.openScanPopup()
}
var list = res.data.list;
this.totalCount = res.data.total
updateTitle(this.title + "(" + this.totalCount + ")");
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
this.jobList = type === "refresh" ? list : this.jobList.concat(list);
this.pageNo++;
if (type === "refresh") {
uni.stopPullDownRefresh();
}
}).catch(error => {
if (type === "refresh") {
uni.stopPullDownRefresh();
}
updateTitle(this.title);
this.loadingType = "";
uni.hideLoading();
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
// })
if (params.status) {
this.status = params.status
}else{
this.status = "1,2"
}
if(params.creationTime==""){
this.checkedToday = false;
}
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 = ''
}
if (params.fromAreaCode) {
//
this.fromAreaCode = params.fromAreaCode
// filters.push({
// column: "fromAreaCode",
// action: "==",
// value: params.fromAreaCode
// })
}else{
this.fromAreaCode = ''
}
if (params.toAreaCode) {
//
this.toAreaCode = params.toAreaCode
// filters.push({
// column: "toAreaCode",
// action: "==",
// value: params.toAreaCode
// })
}else{
this.toAreaCode = ''
}
// var params = {
// filters: filters,
// pageNo: 1,
// pageSize: 100,
// }
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
// 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.filterItemCode,this.fromAreaCode,this.toAreaCode)
},
productionLineCode(productionLineCode) {
this.productionLine = productionLineCode
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
},
getByAsnNumber(code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getPurchasereceiptByAsnNumber(code).then(res => {
uni.hideLoading();
if (res.data.total == 0) {
that.showMessage('未查找到' + '【' + code + '】的收货任务');
} else if (res.data.total == 1) {
this.$refs.scanAsnNumber.closeScanPopup();
that.openJobDetail(res.data.list[0]);
} else {
this.$refs.scanAsnNumber.closeScanPopup();
that.showItemList(res.data.list);
}
}).catch(error => {
uni.hideLoading();
that.showErrorMessage(error);
})
},
openJobDetail(item, scanMessage = '') {
this.getJobInfoByNumber(item.number,scanMessage)
},
showItemList(itemList) {
this.$refs.jobListPopup.openPopup(itemList);
},
selectedItem(item) {
this.openJobDetail(item);
},
selectItem(item) {
this.$refs.scanPopup.closeScanPopup();
this.openJobDetail(item, this.scanMessage);
},
swipeClick(e, dataContent) {
if (e.content.text == "详情") {
this.openjobInfoPopup(dataContent);
} else if (e.content.text == "放弃") {
this.$refs.comMessage.showQuestionMessage("确定要放弃当前任务?",
res => {
if (res) {
this.cancleJob(dataContent.masterId);
}
});
} else if (e.content.text == "关闭") {
this.$refs.comMessage.showQuestionMessage("确定要关闭当前任务?",
res => {
if (res) {
this.closeJob(dataContent.masterId);
}
});
}
},
openjobInfoPopup(item) {
this.$refs.jobInfoPopup.openPopup(item)
},
cancleJob(id) {
cancleTakeIssueJob(id).then(res => {
if (res.data) {
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
uni.showToast({
title: "放弃任务成功"
})
} else {
this.showMessage("放弃任务失败")
}
}).catch(error => {
this.showMessage(error)
})
},
closeJob(id) {
uni.showLoading({
title: "加载中....",
mask: true
});
closeTakeIssueJob(id).then(res => {
uni.hideLoading()
if (res.data) {
this.getList("refresh")
uni.showToast({
title: "关闭任务成功"
})
} else {
this.showMessage("关闭任务失败")
}
}).catch(error => {
uni.hideLoading()
this.showMessage(error)
})
},
switchChangeToday(state, creationTime) {
this.checkedToday = state;
this.todayTime = creationTime;
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
},
switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state;
this.status = jobStatus;
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
},
getJobInfoByNumber(number,scanMessage){
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
var filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "number",
action: "==",
value: number
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getIssueJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + number + '】的发料任务');
} else {
var result =res.data.list[0];
if(result.acceptUserId&&result.acceptUserId!=this.$store.state.user.id){
this.$refs.comMessage.showErrorMessage("任务号["+result.number+"]已经被["+result.acceptUserName+"]承接,无法执行", res => {
if (res) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.getfocus()
}
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
}
});
return;
}
uni.navigateTo({
url: './issueDetail?id=' + result.masterId + '&status=' + result.status + '&scanMessage=' +
scanMessage + '&title=' + this.title
});
this.scanMessage=""
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
getScanNumber(code) {
this.getDataListByType(code)
},
getDataListByType(code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
var filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "number",
action: "==",
value: code
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getIssueJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的发料任务');
} else if (res.data.list.length == 1) {
that.openJobDetail(res.data.list[0]);
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
showMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.getfocus()
}
}
});
},
openScanPopup() {
if (this.businessType == null) {
this.getBusinessTypeFunc()
} else {
this.$refs.scanPopup.openScanPopup(this.businessType);
}
},
getScanResult(result) {
let balance = result.balance;
if (balance != null) {
this.scanMessage = ""
if (!result.label.batch) {
this.showMessage("批次为空")
return;
}
if (!result.label.itemCode) {
this.showMessage("物料号为空")
return;
}
try {
var filters = [{
column: "status",
action: "in",
value: '1,2'
},
{
column: "batch",
action: "==",
value: result.label.batch
},
{
column: "itemCode",
action: "==",
value: result.label.itemCode
},
{
column: "fromLocationCode",
action: "==",
value: balance.locationCode
}
]
getIssueJobList({
filters: filters,
pageNo: 1,
pageSize: 1000,
sort: 'createTime',
by: 'asc'
}).then(res => {
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 (list.length > 0) {
this.selectItem(list[0])
}
} else {
this.showMessage("按来源库位[" + balance.locationCode + "]批次[" + result.label.batch +
"]物料号[" + result.label.itemCode + "]未查找到任务\n" + "扫描[" + result
.scanMessage + "]")
}
}).catch(error => {
this.showMessage(error + "\n扫描[" + result.scanMessage + "]")
})
} catch (e) {
this.showMessage(e.message)
}
}
},
}
}
</script>
<style scoped lang="scss">
</style>

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

@ -48,7 +48,7 @@
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode">
</winComScanBalance>
<!-- <balanceQuery ref="refBalanceQuery"></balanceQuery> -->
<balanceQuery ref="refBalanceQuery" :businessTypeCode="businessTypeCode"></balanceQuery>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
@ -99,7 +99,7 @@
import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
// import balanceQuery from '@/mycomponents/query/balanceQuery.vue'
import balanceQuery from '@/mycomponents/query/balanceQuery.vue'
export default {
@ -114,7 +114,7 @@
recordDetailCard,
balanceSelect,
winComScanBalance,
// balanceQuery
balanceQuery
},
data() {
return {
@ -166,8 +166,8 @@
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
// this.$refs.refBalanceQuery.showDrawer();
// this.closeScanPopup();
this.$refs.refBalanceQuery.showDrawer();
this.closeScanPopup();
}
},
//
@ -178,10 +178,6 @@
mounted() {},
methods: {
// showDrawer() {
// this.$refs.showRight.open();
// },
getBusinessType() {
getBusinessType(this.businessTypeCode, res => {
if (res.success) {
@ -247,15 +243,71 @@
}
})
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
//
//
//,
if (pack.parentNumber) {
var checkData = item.subList.find(r => {
if (r.packingNumber == pack.parentNumber &&
r.batch == balance.batch) {
return r;
}
})
if (checkData) {
//
this.showErrorMessage("扫描箱码[" + pack.number + "]批次[" + balance.batch +
"]的父包装已经扫描")
console.log("父包装已经扫描")
} else {
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
}
item.subList.push(newDetail);
}
} else {
//
var checkData = item.subList.find(r => {
if (r.parentNumber == pack.number &&
r.batch == balance.batch) {
return r;
}
})
if (checkData) {
//
this.$refs.comMessage.showQuestionMessage("箱码[" + checkData.parentNumber+"]" + "批次[" + balance
.batch + "]是父包装,是否移除子包装", res => {
if (res) {
item.subList = [];
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
}
item.subList.push(newDetail);
}
})
console.log("扫描的是父包装,是否移除子包装")
} else {
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
}
item.subList.push(newDetail);
}
}
item.subList.push(newDetail);
this.scanPopupGetFocus()
} else {
if (detail.scaned == true) {
@ -390,11 +442,11 @@
// },
commit() {
if(this.positionInfo=='请选择生产线'||!this.positionInfo){
if (this.positionInfo == '请选择生产线' || !this.positionInfo) {
this.showErrorMessage("请选择生产线")
return
}
uni.showLoading({
title: "提交中....",
mask: true

256
src/pages/issue/record/directIssue0816.vue

@ -18,9 +18,8 @@
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowFromLocation="false" @removeItem="removeItem(index,item)"
:isShowToLocation="false" :isShowParentToLocation="false" @updateData="updateData"
@removePack="removePack">
@removePack="removePack" :isShowParentPack="false">
</record-com-detail-card>
</view>
</view>
</scroll-view>
@ -45,9 +44,10 @@
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode">
</winComScanBalance>
<win-scan-parent-package ref="scanPopup" @getResult='getScanResult'></win-scan-parent-package>
<!-- <win-scan-package ref="scanPopup" @getResult='getScanResult'></win-scan-package> -->
<!-- <winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode">
</winComScanBalance> -->
<!-- <balanceQuery ref="refBalanceQuery"></balanceQuery> -->
<comMessage ref="comMessage"></comMessage>
</view>
@ -57,7 +57,7 @@
import {
issueRecordSubmit,
getWorkShopLineStation,
getBalanceByFilter
getTransactionByFilter
} from '@/api/request2.js';
import {
@ -79,6 +79,7 @@
getBusinessType,
createItemInfo,
createDetailInfo,
createDetailByPackInfo,
calcTreeHandleQty,
calcHandleQty
} from '@/common/record.js';
@ -100,7 +101,7 @@
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
// import balanceQuery from '@/mycomponents/query/balanceQuery.vue'
import winScanParentPackage from '@/mycomponents/scan/winScanParentPackage.vue'
export default {
components: {
@ -114,6 +115,7 @@
recordDetailCard,
balanceSelect,
winComScanBalance,
winScanParentPackage
// balanceQuery
},
data() {
@ -181,7 +183,6 @@
// showDrawer() {
// this.$refs.showRight.open();
// },
getBusinessType() {
getBusinessType(this.businessTypeCode, res => {
if (res.success) {
@ -197,72 +198,117 @@
getScanResult(result) {
let pack = result.package;
let balance = result.balance;
let childBalance = result.balance.childBalance;
let parentBalance = result.balance.parentBalance[0];
//1.
if (this.itemCode) {
var item = this.detailSource.find(res => res.itemCode == pack.itemCode)
if (item == undefined) {
this.showErrorMessage("请扫描物料为【" + this.itemCode + "】不在此次发料记录中")
return;
}
if (item.subList.length > 0) {
var detail = item.subList.find(r => {
if (r.packingNumber == pack.number &&
r.batch == pack.batch) {
return r;
}
})
if (this.fromLocationCode && this.fromLocationCode != balance.locationCode) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]在库位[" + this
.fromLocationCode + "]没有库存余额")
return;
if (detail && detail.scaned) {
this.showErrorMessage("箱码[" + pack.number + "批次[" + pack.batch + "]重复扫描")
return;
}
}
}
//2.
//
if (pack.parentNumber) {
this.setPackageData(result);
//
if (childBalance.length == 0) {
this.getTransactionList(pack.number, transactionRes => {
if (transactionRes.length == 0) {
this.setPackageData(parentBalance, pack);
} else {
this.showErrorMessage("箱码[" + pack.number + "批次[" + pack.batch +
"]已经发过料")
}
});
} else { //
this.setPackageData(childBalance[0], pack);
}
} else {
this.setContainerData(result);
//
if(pack.subList.length==0){
this.getTransactionList(pack.number, transactionRes => {
if (transactionRes.length == 0) {
this.setPackageData(childBalance[0], pack);
} else {
this.showErrorMessage("箱码[" + pack.number + "批次[" + pack.batch +
"]已经发过料")
}
});
}else {
let packparams = '';
pack.subList.forEach(pack => {
packparams = packparams + pack.number + ','
})
packparams = packparams.trimEnd(',');
this.getTransactionList(packparams, transactionRes => {
//
pack.subList.forEach(sub => {
let subBalance = childBalance.find(r => r.packingNumber == sub.number);
if (subBalance) {
//
if (subBalance.locationCode == parentBalance.locationCode) {
this.setPackageData(subBalance, sub);
} else {
//
}
} else {
//
//
let transaction = transactionRes.find(p => p.packingNumber == sub
.number)
if (!transaction) {
this.setPackageData(parentBalance, sub);
}
}
})
})
}
}
},
setPackageData(result) {
let balance = result.balance;
let label = result.label;
let pack = result.package;
setPackageData(balance, pack) {
var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) {
return res
}
})
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.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
let newDetail = this.createPackageDetail(balance, pack);
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
this.detailSource.push(itemp);
this.itemCode = balance.itemCode;
this.fromLocationCode = balance.locationCode
this.fromLocationCode = balance.locationCode;
this.fromWarehouseCode = balance.warehouseCode;
this.scanPopupGetFocus()
} else {
var detail = item.subList.find(r => {
if (r.packingNumber == pack.number &&
r.batch == balance.batch &&
r.locationCode == balance.locationCode &&
r.batch == pack.batch &&
r.locationCode == pack.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 = pack.packUnit;
newDetail.packQty = pack.packQty;
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
let newDetail = this.createPackageDetail(balance, pack);
item.subList.push(newDetail);
this.scanPopupGetFocus()
} else {
@ -274,73 +320,55 @@
calcHandleQty(this.detailSource);
},
setContainerData(result) {
//1.
this.getBalance(result, resList => {
});
},
getBalance(result, callback) {
let packageInfo = result.package;
let filters = [{
column: "itemCode",
action: "==",
value: packageInfo.itemCode
}, {
column: "batch",
action: "==",
value: packageInfo.batch
}];
if (this.businessType.outInventoryStatuses != null) {
filters.push({
column: "inventoryStatus",
action: "in",
value: this.businessType.outInventoryStatuses
})
}
if (this.businessType.outAreaTypes != null) {
filters.push({
column: "areaType",
//
getTransactionList(packingNumbers, callback) {
let params = {
filters: [{
column: "businessType",
action: "==",
value: "发料"
}, {
column: "packingNumber",
action: "in",
value: this.businessType.outAreaTypes
})
}
let packingNumber = packageInfo.number;
packageInfo.subList.forEach(sub => {
packingNumber = packingNumber + ',' + sub.number
})
packingNumber = packingNumber.trimEnd(',');
filters.push({
column: "packingNumber",
action: "in",
value: packingNumber
})
var params = {
filters: filters,
value: packingNumbers
}, {
column: "inventoryAction",
action: "==",
value: "OUT"
}],
pageSize: 20,
pageNo: 1,
pageSize: 100,
sort: "",
by: "ASC"
}
getBalanceByFilter(params).then(res => {
if (res.data.list.length > 0) {
res.data.list.forEach(r => {
// if (packageInfo.parentNumber !== null) {
// r.parentPackingNumber = packageInfo.parentNumber
// } else {
// r.parentPackingNumber = packageInfo.number
// }
})
callback(res.data.list)
} else {
}
getTransactionByFilter(params).then(res => {
callback(res.data.list);
}).catch(err => {
this.showErrorMessage(err.message);
callback([]);
})
},
createPackageDetail(balance, pack) {
let newDetail = {};
if (balance.packingNumber != pack.number) {
newDetail = createDetailByPackInfo(pack);
newDetail.inventoryStatus = balance.inventoryStatus;
} else {
newDetail = createDetailInfo(balance, pack);
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
}
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
return newDetail;
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
@ -432,12 +460,18 @@
this.updateData();
},
// openScanPopup() {
// if (this.businessType) {
// this.$refs.scanPopup.openScanPopup(this.businessType);
// } else {
// this.getBusinessType()
// }
// },
openScanPopup() {
if (this.businessType) {
this.$refs.scanPopup.openScanPopup(this.businessType);
} else {
this.getBusinessType()
}
setTimeout(r => {
this.$refs.scanPopup.openScanPopupByBusinessType(this.businessType);
})
},
showFromLocationPopup() {

27
src/pages/login/index.vue

@ -157,18 +157,21 @@
}
},
onLoad() {
getCaptchaImage().then(res => {
if (res) {
var code = res.data.img;
let base64 = 'data:image/jpeg;base64,' + code
// console.log("", base64)
this.imageSrc = base64.replace(/[\r\n]/g, "")
this.uuid = res.data.uuid
}
}).catch(error => {
this.showErrorMessage(error);
})
onLoad() {
if(this.needCode){
getCaptchaImage().then(res => {
if (res) {
var code = res.data.img;
let base64 = 'data:image/jpeg;base64,' + code
// console.log("", base64)
this.imageSrc = base64.replace(/[\r\n]/g, "")
this.uuid = res.data.uuid
}
}).catch(error => {
this.showErrorMessage(error);
})
}
this.getAppVersion()
},
methods: {

21
src/pages/productPutaway/record/productPutawayRecord.vue

@ -10,6 +10,7 @@
<view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowStatus="true" :isShowToLocation='false' @removeItem="removeItem(index,item)"
:isShowModifedLocation="true"
@updateData="updateData" @removePack="removePack" @editLocation="showScanToLocation">
</record-com-detail-card>
</view>
@ -147,6 +148,7 @@
getScanResult(result) {
let label = result.label;
let pack = result.package;
let errorHint=""
result.balance.forEach(
balance => {
let item = this.detailSource.find(res => {
@ -180,14 +182,19 @@
item.subList.push(newDetail);
} else {
if (detail.scaned == true) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch +
"]重复扫描")
errorHint+="箱码[" + balance.packingNumber + "批次[" + balance.batch +
"]重复扫描\n"
}
}
}
this.calcHandleQty();
}
)
if(errorHint){
this.showErrorMessage(errorHint)
}else {
this.scanPopupGetFocus()
}
},
getRecommendLocation(balance) {
@ -251,9 +258,6 @@
this.$forceUpdate();
},
updateData() {
this.calcHandleQty();
},
removeItem(index, item) {
this.removeRecommendLocation([item.expectinNumber]);
this.detailSource.splice(index, 1)
@ -423,13 +427,6 @@
if (res) {}
});
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);

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

@ -231,7 +231,14 @@
that.subList = res.data.subList;
that.jobStatus = res.data.status
that.jobToLocationCode = that.subList[0].toLocationCode
that.productionLineCode = that.subList[0].productionLineCode;
that.productionLineCode = that.subList[0].productionLineCode;
var valiDate = getSwitchInfoByCode("fgProductReceipCommitValidate")
if(valiDate){
that.jobContent.allowModifyLocation = 'TRUE'
}else{
that.jobContent.allowModifyLocation = 'FALSE'
}
// if (that.jobContent.allowModifyLocation == 'FALSE') {
// that.toLocationCode = that.subList[0].toLocationCode
// }

13
src/pages/productReceipt/job/productReceiptDetail.vue

@ -226,11 +226,16 @@
that.subList = res.data.subList;
that.jobStatus = res.data.status;
that.jobToLocationCode = that.subList[0].toLocationCode;
that.productionLineCode = that.jobContent.subList[0].productionLineCode;
if (that.jobContent.allowModifyLocation == 'FALSE') {
that.toLocationCode = that.subList[0].toLocationCode
that.productionLineCode = that.jobContent.subList[0].productionLineCode;
var valiDate = getSwitchInfoByCode("semiProductReceipCommitValidate")
if(valiDate){
that.jobContent.allowModifyLocation = 'TRUE'
}else{
that.jobContent.allowModifyLocation = 'FALSE'
}
// if (that.jobContent.allowModifyLocation == 'FALSE') {
// that.toLocationCode = that.subList[0].toLocationCode
// }
that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes)
that.detailSource = getDataSource(that.subList)
if (that.scanMessage) {

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

@ -34,7 +34,7 @@
:locationAreaTypeList="toLocationAreaTypeList"></locationCompare>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
<button class="btn_single_commit" hover-class="btn_commit_after" @click="autoCommit">提交</button>
</view>
</view>
</view>

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

@ -460,6 +460,17 @@
}else{
this.filterItemCode = ''
}
if (params.status) {
this.status = params.status
}else{
this.status = "1,2"
}
if(params.creationTime==""){
this.checkedToday = false;
}
this.todayTime = params.creationTime
this.getList('refresh', this.productionLine, this.filterItemCode)
},

91
src/pages/putaway/record/putawayRecord.vue

@ -5,10 +5,11 @@
</view>
<view class="page-wraper" v-if="detailSource.length>0">
<view class="page-header">
<view class="header_item">
来源库位 : {{fromLocationCode}}
<view class="header-view">
<view class="header_item">
来源库位 : {{fromLocationCode}}
</view>
</view>
<u-line />
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
@ -16,7 +17,10 @@
<view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowFromLocation="false" @removeItem="removeItem(index,item)"
@updateData="updateData" @removePack="removePack">
:isShowModifedLocation="true"
@updateData="updateData"
@editLocation="showScanToLocation"
@removePack="removePack">
</record-com-detail-card>
</view>
@ -43,14 +47,17 @@
<comMessage ref="comMessage"></comMessage>
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location>
<win-scan-location ref="scanToLocationCode" title="目标库位" @getLocation='getToLocationCode'
:locationAreaTypeList="toLocationAreaTypeList"></win-scan-location>
</view>
</template>
<script>
import {
putawayRecordSubmit,
validateItemAndLocation,
getPutawayRecommendLocation
getPutawayRecommendLocation,
checkItemCodeAndLocation,
recommendLocationRemoveExpectin
} from '@/api/request2.js';
import {
@ -116,7 +123,8 @@
showToLoaction: true,
recommendLocationList: [], //
fromWarehouseCode: '', //
businessTypeCode: "PurchasePutaway"
businessTypeCode: "PurchasePutaway",
editItem:{}
};
},
onLoad(option) {
@ -168,6 +176,7 @@
//
this.getRecommendLocation(balance, pack, toLocation => {
var itemp = createItemInfo(balance, pack);
itemp.toLocationCode = toLocation.locationCode;
let newDetail = createDetailInfo(balance, pack); //
newDetail.toLocationCode = toLocation.locationCode;
newDetail.toWarehouseCode = toLocation.toWarehouseCode;
@ -445,6 +454,7 @@
this.openScanPopup();
},
getToLocationCode(location, code) {
console.log( JSON.stringify(this.editItem) )
if (this.fromLocationCode == code) {
uni.showToast({
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致",
@ -452,7 +462,60 @@
})
return
}
this.toLocationCode = code;
var item = this.editItem.subList[0]
if(item){
var param ={
batch:item.batch,
inventoryStatus:item.inventoryStatus,
itemCode:item.itemCode,
toLocationCode:code,
expectinNumber: item.packingNumber + "-" + Date.now(),
}
checkItemCodeAndLocation(param).then(res=>{
if(res.data.recommendFlag){
this.editItem.toLocationCode = code;
}else {
if(res.data.errorMsg){
this.showErrorMessage("系统异常:"+res.data.errorMsg)
}else {
if(res.data.balanceMsg){
this.$refs.comMessage.showQuestionMessage("系统异常:"+res.data.balanceMsg, confirmRes => {
if (confirmRes) {
this.editItem.toLocationCode = code;
}else {
this.removeRecommendLocation(res.data.expectinNumberList)
}
});
}else {
this.editItem.toLocationCode = code;
}
}
}
}).catch(error=>{
this.showErrorMessage(error)
})
}
},
//
removeRecommendLocation(lst) {
let param = {
expectinNumberList: lst,
};
recommendLocationRemoveExpectin(param).then(res => {
}).catch(err => {
this.showErrorMessage('【' + lst.join(',') + '】移除预占用失败,请在PC端的预占用中移除')
})
},
showScanToLocation(item) {
this.editItem = item;
setTimeout(r => {
this.$refs.scanToLocationCode.openScanPopup();
})
},
showCommitSuccessMessage(hint) {
@ -460,6 +523,17 @@
this.clear();
})
},
showQuestionMessage(hint) {
this.$refs.comMessage.showQuestionMessage('已经有库存余额,是否继续上架?', res => {
if (res) {
}else {
}
});
},
clear() {
this.fromLocationInfo = {};
@ -467,6 +541,7 @@
this.fromWarehouseCode = '';
this.toWarehouseCode = '';
this.detailSource = [];
this.editItem ={}
}
}
}

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

@ -143,8 +143,8 @@
label: {},
fromInventoryStatuses: "",
packageInfo: {},
toLocationAreaTypeList:[]
toLocationAreaTypeList: []
}
},
created() {
@ -197,7 +197,7 @@
that.fromInventoryStatuses = this.jobContent.outInventoryStatuses
that.toLocation = that.dataContent[0];
that.toLocationCode = that.dataContent[0].toLocationCode;
that.toLocationAreaTypeList=getDirectoryItemArray(this.jobContent.toAreaTypes)
that.toLocationAreaTypeList = getDirectoryItemArray(this.jobContent.toAreaTypes)
// that.fromLocationList = that.getFromLocationList();
}
},
@ -231,7 +231,7 @@
let location = this.fromLocationList.find(r => r == fromlocation)
if (location == undefined) {
this.fromLocationCode = ''
this.showErrorMessage('发料库位【' + fromlocation + '】不存在',res=>{
this.showErrorMessage('发料库位【' + fromlocation + '】不存在', res => {
this.getfocus();
})
}
@ -250,9 +250,9 @@
let item = this.toLocation.Items.find(r => r.itemCode == result.package.itemCode);
if (!item) {
this.showErrorMessage('扫描物料代码不属于该任务',
res => {
this.getfocus();
});
res => {
this.getfocus();
});
return
}
if (result.package.packUnit !== item.packUnit) {
@ -267,7 +267,7 @@
}
}
},
//
getToLocationBalance(result) {
uni.showLoading({
@ -289,7 +289,7 @@
value: result.package.number
})
}
filters.push({
column: "itemCode",
action: "==",
@ -300,14 +300,14 @@
action: "==",
value: result.package.batch
})
filters.push({
column: "areaType",
action: "in",
value: this.toLocationAreaTypeList.join(',')
})
var params = {
filters: filters,
pageNo: 1,
@ -412,12 +412,14 @@
res => {
this.getfocus();
})
}
},
selectBalanceItem(balance) {
this.afterGetBalance(this.label, balance, this.packageInfo);
if(balance){
this.afterGetBalance(this.label, balance, this.packageInfo);
}
},
afterGetBalance(label, balance, packageInfo) {
@ -431,7 +433,7 @@
that.fromLocationCode = balance.locationCode;
let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode);
//
if (fromLocation != undefined) {
if (fromLocation && !fromLocation.isNewAdd) {
let batch = fromLocation.Batchs.find(r => r.batch == lot);
if (batch != undefined) {
if (batch.Records == undefined) {
@ -487,8 +489,24 @@
}
}
} else {
let locaion = that.createLocationInfo(label, balance, packageInfo);
item.Locations.push(locaion);
if (this.jobContent.allowModifyLocation == "TRUE") {
this.showQuestionMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode +
"】与推荐的库位不一致,是否要继续发料?", res => {
if (res) {
let locaion = that.createLocationInfo(label, balance, packageInfo);
item.Locations.push(locaion);
this.getfocus();
that.$emit("afterScan");
}
})
} else {
this.showErrorMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode +
"】与推荐的库位不一致,不允许继续发料?")
}
}
} catch (e) {
this.showErrorMessage(e.stack,
@ -506,6 +524,7 @@
qty: balance.qty,
uom: balance.uom,
handleQty: 0,
isNewAdd: true,
Batchs: []
}
let batch = this.createBatchInfo(label, balance, packageInfo);

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

@ -30,7 +30,7 @@
:locationAreaTypeList="toLocationAreaTypeList"></requiredLocation>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="submit">提交</button>
<button class="btn_single_commit" hover-class="btn_commit_after" @click="clickSubmit">提交</button>
</view>
</view>
</view>
@ -225,6 +225,58 @@
});
},
clickSubmit(){
let str=""
var totalQty =0;
var taskQty =0;
this.detailSource.forEach(detail => {
detail.Items.forEach(item => {
taskQty =calc.add(taskQty,item.qty)
item.Locations.forEach(lco => {
lco.Batchs.forEach(batch => {
batch.Records.forEach(record => {
if (batch.qty != record.qty) {
var tempHandleQty = 0
if (record.qty) {
tempHandleQty = record.qty
} else {
tempHandleQty = 0
}
if (batch.qty != 0) {
str +=
`包装号【${record.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${batch.qty}】不一致\n`
}
}
if(record){
var hanleQty =record.qty?record.qty:0
totalQty = calc.add(totalQty,hanleQty)
}
})
})
})
})
})
if(str){
str = '任务明细未全部完成,是否提交?\n' + str
}
if(totalQty!=taskQty){
str ="扫描数量["+totalQty+"]与任务数量不一致["+taskQty+"],是否提交"
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
//
this.$throttle(this.submitJob, 2000, this)()
} else {
this.scanPopupGetFocus()
}
});
}else {
//
this.$throttle(this.submitJob, 2000, this)()
}
},
submit() {
var scanCount = this.getScanCount(this.subList);
@ -277,6 +329,11 @@
mask: true
});
var params = this.setParams()
if (!params.subList || params.subList.length == 0) {
uni.hideLoading()
this.showErrorMessage("请扫描您需要提交的补料任务")
return
}
console.log("提交参数", JSON.stringify(params));
repleinshJobSubmit(params).then(res => {
uni.hideLoading()

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

@ -281,29 +281,37 @@
title: "加载中­....",
mask: true
});
var filters = []
if (this.checkedToday) {
filters.push({
column: "create_time",
action: "betweeen",
value: this.todayTime
})
}
// 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: "status",
// action: "in",
// value: this.status
// })
if (params.status) {
this.status = params.status
}else{
this.status = "1,2"
}
if(params.creationTime==""){
this.checkedToday = false;
}
if (params.fromLocationCode) {
//
this.fromLocationCode = params.fromLocationCode
filters.push({
column: "fromLocationCode",
action: "==",
value: params.fromLocationCode
})
// filters.push({
// column: "fromLocationCode",
// action: "==",
// value: params.fromLocationCode
// })
}else{
this.fromLocationCode = ''
}
@ -311,19 +319,19 @@
if (params.itemCode) {
//
this.filterItemCode = params.itemCode
filters.push({
column: "itemCode",
action: "like",
value: params.itemCode
})
// filters.push({
// column: "itemCode",
// action: "like",
// value: params.itemCode
// })
}else{
this.filterItemCode = ''
}
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
// var params = {
// filters: filters,
// pageNo: 1,
// pageSize: 100,
// }
this.getList('refresh', this.fromLocationCode, this.filterItemCode)
// getRepleinshJobList(params).then(res => {

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

@ -44,6 +44,7 @@
</view>
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode">
</winComScanBalance>
<balanceQuery ref="refBalanceQuery" :businessTypeCode="businessTypeCode"></balanceQuery>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
@ -94,6 +95,7 @@
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
import balanceQuery from '@/mycomponents/query/balanceQuery.vue'
export default {
components: {
@ -104,7 +106,8 @@
winScanLocation,
winScanPackAndLocation,
recordComDetailCard,
winComScanBalance
winComScanBalance,
balanceQuery
},
data() {
return {
@ -137,6 +140,9 @@
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
this.$refs.refBalanceQuery.showDrawer();
this.closeScanPopup();
}
},
//
@ -261,15 +267,70 @@
}
})
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
//
//
//,
if (pack.parentNumber) {
var checkData = item.subList.find(r => {
if (r.packingNumber == pack.parentNumber &&
r.batch == balance.batch) {
return r;
}
})
if (checkData) {
//
this.showErrorMessage("箱码[" + pack.number + "]批次[" + balance.batch +
"]的父包装已经扫描")
console.log("父包装已经扫描")
} else {
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
}
item.subList.push(newDetail);
}
} else {
//
var checkData = item.subList.find(r => {
if (r.parentNumber == pack.number &&
r.batch == balance.batch) {
return r;
}
})
if (checkData) {
//
this.$refs.comMessage.showQuestionMessage("扫描箱码[" + checkData.parentNumber+"]" + "批次[" + balance
.batch + "]是父包装,是否移除子包装", res => {
if (res) {
item.subList = [];
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
}
item.subList.push(newDetail);
}
})
console.log("扫描的是父包装,是否移除子包装")
} else {
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
}
item.subList.push(newDetail);
}
}
item.subList.push(newDetail);
this.scanPopupGetFocus()
} else {
if (detail.scaned == true) {

Loading…
Cancel
Save