Browse Source

非生产领料

pda_nev
李俊城 12 months ago
parent
commit
6c64f8445f
  1. 8
      fe/PDA/api/index.js
  2. 27
      fe/PDA/mycomponents/comjob/comJobScanDetail.vue
  3. 12
      fe/PDA/mycomponents/coms/task/comKittingIssue.vue
  4. 56
      fe/PDA/mycomponents/wincom/winScanByProductCode.vue
  5. 39
      fe/PDA/pages.js
  6. 42
      fe/PDA/pages.json
  7. 2
      fe/PDA/pages/task/kittingIssueJob.vue
  8. 6
      fe/PDA/pages/task/kittingIssueJobDetail.vue
  9. 124
      fe/PDA/pages/task/kittingIssueJobDetailByQty.vue
  10. 4
      fe/PDA/pages/task/unProducePick.vue
  11. 178
      fe/PDA/pages/task/unProducePickWip.vue
  12. 429
      fe/PDA/pages/task/unProducePickWipDetail.vue
  13. 5
      fe/PDA/pages/task/unProduceReturn.vue
  14. 1
      fe/PDA/pages/task/unProduceReturnDetail.vue
  15. 178
      fe/PDA/pages/task/unProduceReturnWip.vue
  16. 429
      fe/PDA/pages/task/unProduceReturnWipDetail.vue

8
fe/PDA/api/index.js

@ -208,6 +208,14 @@ export const getitems = (code) => request(
method: 'get', method: 'get',
data: code data: code
}); });
//
//查询单件码 通过单件码查询零件号信息
export const getMesBarCode = (mesBarCode) => request(
devUrl + "/api/pda/store/product-receipt/get-itemcode-by-mesbarcode?mesBarCode=" + mesBarCode, {
method: 'post',
data: {}
});
//根据库位查询零件 //根据库位查询零件
export const getItemsByLocation = (params) => promise( export const getItemsByLocation = (params) => promise(

27
fe/PDA/mycomponents/comjob/comJobScanDetail.vue

@ -10,13 +10,21 @@
</view> --> </view> -->
<view class="cell_box uni-flex uni-row margin_top" > <view class="cell_box uni-flex uni-row margin_top" >
<view class="cell_info"> <view class="cell_info">
<view class="text_lightblue">总数量</view> <view class="text_lightblue">{{allCountHint}}</view>
<view class="text_black text_bold">{{ allCount}}</view> <view class="text_black text_bold">{{ allCount}}</view>
</view> </view>
<view class="cell_info" v-if="isShowScanHint"> <view class="cell_info" v-if="isShowScanHint">
<view class="text_lightblue">{{scanHint}}</view> <view class="text_lightblue">{{scanHint}}</view>
<view class="text_black text_bold">{{ scanCount}}</view> <view class="text_black text_bold">{{ scanCount}}</view>
</view> </view>
<view class="cell_info" v-if="isShowOther">
<view class="text_lightblue">未发数量</view>
<view class="text_black text_bold">{{ allCount-scanCount}}</view>
</view>
<view class="cell_info" v-if="isShowShouRong">
<view class="text_lightblue">收容数</view>
<view class="text_black text_bold">{{shouRongCount}}</view>
</view>
</view> </view>
</view> </view>
</template> </template>
@ -38,6 +46,7 @@
type: Object, type: Object,
default: {} default: {}
}, },
allCount: { allCount: {
type: Number, type: Number,
default: 0 default: 0
@ -46,6 +55,14 @@
type: Number, type: Number,
default: 0 default: 0
}, },
shouRongCount: {
type: Number,
default: null
},
allCountHint: {
type: String,
default: "总数量"
},
scanHint: { scanHint: {
type: String, type: String,
default: "已扫描" default: "已扫描"
@ -53,6 +70,14 @@
isShowScanHint:{ isShowScanHint:{
type: Boolean, type: Boolean,
default: true default: true
},
isShowOther:{
type: Boolean,
default: false
},
isShowShouRong:{
type: Boolean,
default: false
} }
}, },
data() { data() {

12
fe/PDA/mycomponents/coms/task/comKittingIssue.vue

@ -13,6 +13,18 @@
<text>{{dataContent.kittingRequestNumber}}</text> <text>{{dataContent.kittingRequestNumber}}</text>
<!-- <text>申请单{{dataContent.materialRequestNumber}}</text> --> <!-- <text>申请单{{dataContent.materialRequestNumber}}</text> -->
</view> </view>
<view class="label_order" v-if="dataContent.enumIssueSendType==1">
<text>类型 : 按数量发料</text>
<!-- <text>申请单{{dataContent.materialRequestNumber}}</text> -->
</view>
<view class="label_order" v-else>
<text>类型 : 按箱发料</text>
<!-- <text>申请单{{dataContent.materialRequestNumber}}</text> -->
</view>
<view class="label_order">
<text>操作人 : {{dataContent.worker}}</text>
<!-- <text>申请单{{dataContent.materialRequestNumber}}</text> -->
</view>
<!-- <view class="label_order"> <!-- <view class="label_order">
<image class="icon_normal" src="@/static/icons_ui/icon_prod_line.svg"></image> <image class="icon_normal" src="@/static/icons_ui/icon_prod_line.svg"></image>
<text>{{dataContent.prodLine}}</text> <text>{{dataContent.prodLine}}</text>

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

@ -30,6 +30,7 @@
import comMessage from '@/mycomponents/common/comMessage.vue' import comMessage from '@/mycomponents/common/comMessage.vue'
import { import {
getitems, getitems,
getMesBarCode
} from '@/api/index.js'; } from '@/api/index.js';
export default { export default {
@ -77,26 +78,49 @@
mask: true mask: true
}) })
getitems(result.data.code).then(item => {
if (item) { getMesBarCode(result.data.code).then(item=>{
this.losefocus(); //,getfocus() if (item) {
this.scanResult = { this.losefocus(); //,getfocus()
itemCode:item.code, this.scanResult = {
itemName:item.name, scanCode:result.data.code,
itemDesc1:item.desc1, itemCode:item.itemCode,
stdPackQty: item.stdPackQty, itemName:item.itemName,
uom: item.basicUom itemDesc1:item.itemDesc1,
}; stdPackQty: item.stdPackQty,
uni.hideLoading(); uom: item.uom
this.callBack(); };
} else { uni.hideLoading();
this.showMessage('单件码【' + result.data.code + '】,在物料表中不存在') this.callBack();
uni.hideLoading(); } else {
} this.showMessage('单件码【' + result.data.code + '】,不存在')
uni.hideLoading();
}
}).catch(err => { }).catch(err => {
uni.hideLoading(); uni.hideLoading();
this.showMessage(err.message) this.showMessage(err.message)
}); });
// getitems(result.data.code).then(item => {
// if (item) {
// this.losefocus(); //,getfocus()
// this.scanResult = {
// itemCode:item.code,
// itemName:item.name,
// itemDesc1:item.desc1,
// stdPackQty: item.stdPackQty,
// uom: item.basicUom
// };
// uni.hideLoading();
// this.callBack();
// } else {
// this.showMessage('' + result.data.code + ',')
// uni.hideLoading();
// }
// }).catch(err => {
// uni.hideLoading();
// this.showMessage(err.message)
// });
} }
}, },

39
fe/PDA/pages.js

@ -556,17 +556,33 @@ module.exports = () => ({
"enablePullDownRefresh": true "enablePullDownRefresh": true
} }
}, },
{ {
"path": "pages/task/unProduceReturn", "path": "pages/task/unProducePickDetail",
"style": { "style": {
"navigationBarTitleText": "非生产退料", "navigationBarTitleText": "非生产领料详情",
"enablePullDownRefresh": true "enablePullDownRefresh": true
} }
}, },
{ {
"path": "pages/task/unProducePickDetail", "path": "pages/task/unProducePickWip",
"style": { "style": {
"navigationBarTitleText": "非生产领料详情", "navigationBarTitleText": "非生产领料(线边)",
"enablePullDownRefresh": true
}
},
{
"path": "pages/task/unProducePickWipDetail",
"style": {
"navigationBarTitleText": "非生产领料(线边)详情",
"enablePullDownRefresh": true
}
},
{
"path": "pages/task/unProduceReturn",
"style": {
"navigationBarTitleText": "非生产退料",
"enablePullDownRefresh": true "enablePullDownRefresh": true
} }
}, },
@ -577,6 +593,21 @@ module.exports = () => ({
"enablePullDownRefresh": true "enablePullDownRefresh": true
} }
}, },
{
"path": "pages/task/unProduceReturnWip",
"style": {
"navigationBarTitleText": "非生产退料(线边)",
"enablePullDownRefresh": true
}
},
{
"path": "pages/task/unProduceReturnWipDetail",
"style": {
"navigationBarTitleText": "非生产退料(线边)详情",
"enablePullDownRefresh": true
}
},
{ {
"path": "pages/task/deliverBoard", "path": "pages/task/deliverBoard",
"style": { "style": {

42
fe/PDA/pages.json

@ -539,19 +539,37 @@
} }
}, },
{ {
"path": "pages/task/unProduceReturn", "path": "pages/task/unProducePickDetail",
"style": { "style": {
"navigationBarTitleText": "非生产退料", "navigationBarTitleText": "非生产领料详情",
"enablePullDownRefresh": true "enablePullDownRefresh": true
} }
}, },
{ {
"path": "pages/task/unProducePickDetail", "path": "pages/task/unProducePickWip",
"style": { "style": {
"navigationBarTitleText": "非生产领料详情", "navigationBarTitleText": "非生产领料(线边)",
"enablePullDownRefresh": true
}
},
{
"path": "pages/task/unProducePickWipDetail",
"style": {
"navigationBarTitleText": "非生产领料(线边)详情",
"enablePullDownRefresh": true
}
},
{
"path": "pages/task/unProduceReturn",
"style": {
"navigationBarTitleText": "非生产退料",
"enablePullDownRefresh": true "enablePullDownRefresh": true
} }
}, },
{ {
"path": "pages/task/unProduceReturnDetail", "path": "pages/task/unProduceReturnDetail",
"style": { "style": {
@ -559,6 +577,22 @@
"enablePullDownRefresh": true "enablePullDownRefresh": true
} }
}, },
{
"path": "pages/task/unProduceReturnWip",
"style": {
"navigationBarTitleText": "非生产退料(线边)",
"enablePullDownRefresh": true
}
},
{
"path": "pages/task/unProduceReturnWipDetail",
"style": {
"navigationBarTitleText": "非生产退料(线边)详情",
"enablePullDownRefresh": true
}
},
{ {
"path": "pages/task/deliverBoard", "path": "pages/task/deliverBoard",
"style": { "style": {

2
fe/PDA/pages/task/kittingIssueJob.vue

@ -226,7 +226,7 @@
onPull() { onPull() {
this.getList('refresh'); this.getList('refresh');
}, },
onReach() { onReachBottom() {
// //
if (this.loadingType == 'loading' || this.loadingType == 'nomore') { if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return; return;

6
fe/PDA/pages/task/kittingIssueJobDetail.vue

@ -3,7 +3,11 @@
<page-meta root-font-size="16px"></page-meta> <page-meta root-font-size="16px"></page-meta>
<view class=""> <view class="">
<view class="top_card"> <view class="top_card">
<com-job-scan-detail :jobContent="datacontent" :allCount="allCount" :isShowScanHint="false"> <com-job-scan-detail :jobContent="datacontent"
:allCount="allCount"
:isShowScanHint="false"
allCountHint ="箱数"
>
</com-job-scan-detail> </com-job-scan-detail>
</view> </view>
<scroll-view scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll" <scroll-view scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll"

124
fe/PDA/pages/task/kittingIssueJobDetailByQty.vue

@ -3,7 +3,16 @@
<page-meta root-font-size="16px"></page-meta> <page-meta root-font-size="16px"></page-meta>
<view class=""> <view class="">
<view class="top_card"> <view class="top_card">
<com-job-scan-detail :jobContent="datacontent" :allCount="allCount" :isShowScanHint="false"> <com-job-scan-detail
:jobContent="datacontent"
:allCount="allCount"
:isShowScanHint="true"
scanHint="已发数"
:scanCount="scanCount"
:isShowOther="true"
:isShowShouRong="true"
:shouRongCount="shouRongCount"
>
</com-job-scan-detail> </com-job-scan-detail>
</view> </view>
<scroll-view scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll" <scroll-view scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll"
@ -69,11 +78,11 @@
</uni-tr> </uni-tr>
<uni-tr> <uni-tr>
<uni-td width="100" align="center">数量({{item.uom}})</uni-td> <uni-td width="100" align="center">数量({{item.uom}})</uni-td>
<uni-td width="120" align="center">{{item.handledFromQty}}</uni-td> <uni-td width="120" align="center">{{item.tempHandledFromQty}}</uni-td>
<uni-td width="120" align="center"> <uni-td width="120" align="center">
<view <view
style="display: flex;flex-direction: row;justify-content:center;align-items: center;"> style="display: flex;flex-direction: row;justify-content:center;align-items: center;">
<com-number-box ref="comNumberBoxRef" v-model="item.handledToQty" <com-number-box ref="comNumberBoxRef" v-model="item.tempHandledToQty"
:max="999999" :min="0" style='width: 100px;' :max="999999" :min="0" style='width: 100px;'
@change="qtyChanged($event,item,index)"> @change="qtyChanged($event,item,index)">
</com-number-box> </com-number-box>
@ -119,9 +128,8 @@
</view> </view>
<com-balance ref='issueitems' @selectedItem='selectedBalanceItem'></com-balance> <com-balance ref='issueitems' @selectedItem='selectedBalanceItem'></com-balance>
<win-scan-by-pack ref="scanPopupFrom" @getScanResult='getScanResultFrom' title="来源箱码"></win-scan-by-pack> <winScanLocationCode ref="locationFrom" title="来源库位" @getLocation="getFromLocation"></winScanLocationCode>
<winScanLocationCode ref="locationFrom" title="来源库位" @getLocation="geFromLocation"></winScanLocationCode> <winScanLocationCode ref="locationTo" title="目标库位" @getLocation="getToLocation"></winScanLocationCode>
<winScanLocationCode ref="locationTo" title="目标库位" @getLocation="geToLocation"></winScanLocationCode>
<winScanByProductCode ref="scanPackPopup" title="单件码" @getScanResult='getScanResult'></winScanByProductCode> <winScanByProductCode ref="scanPackPopup" title="单件码" @getScanResult='getScanResult'></winScanByProductCode>
<com-message ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()' <com-message ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'
@ -178,7 +186,7 @@
return { return {
id: "", id: "",
datacontent: {}, datacontent: {},
details: {}, details: [],
toLocation: '', toLocation: '',
scrollTop: 0, scrollTop: 0,
old: { old: {
@ -187,11 +195,13 @@
ispending: false, ispending: false,
balancesItem: null, balancesItem: null,
allCount: 0, allCount: 0,
scanCount:0,
isPack: true, isPack: true,
titleArray: ['箱标签'], titleArray: ['箱标签'],
jobStatus: "", jobStatus: "",
toLocationInfo: {}, toLocationInfo: {},
singCode: "" singCode: "",
shouRongCount:null
} }
}, },
props: { props: {
@ -248,7 +258,7 @@
openLocationFrom() { openLocationFrom() {
this.$refs.locationFrom.openScanPopup() this.$refs.locationFrom.openScanPopup()
}, },
geFromLocation(locationInfo) { getFromLocation(locationInfo) {
var current = this.details[0] var current = this.details[0]
if (locationInfo.code != current.recommendFromLocationCode) { if (locationInfo.code != current.recommendFromLocationCode) {
this.showMessage(" 扫描来源库位[" + locationInfo.code + "]与推荐来源库位[" + current this.showMessage(" 扫描来源库位[" + locationInfo.code + "]与推荐来源库位[" + current
@ -266,7 +276,7 @@
}, },
geToLocation(locationInfo) { getToLocation(locationInfo) {
var current = this.details[0] var current = this.details[0]
if (locationInfo.code != current.recommendToLocationCode) { if (locationInfo.code != current.recommendToLocationCode) {
this.showMessage("扫描目标库位[" + locationInfo.code + "]与推荐目标库位[" + current this.showMessage("扫描目标库位[" + locationInfo.code + "]与推荐目标库位[" + current
@ -310,9 +320,25 @@
} }
); );
that.ispending = item.jobStatus === 2; that.ispending = item.jobStatus === 2;
this.allCount = that.details.length; this.allCount = that.details[0].recommendFromQty;
this.scanCount = that.details[0].handledToQty;
that.details[0].defaultHandleQty = that.details[0].handledFromQty; that.details[0].defaultHandleQty = that.details[0].handledFromQty;
that.details[0].tempHandledToQty =0
that.details[0].tempHandledFromQty =0
//
getCountByItemCode(that.details[0].itemCode).then(res => {
if (res) {
var qty = res.qty;
this.shouRongCount = qty;
this.details[0].tempHandledToQty = qty;
this.details[0].tempHandledFromQty = qty;
this.$forceUpdate()
} else {
this.showMessage("没有查找到[" + that.details[0].itemCode + "]的收容数")
}
}).catch(error => {
this.showMessage(error)
})
} }
uni.hideLoading(); uni.hideLoading();
}) })
@ -331,56 +357,11 @@
this.showMessage('在任务详情中,未找到物料号【' + result.itemCode + '】'); this.showMessage('在任务详情中,未找到物料号【' + result.itemCode + '】');
return; return;
} }
// this.singCode = result.itemCode
getCountByItemCode(result.itemCode).then(res => {
if (res) {
this.singCode = result.itemCode
var qty = res.qty;
this.details[0].handledFromQty = this.details[0].handledFromQty + qty;
this.details[0].handledToQty = this.details[0].handledFromQty;
} else {
this.showMessage("没有查找到[" + result.itemCode + "]的收容数")
}
console.log("数量", res)
}).catch(error => {
this.showMessage(error)
})
},
getScanResultFrom(result) {
var fromData = result.data;
var data = this.details.filter(r => r.itemCode == result.data.itemCode)
if (data.length == 0) {
this.showMessage("扫描的箱码[" + fromData.code + "]的物品不在列表中")
return;
}
this.getBalance(result, res => {
if (res.totalCount > 0) {
var balancesItem = res.items[0];
var item = data[0];
item.handledFromContainerCode = balancesItem.containerCode
item.handledFromPackingCode = balancesItem.packingCode
item.handledFromSupplierBatch = balancesItem.supplierBatch
item.handledFromArriveDate = balancesItem.arriveDate
item.handledFromProduceDate = balancesItem.produceDate
item.handledFromExpireDate = balancesItem.expireDate
item.handledFromLot = balancesItem.lot
item.handledFromLocationCode = balancesItem.locationCode
item.handledFromLocationArea = balancesItem.locationArea
item.handledFromLocationGroup = balancesItem.locationGroup
item.handledFromLocationErpCode = balancesItem.locationErpCode
item.handledFromWarehouseCode = balancesItem.warehouseCode
item.handledFromQty = balancesItem.qty;
item.handledToQty = item.handledFromQty;
this.$forceUpdate()
}
});
}, },
// //
getBalance(result, callback) { getBalance(result, callback) {
uni.showLoading({ uni.showLoading({
@ -448,7 +429,7 @@
return; return;
} }
if (that.details[0].handledToQty == 0 || that.details[0].handledToQty == "") { if (that.details[0].itempHandledToQty == 0 || that.details[0].itempHandledToQty == "") {
this.showMessage('发料数量必须大于0'); this.showMessage('发料数量必须大于0');
return; return;
} }
@ -463,7 +444,8 @@
title: "提交中...", title: "提交中...",
mask: true mask: true
}); });
that.details[0].handledFromQty =that.details[0].handledToQty; that.details[0].handledFromQty =that.details[0].tempHandledToQty
that.details[0].handledToQty =that.details[0].tempHandledToQty
let params = that.details[0]; let params = that.details[0];
finshKittingIssueJob(that.id, params.id, params) finshKittingIssueJob(that.id, params.id, params)
.then(res => { .then(res => {
@ -511,24 +493,20 @@
}, },
qtyChanged(value, item, index) { qtyChanged(value, item, index) {
if (item.handledToQty == 0) { if (item.tempHandledToQty == 0) {
this.$refs.comNumberBoxRef[0].setValue(0); this.$refs.comNumberBoxRef[0].setValue(0);
this.showMessage('请先扫描单件码') this.showMessage('请先扫描单件码')
return; return;
} }
if (value == 0) { if (value == 0) {
this.showMessage('发料数量必须大于0') this.showMessage('发料数量必须大于0')
item.handledToQty = item.handledFromQty item.tempHandledToQty =item.tempHandledFromQty
this.$refs.comNumberBoxRef[0].setValue(item.handledToQty); this.$refs.comNumberBoxRef[0].setValue(item.tempHandledToQty);
} else { return;
if (value < item.defaultHandleQty) { }
this.showMessage('发料数量不能小于实际来源数量' + item.defaultHandleQty) item.tempHandledFromQty =value;
item.handledToQty = item.defaultHandleQty==0?item.handledFromQty:item.defaultHandleQty console.log('item', item.tempHandledFromQty);
this.$refs.comNumberBoxRef[0].setValue(item.handledToQty); this.$forceUpdate();
}else {
item.handledFromQty = value
}
}
}, },
} }

4
fe/PDA/pages/task/unProducePick.vue

@ -110,7 +110,8 @@
pageSize: that.pageSize, pageSize: that.pageSize,
pageIndex: that.pageIndex, pageIndex: that.pageIndex,
isCreationTimeSorting: that.isIssueTimeChange, isCreationTimeSorting: that.isIssueTimeChange,
isToday: that.isToday isToday: that.isToday,
enumUnplannedIssueType:1
}; };
getUnProducePickList(params) getUnProducePickList(params)
.then(res => { .then(res => {
@ -119,6 +120,7 @@
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
} }
var list = res.items; var list = res.items;
// var list = res.items.filter(r=>r.unplannedIssueType==1);
this.loadingType = "loadmore"; this.loadingType = "loadmore";
if (list == null || list.length == 0) { if (list == null || list.length == 0) {
// //

178
fe/PDA/pages/task/unProducePickWip.vue

@ -0,0 +1,178 @@
<template>
<page-meta root-font-size="18px"></page-meta>
<view class="">
<win-empty-view v-if="dataList.length==0"></win-empty-view>
<view hover-class="uni-list-cell-hover" v-for="(item, index) in dataList" :key="item.id"
@click="openDetail(item)">
<comUnProduce :dataContent="item" fromType ="pick"></comUnProduce>
</view>
<uni-load-more :status="loadingType" v-if="dataList.length>0" />
<!-- <win-scan-button @goScan='openScanPopup'></win-scan-button> -->
<win-mulit-scan ref="scanPopup" :titleArray="titleArray" @getScanResult='getScanResult'>
</win-mulit-scan>
<com-scan-issue-list ref="scanList" @selectedItem="selectedItem"></com-scan-issue-list>
<!-- com-message必须放在最下层 -->
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import {
getUnProducePickList,
} from '@/api/index.js';
import {
goHome
} from '@/common/basic.js';
import winEmptyView from '@/mycomponents/wincom/winEmptyView.vue'
import comUnProduce from '@/mycomponents/coms/task/comUnProduce.vue';
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanButton from '@/mycomponents/wincom/winScanButton.vue'
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue'
import comScanIssueList from '@/mycomponents/scan/comScanIssueList.vue'
export default {
name: 'issue',
components: {
winEmptyView,
comUnProduce,
comMessage,
winScanButton,
winMulitScan,
comScanIssueList
},
data() {
return {
//popup
type: '',
dataList: [],
reload: false,
status: '',
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
},
pageSize: this.modelConfig,
pageIndex: 1,
isIssueTimeChange: false,
isToday: false,
titleArray: ['任务编号'],
loadingType: "nomore"
};
},
onShow() {
this.getList('refresh');
},
mounted() {
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}else if(e.index === 1){
window.location.reload();
}
},
methods: {
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
//
timeSortingChange() {
this.isIssueTimeChange = !this.isIssueTimeChange;
this.getList()
},
//
isTodayChange() {
this.isToday = !this.isToday
this.getList()
},
//
getList(type) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageIndex = 1;
this.dataList = [];
}
let params = {
pageSize: that.pageSize,
pageIndex: that.pageIndex,
isCreationTimeSorting: that.isIssueTimeChange,
isToday: that.isToday,
enumUnplannedIssueType:2
};
getUnProducePickList(params)
.then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.items
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
//
this.loadingType = "nomore";
return;
}
that.dataList = type === "refresh" ? list : this.dataList.concat(list);
that.pageIndex++;
})
.catch(err => {
this.showMessage(err.message);
uni.hideLoading();
});
},
getScanResult(type, result) {
let code = result.data.code;
if (code == '') {
this.showMessage('扫描的内容不能为空')
return;
}
},
openDetail(item) {
uni.navigateTo({
url: './unProducePickWipDetail?id=' + item.id
});
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
onPull() {
this.getList('refresh');
},
onReachBottom() {
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList('more');
},
showItemList(itemList) {
this.$refs.scanList.openPopup(itemList);
},
selectedItem(item) {
this.openDetail(item);
}
}
};
</script>
<style scoped lang="scss">
</style>

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

@ -0,0 +1,429 @@
<!-- 发料任务详情 -->
<template>
<page-meta root-font-size="16px"></page-meta>
<view class="">
<view class="top_card">
<com-job-scan-detail :jobContent="datacontent" :allCount="allCount" :scanCount="scanCount">
</com-job-scan-detail>
</view>
<scroll-view scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower"
@scroll="scroll" class="scroll-detail">
<view class="detail-list margin_top" v-for="(item, index) in details" :key="item.id">
<view class="detail-content">
<view class="choose_main">
<view class="ljh_box">
<view class="tit_ljh">{{ item.itemCode }}</view>
<view class="ljh_left desc_ljh">
<view class="font_xs text_lightblue">{{ item.itemName }}</view>
<view class="font_xs text_lightblue">{{ item.itemDesc1 }}</view>
</view>
</view>
<view class="list_form">
<view class="uni-container">
<uni-table style="overflow-x: hidden;">
<uni-tr>
<!-- <uni-th width="90"></uni-th>
<uni-th width="100" align="center">推荐</uni-th>
<uni-th width="100" align="center">实际</uni-th> -->
<uni-th width="50"></uni-th>
<uni-th width="100" align="center">推荐</uni-th>
<uni-th width="140" align="center">实际</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="50">库位</uni-th>
<uni-th width="100" align="center">
<view class="text_black">{{ item.recommendFromLocationCode }}</view>
</uni-th>
<uni-th width="140">
<view class="" v-if="item.scaned"
style="display: flex; width: 100%; align-items: center; justify-content: center;">
<view class="text_black">
{{ item.handledFromLocationCode }}
</view>
<view class="" style="margin-left: 20rpx;">
<button size="mini" type="primary"
@click="showLocation(item)">扫描库位</button>
</view>
</view>
</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="50">数量</text></uni-th>
<uni-th width="100" align="center">
<text class="text_black">{{item.recommendQty}}</text>
<text class="text_black" v-if="item.uom!=''">({{item.uom}})</text>
</uni-th>
<uni-th width="140" align="center">
<view v-if="item.scaned"
style="display: flex;flex-direction: row;justify-content:center;align-items: center;">
<com-number-box :ref="'comNumberBox_'+index" v-model="item.handledQty"
:max="99999" :min="0" style='width: 100px;'
@change="qtyChanged($event,item,index)">
</com-number-box>
<text class="text_black" v-if="item.uom!=''">({{item.uom}})</text>
</view>
</uni-th>
</uni-tr>
</uni-table>
</view>
</view>
</view>
<view v-if="item.scaned" class="choose_marked_count"
style="background-color: #5FCB94; opacity: 0.65">
<view class="" style="background-color: #5FCB94; width: 200rpx;height: 300rpx;">
;
</view>
<!-- <image src="@/static/image_marked.svg"></image> -->
</view>
</view>
</view>
</scroll-view>
<view class="uni-flex uni-row new_btn_bot">
<button class="new_clear_btn btn_double" @click="clear()">清空</button>
<button class="new_save_btn btn_double" @click="submit()">提交</button>
</view>
<com-balance ref='issueitems' @selectedItem='selectedBalanceItem'></com-balance>
<win-scan-button @goScan='openScanPopup' title="单件码"></win-scan-button>
<winScanByProductCode ref="scanPackPopup" title="单件码" @getScanResult='getScanResult'></winScanByProductCode>
<winScanLocationCode ref="location" title="库位" @getLocation="getToLocation"></winScanLocationCode>
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance>
<com-message ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'
@afterCloseScanMessage='closeScanMessage'></com-message>
</view>
</template>
<script>
import {
getUnProducePickDetail,
takeIssueJob,
cancelTakeIssueJob,
finshUnProducePickJob,
} from '@/api/index.js';
import {
getJobStatuStyle,
getJobStatuDesc,
showConfirmMsg,
goHome,
compareDesc,
compareStr,
getCurrDateTime,
navigateBack
} from '@/common/basic.js';
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanButton from '@/mycomponents/wincom/winScanButton.vue'
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue'
import comBalance from '@/mycomponents/common/comBalance.vue'
import comJobScanDetail from '@/mycomponents/comjob/comJobScanDetail.vue'
import winScanByPack from '@/mycomponents/wincom/winScanByPack.vue'
import comNumberBox from '@/mycomponents/common/comNumberBox.vue';
import winScanByProductCode from '@/mycomponents/wincom/winScanByProductCode.vue'
import winScanLocationCode from '@/mycomponents/wincom/winScanLocationCode.vue';
export default {
components: {
comMessage,
winScanButton,
winMulitScan,
comBalance,
comJobScanDetail,
winScanByPack,
comNumberBox,
winScanByProductCode,
winScanLocationCode
},
data() {
return {
id: "",
datacontent: {},
details: {},
toLocation: '',
ispending: false,
balancesItem: null,
currentItem: null,
allCount: 0,
scanCount: 0,
isPack: true,
titleArray: ['箱标签'],
}
},
filters: {
statusStyle: function(val) {
return getJobStatuStyle(val);
},
statusColor: function(val) {
return getJobStatuDesc(val);
}
},
props: {
itemCode: "",
},
onLoad(param) {
this.id = param.id;
// if (param.jobStatus == 1) {
// this.receive((callback => {
// this.getDetail();
// }));
// } else {
// this.getDetail();
// }
this.getDetail();
},
onReady() {},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index === 1) {
window.location.reload();
}
},
//
onBackPress(e) {
//
// cancelTakeIssueJob(this.id)
// .then(res => {})
// .catch(err => {
// this.showMessage(err.message);
// });
},
mounted() {
uni.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: "#5A7CF3 !important"
})
},
methods: {
showLocation(item) {
this.currentItem = item;
this.$refs.location.openScanPopup()
},
getToLocation(locationInfo) {
this.currentItem.handledFromLocationCode = locationInfo.code;
this.currentItem.handledFromLocationArea = locationInfo.areaCode
this.currentItem.handledFromLocationGroup = locationInfo.locationGroupCode
this.currentItem.handledFromLocationErpCode = locationInfo.erpLocationCode
this.currentItem.handledFromWarehouseCode = locationInfo.warehouseCode
},
openScanPopup() {
// if (this.allCount === this.scanCount) {
// this.showMessage("");
// return;
// }
this.$refs.scanPackPopup.openScanPopup();
},
//
getDetail() {
let that = this;
if (that.id == undefined) {
return;
}
uni.showLoading({
title: '加载中...',
mask: true
})
let params = {
id: that.id,
};
getUnProducePickDetail(params)
.then(item => {
uni.hideLoading();
console.log('item', item);
that.datacontent = item;
that.details = item.details;
if (that.details != null) {
that.details.forEach(
r => {
r.scaned = false;
r.scanDate = new Date()
}
);
that.ispending = item.jobStatus === 2;
// if (that.toLocation === '') {
// that.toLocation = item.details[0].requestLocationCode;
// }
this.allCount = that.details.length;
this.scanCount = 0;
}
})
.catch(err => {
uni.hideLoading();
this.showMessage('未查找到详细信息')
});
},
getScanResult(result) {
// AH240321AM0153 AH240321AM0198 AH240321AM0199
let item = this.details.find(r => {
return r.itemCode == result.itemCode
});
if (item == undefined) {
this.showMessage('在任务详情中,单件码【' + result.scanCode + '】所对应的物料号与任务中的物料号不一致,请重新扫描');
return;
}
if(item.scaned){
this.showMessage('单件码['+result.scanCode+"]已经扫描")
}else {
item.scaned = true;
item.scanDate = new Date()
this.details.sort(compareDesc('scanDate'));
item.handledQty = item.recommendQty;
this.calcScanCount()
this.$forceUpdate()
}
},
qtyChanged(value, item, index) {
if (value == 0) {
this.showMessage('领料数量必须大于0')
item.handledQty = item.recommendQty
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty);
return;
}
if (value > item.recommendQty) {
this.showMessage("输入数量[" + value + "]大于推荐数量[" + item.recommendQty + "]")
this.$refs['comNumberBox_' + index][0].setValue(item.recommendQty);
return;
}
},
// //
receive(callback) {
let params = {
id: this.id
};
takeIssueJob(params)
.then(res => {
callback(true);
})
.catch(err => {
this.showMessage(err.message);
callback(false);
});
},
submit() {
if (this.datacontent.details.length === 0) {
this.showMessage('该任务没有选择的零件');
return;
}
let items = this.details.filter(r => {
return r.scaned && r.handledQty != 0 && r.handledFromLocationCode != null
})
if (items.length == this.details.length) {
this.finsh();
} else {
this.showMessage("还有未扫描的单件码或库位")
}
},
finsh() {
let that = this;
uni.showLoading({
title: "提交中...",
mask: true
});
that.details.forEach(res => {
res.recommendContainerCode = ""
res.handledContainerCode = ""
res.recommendPackingCode = ""
res.handledPackingCode = ""
res.recommendSupplierBatch = ""
res.recommendArriveDate = res.recommendFromArriveDate
res.recommendProduceDate = res.recommendFromProduceDate
res.recommendExpireDate = res.recommendFromExpireDate
res.recommendLot = ""
res.handledSupplierBatch = ""
res.handledArriveDate = res.handledToArriveDate
res.handledProduceDate = res.handledToProduceDate
res.handledExpireDate = res.handledToExpireDate
res.handledLot = ""
})
that.datacontent.completeUserId = localStorage.getItem('userId')
that.datacontent.completeUserName = localStorage.getItem('userName_CN')
that.datacontent.completeTime = getCurrDateTime();
that.datacontent.worker = localStorage.userName_CN == "" ? localStorage.userName : localStorage
.userName_CN;
that.datacontent.details = that.details;
let params = JSON.stringify(that.datacontent);
console.log("提交", params);
finshUnProducePickJob(that.id, params)
.then(res => {
uni.hideLoading();
if (res != null) {
that.showCommitSuccessMessage();
}
})
.catch(err => {
that.showMessage(err.message);
uni.hideLoading();
});
},
//
backJobList(delay) {
navigateBack(1)
// setTimeout(() => {
// uni.navigateTo({
// url: './unProducePick'
// })
// }, 1000)
},
clear() {
this.scanCount = 0;
this.currentItem = null;
this.getDetail();
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
closeScanMessage() {
this.$refs.scanPackPopup.getfocus();
},
calcScanCount() {
this.scanCount = this.details.filter(r => r.scaned === true).length;
this.closeScanPopup();
},
showCommitSuccessMessage() {
this.$refs.comMessage.showCommitSuccess();
},
closeCommitMessage() {
this.backJobList(0); //
uni.hideLoading();
},
closeScanPopup() {
if (this.allCount == this.scanCount) {
this.$refs.scanPackPopup.closeScanPopup();
}
},
scanPopupGetFocus() {
this.$refs.scanPackPopup.getfocus();
},
}
}
</script>
<style scoped lang="scss">
</style>

5
fe/PDA/pages/task/unProduceReturn.vue

@ -8,7 +8,7 @@
<comUnProduce :dataContent="item" fromType="return"></comUnProduce> <comUnProduce :dataContent="item" fromType="return"></comUnProduce>
</view> </view>
<uni-load-more :status="loadingType" v-if="dataList.length>0" /> <uni-load-more :status="loadingType" v-if="dataList.length>0" />
<win-scan-button @goScan='openScanPopup'></win-scan-button> <!-- <win-scan-button @goScan='openScanPopup'></win-scan-button> -->
<win-mulit-scan ref="scanPopup" :titleArray="titleArray" @getScanResult='getScanResult'> <win-mulit-scan ref="scanPopup" :titleArray="titleArray" @getScanResult='getScanResult'>
</win-mulit-scan> </win-mulit-scan>
<com-scan-issue-list ref="scanList" @selectedItem="selectedItem"></com-scan-issue-list> <com-scan-issue-list ref="scanList" @selectedItem="selectedItem"></com-scan-issue-list>
@ -110,7 +110,8 @@
pageSize: that.pageSize, pageSize: that.pageSize,
pageIndex: that.pageIndex, pageIndex: that.pageIndex,
isCreationTimeSorting: that.isIssueTimeChange, isCreationTimeSorting: that.isIssueTimeChange,
isToday: that.isToday isToday: that.isToday,
enumUnplannedReceiptType:1
}; };
getUnProduceReturnList(params) getUnProduceReturnList(params)
.then(res => { .then(res => {

1
fe/PDA/pages/task/unProduceReturnDetail.vue

@ -114,7 +114,6 @@
takeIssueJob, takeIssueJob,
cancelTakeIssueJob, cancelTakeIssueJob,
finshUnProduceReturnJob, finshUnProduceReturnJob,
getBalancesByFilter
} from '@/api/index.js'; } from '@/api/index.js';
import { import {
getJobStatuStyle, getJobStatuStyle,

178
fe/PDA/pages/task/unProduceReturnWip.vue

@ -0,0 +1,178 @@
<template>
<page-meta root-font-size="18px"></page-meta>
<view class="">
<win-empty-view v-if="dataList.length==0"></win-empty-view>
<view hover-class="uni-list-cell-hover" v-for="(item, index) in dataList" :key="item.id"
@click="openDetail(item)">
<comUnProduce :dataContent="item" fromType="return"></comUnProduce>
</view>
<uni-load-more :status="loadingType" v-if="dataList.length>0" />
<!-- <win-scan-button @goScan='openScanPopup'></win-scan-button> -->
<win-mulit-scan ref="scanPopup" :titleArray="titleArray" @getScanResult='getScanResult'>
</win-mulit-scan>
<com-scan-issue-list ref="scanList" @selectedItem="selectedItem"></com-scan-issue-list>
<!-- com-message必须放在最下层 -->
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import {
getUnProduceReturnList,
} from '@/api/index.js';
import {
goHome
} from '@/common/basic.js';
import winEmptyView from '@/mycomponents/wincom/winEmptyView.vue'
import comUnProduce from '@/mycomponents/coms/task/comUnProduce.vue';
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanButton from '@/mycomponents/wincom/winScanButton.vue'
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue'
import comScanIssueList from '@/mycomponents/scan/comScanIssueList.vue'
export default {
name: 'issue',
components: {
winEmptyView,
comUnProduce,
comMessage,
winScanButton,
winMulitScan,
comScanIssueList
},
data() {
return {
//popup
type: '',
dataList: [],
reload: false,
status: '',
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
},
pageSize: this.modelConfig,
pageIndex: 1,
isIssueTimeChange: false,
isToday: false,
titleArray: ['任务编号'],
loadingType: "nomore"
};
},
onShow() {
this.getList('refresh');
},
mounted() {
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}else if(e.index === 1){
window.location.reload();
}
},
methods: {
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
//
timeSortingChange() {
this.isIssueTimeChange = !this.isIssueTimeChange;
this.getList()
},
//
isTodayChange() {
this.isToday = !this.isToday
this.getList()
},
//
getList(type) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageIndex = 1;
this.dataList = [];
}
let params = {
pageSize: that.pageSize,
pageIndex: that.pageIndex,
isCreationTimeSorting: that.isIssueTimeChange,
isToday: that.isToday,
enumUnplannedReceiptType:2
};
getUnProduceReturnList(params)
.then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.items;
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
//
this.loadingType = "nomore";
return;
}
that.dataList = type === "refresh" ? list : this.dataList.concat(list);
that.pageIndex++;
})
.catch(err => {
this.showMessage(err.message);
uni.hideLoading();
});
},
getScanResult(type, result) {
let code = result.data.code;
if (code == '') {
this.showMessage('扫描的内容不能为空')
return;
}
},
openDetail(item) {
uni.navigateTo({
url: './unProduceReturnWipDetail?id=' + item.id
});
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
onPull() {
this.getList('refresh');
},
onReachBottom() {
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList('more');
},
showItemList(itemList) {
this.$refs.scanList.openPopup(itemList);
},
selectedItem(item) {
this.openDetail(item);
}
}
};
</script>
<style scoped lang="scss">
</style>

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

@ -0,0 +1,429 @@
<!-- 发料任务详情 -->
<template>
<page-meta root-font-size="16px"></page-meta>
<view class="">
<view class="top_card">
<com-job-scan-detail :jobContent="datacontent" :allCount="allCount" :scanCount="scanCount">
</com-job-scan-detail>
</view>
<scroll-view scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower"
@scroll="scroll" class="scroll-detail">
<view class="detail-list margin_top" v-for="(item, index) in details" :key="item.id">
<view class="detail-content">
<view class="choose_main">
<view class="ljh_box">
<view class="tit_ljh">{{ item.itemCode }}</view>
<view class="ljh_left desc_ljh">
<view class="font_xs text_lightblue">{{ item.itemName }}</view>
<view class="font_xs text_lightblue">{{ item.itemDesc1 }}</view>
</view>
</view>
<view class="list_form">
<view class="uni-container">
<uni-table style="overflow-x: hidden;">
<uni-tr>
<!-- <uni-th width="90"></uni-th>
<uni-th width="100" align="center">推荐</uni-th>
<uni-th width="100" align="center">实际</uni-th> -->
<uni-th width="50"></uni-th>
<uni-th width="100" align="center">推荐</uni-th>
<uni-th width="140" align="center">实际</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="50">库位</uni-th>
<uni-th width="100" align="center">
<view class="text_black">{{ item.recommendFromLocationCode }}</view>
</uni-th>
<uni-th width="140">
<view class="" v-if="item.scaned"
style="display: flex; width: 100%; align-items: center; justify-content: center;">
<view class="text_black">
{{ item.handledFromLocationCode }}
</view>
<view class="" style="margin-left: 20rpx;">
<button size="mini" type="primary"
@click="showLocation(item)">扫描库位</button>
</view>
</view>
</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="50">数量</text></uni-th>
<uni-th width="100" align="center">
<text class="text_black">{{item.recommendQty}}</text>
<text class="text_black" v-if="item.uom!=''">({{item.uom}})</text>
</uni-th>
<uni-th width="140" align="center">
<view v-if="item.scaned"
style="display: flex;flex-direction: row;justify-content:center;align-items: center;">
<com-number-box :ref="'comNumberBox_'+index" v-model="item.handledQty"
:max="99999" :min="0" style='width: 100px;'
@change="qtyChanged($event,item,index)">
</com-number-box>
<text class="text_black" v-if="item.uom!=''">({{item.uom}})</text>
</view>
</uni-th>
</uni-tr>
</uni-table>
</view>
</view>
</view>
<view v-if="item.scaned" class="choose_marked_count"
style="background-color: #5FCB94; opacity: 0.65">
<view class="" style="background-color: #5FCB94; width: 200rpx;height: 300rpx;">
;
</view>
<!-- <image src="@/static/image_marked.svg"></image> -->
</view>
</view>
</view>
</scroll-view>
<view class="uni-flex uni-row new_btn_bot">
<button class="new_clear_btn btn_double" @click="clear()">清空</button>
<button class="new_save_btn btn_double" @click="submit()">提交</button>
</view>
<com-balance ref='issueitems' @selectedItem='selectedBalanceItem'></com-balance>
<win-scan-button @goScan='openScanPopup' title="单件码"></win-scan-button>
<winScanByProductCode ref="scanPackPopup" title="单件码" @getScanResult='getScanResult'></winScanByProductCode>
<winScanLocationCode ref="location" title="库位" @getLocation="getToLocation"></winScanLocationCode>
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance>
<com-message ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'
@afterCloseScanMessage='closeScanMessage'></com-message>
</view>
</template>
<script>
import {
getUnProduceReturnDetail,
takeIssueJob,
cancelTakeIssueJob,
finshUnProduceReturnJob,
} from '@/api/index.js';
import {
getJobStatuStyle,
getJobStatuDesc,
showConfirmMsg,
goHome,
compareDesc,
compareStr,
getCurrDateTime,
navigateBack
} from '@/common/basic.js';
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanButton from '@/mycomponents/wincom/winScanButton.vue'
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue'
import comBalance from '@/mycomponents/common/comBalance.vue'
import comJobScanDetail from '@/mycomponents/comjob/comJobScanDetail.vue'
import winScanByPack from '@/mycomponents/wincom/winScanByPack.vue'
import comNumberBox from '@/mycomponents/common/comNumberBox.vue';
import winScanByProductCode from '@/mycomponents/wincom/winScanByProductCode.vue'
import winScanLocationCode from '@/mycomponents/wincom/winScanLocationCode.vue';
export default {
components: {
comMessage,
winScanButton,
winMulitScan,
comBalance,
comJobScanDetail,
winScanByPack,
comNumberBox,
winScanByProductCode,
winScanLocationCode
},
data() {
return {
id: "",
datacontent: {},
details: {},
toLocation: '',
ispending: false,
balancesItem: null,
currentItem: null,
allCount: 0,
scanCount: 0,
isPack: true,
titleArray: ['箱标签'],
}
},
filters: {
statusStyle: function(val) {
return getJobStatuStyle(val);
},
statusColor: function(val) {
return getJobStatuDesc(val);
}
},
props: {
itemCode: "",
},
onLoad(param) {
this.id = param.id;
// if (param.jobStatus == 1) {
// this.receive((callback => {
// this.getDetail();
// }));
// } else {
// this.getDetail();
// }
this.getDetail();
},
onReady() {},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index === 1) {
window.location.reload();
}
},
//
onBackPress(e) {
//
// cancelTakeIssueJob(this.id)
// .then(res => {})
// .catch(err => {
// this.showMessage(err.message);
// });
},
mounted() {
uni.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: "#5A7CF3 !important"
})
},
methods: {
showLocation(item) {
this.currentItem = item;
this.$refs.location.openScanPopup()
},
getToLocation(locationInfo) {
this.currentItem.handledFromLocationCode = locationInfo.code;
this.currentItem.handledFromLocationArea = locationInfo.areaCode
this.currentItem.handledFromLocationGroup = locationInfo.locationGroupCode
this.currentItem.handledFromLocationErpCode = locationInfo.erpLocationCode
this.currentItem.handledFromWarehouseCode = locationInfo.warehouseCode
},
openScanPopup() {
// if (this.allCount === this.scanCount) {
// this.showMessage("");
// return;
// }
this.$refs.scanPackPopup.openScanPopup();
},
//
getDetail() {
let that = this;
if (that.id == undefined) {
return;
}
uni.showLoading({
title: '加载中...',
mask: true
})
let params = {
id: that.id,
};
getUnProduceReturnDetail(params)
.then(item => {
uni.hideLoading();
console.log('item', item);
that.datacontent = item;
that.details = item.details;
if (that.details != null) {
that.details.forEach(
r => {
r.scaned = false;
r.scanDate = new Date()
}
);
that.ispending = item.jobStatus === 2;
// if (that.toLocation === '') {
// that.toLocation = item.details[0].requestLocationCode;
// }
this.allCount = that.details.length;
this.scanCount = 0;
}
})
.catch(err => {
uni.hideLoading();
this.showMessage('未查找到详细信息')
});
},
getScanResult(result) {
// AH240321AM0153 AH240321AM0198 AH240321AM0199
let item = this.details.find(r => {
return r.itemCode == result.itemCode
});
if (item == undefined) {
this.showMessage('在任务详情中,单件码【' + result.scanCode + '】所对应的物料号与任务中的物料号不一致,请重新扫描');
return;
}
if(item.scaned){
this.showMessage('单件码['+result.scanCode+"]已经扫描")
}else {
item.scaned = true;
item.scanDate = new Date()
this.details.sort(compareDesc('scanDate'));
item.handledQty = item.recommendQty;
this.calcScanCount()
this.$forceUpdate()
}
},
qtyChanged(value, item, index) {
if (value == 0) {
this.showMessage('领料数量必须大于0')
item.handledQty = item.recommendQty
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty);
return;
}
if (value > item.recommendQty) {
this.showMessage("输入数量[" + value + "]大于推荐数量[" + item.recommendQty + "]")
this.$refs['comNumberBox_' + index][0].setValue(item.recommendQty);
return;
}
},
// //
receive(callback) {
let params = {
id: this.id
};
takeIssueJob(params)
.then(res => {
callback(true);
})
.catch(err => {
this.showMessage(err.message);
callback(false);
});
},
submit() {
if (this.datacontent.details.length === 0) {
this.showMessage('该任务没有选择的零件');
return;
}
let items = this.details.filter(r => {
return r.scaned && r.handledQty != 0 && r.handledFromLocationCode != null
})
if (items.length == this.details.length) {
this.finsh();
} else {
this.showMessage("还有未扫描的单件码或库位")
}
},
finsh() {
let that = this;
uni.showLoading({
title: "提交中...",
mask: true
});
that.details.forEach(res => {
res.recommendContainerCode = ""
res.handledContainerCode = ""
res.recommendPackingCode = ""
res.handledPackingCode = ""
res.recommendSupplierBatch = ""
res.recommendArriveDate = res.recommendFromArriveDate
res.recommendProduceDate = res.recommendFromProduceDate
res.recommendExpireDate = res.recommendFromExpireDate
res.recommendLot = ""
res.handledSupplierBatch = ""
res.handledArriveDate = res.handledToArriveDate
res.handledProduceDate = res.handledToProduceDate
res.handledExpireDate = res.handledToExpireDate
res.handledLot = ""
})
that.datacontent.completeUserId = localStorage.getItem('userId')
that.datacontent.completeUserName = localStorage.getItem('userName_CN')
that.datacontent.completeTime = getCurrDateTime();
that.datacontent.worker = localStorage.userName_CN == "" ? localStorage.userName : localStorage
.userName_CN;
that.datacontent.details = that.details;
let params = JSON.stringify(that.datacontent);
console.log("提交", params);
finshUnProduceReturnJob(that.id, params)
.then(res => {
uni.hideLoading();
if (res != null) {
that.showCommitSuccessMessage();
}
})
.catch(err => {
that.showMessage(err.message);
uni.hideLoading();
});
},
//
backJobList(delay) {
navigateBack(1)
// setTimeout(() => {
// uni.navigateTo({
// url: './unProducePick'
// })
// }, 1000)
},
clear() {
this.scanCount = 0;
this.currentItem = null;
this.getDetail();
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
closeScanMessage() {
this.$refs.scanPackPopup.getfocus();
},
calcScanCount() {
this.scanCount = this.details.filter(r => r.scaned === true).length;
this.closeScanPopup();
},
showCommitSuccessMessage() {
this.$refs.comMessage.showCommitSuccess();
},
closeCommitMessage() {
this.backJobList(0); //
uni.hideLoading();
},
closeScanPopup() {
if (this.allCount == this.scanCount) {
this.$refs.scanPackPopup.closeScanPopup();
}
},
scanPopupGetFocus() {
this.$refs.scanPackPopup.getfocus();
},
}
}
</script>
<style scoped lang="scss">
</style>
Loading…
Cancel
Save