Browse Source

添加kitting

pda_nev
李俊城 1 year ago
parent
commit
7dfc6cad79
  1. 158
      fe/PDA/api/index.js
  2. 2
      fe/PDA/common/basic.js
  3. 2
      fe/PDA/common/new_style.css
  4. 6
      fe/PDA/common/pdabasic.css
  5. 2
      fe/PDA/common/request.js
  6. 6
      fe/PDA/mycomponents/comjob/comJobScanDetail.vue
  7. 10
      fe/PDA/mycomponents/coms/task/comCountScanDetail.vue
  8. 83
      fe/PDA/mycomponents/coms/task/comKittingIssue.vue
  9. 11
      fe/PDA/mycomponents/wincom/winScanButton.vue
  10. 58
      fe/PDA/mycomponents/wincom/winScanButtonLeft.vue
  11. 58
      fe/PDA/mycomponents/wincom/winScanButtonTop.vue
  12. 58
      fe/PDA/mycomponents/wincom/winScanButtonbottom.vue
  13. 6
      fe/PDA/mycomponents/wincom/winScanByPack.vue
  14. 8
      fe/PDA/mycomponents/wincom/winScanByPosition.vue
  15. 56
      fe/PDA/pages.js
  16. 60
      fe/PDA/pages.json
  17. 19
      fe/PDA/pages/new_file.html
  18. 286
      fe/PDA/pages/request/kittingIssueRequest.vue
  19. 238
      fe/PDA/pages/task/assemblingIssueJob.vue
  20. 713
      fe/PDA/pages/task/assemblingIssueJobDetail.vue
  21. 6
      fe/PDA/pages/task/countRawDetail.vue
  22. 246
      fe/PDA/pages/task/kittingIssueJob.vue
  23. 554
      fe/PDA/pages/task/kittingIssueJobDetail.vue
  24. 554
      fe/PDA/pages/task/kittingIssueJobDetailByQty.vue
  25. 238
      fe/PDA/pages/task/sprayIssuleJob.vue
  26. 713
      fe/PDA/pages/task/sprayIssuleJobDetail.vue

158
fe/PDA/api/index.js

@ -1571,4 +1571,160 @@ export const getItemCategoryList = () => request(
method: "get"
})
//喷涂发料任务列表
export const getSprayIssueList = (params) => request(
devUrl + "/api/pda/job/issue/list", {
method: 'get',
data: params
});
//根据Number 获取喷涂发料任务列表
export const getSprayIssueJobByNumber = (jobNumber) => request(
devUrl + "/api/pda/job/issue/by-number/" + jobNumber, {
data: {},
method: "get"
});
// 根据MaterialRequest Number获取喷涂发料任务列表
export const getSprayIssueListByRequest = (requestNumber) => request(
devUrl + "/api/pda/job/issue/list/by-request/" + requestNumber, { //
data: {},
method: "get"
});
//喷涂发料任务详情
export const getSprayIssueDetail = (params) => request(
devUrl + "/api/pda/job/issue/" + params.id, { //
data: {},
method: "get"
});
//承接喷涂发料任务
export const takeSprayIssueJob = (params) => request(
devUrl + "/api/pda/job/issue/take/" + params.id, { //
data: {},
method: "post"
});
//取消承接喷涂发料任务
export const cancelTakeSprayIssueJob = (id) => request(
devUrl + "/api/pda/job/issue/cancel-take/" + id, { //
data: {},
method: "post"
});
//完成喷涂发料任务
export const finshSprayIssueJob = (id, params) => request(
devUrl + "/api/pda/job/issue/finish/" + id, { //
data: params,
method: "post"
})
//装配发料任务列表
export const getAssemblingIssueList = (params) => request(
devUrl + "/api/pda/job/issue/list", {
method: 'get',
data: params
});
//根据Number 获取装配发料任务列表
export const getAssemblingIssueJobByNumber = (jobNumber) => request(
devUrl + "/api/pda/job/issue/by-number/" + jobNumber, {
data: {},
method: "get"
});
// 根据MaterialRequest Number获取装配发料任务列表
export const getAssemblingIssueListByRequest = (requestNumber) => request(
devUrl + "/api/pda/job/issue/list/by-request/" + requestNumber, { //
data: {},
method: "get"
});
//装配发料任务详情
export const getAssemblingIssueDetail = (params) => request(
devUrl + "/api/pda/job/issue/" + params.id, { //
data: {},
method: "get"
});
//承接装配发料任务
export const takeAssemblingIssueJob = (params) => request(
devUrl + "/api/pda/job/issue/take/" + params.id, { //
data: {},
method: "post"
});
//取消承接装配发料任务
export const cancelTakeAssemblingIssueJob = (id) => request(
devUrl + "/api/pda/job/issue/cancel-take/" + id, { //
data: {},
method: "post"
});
//完成装配发料任务
export const finshAssemblingIssueJob = (id, params) => request(
devUrl + "/api/pda/job/issue/finish/" + id, { //
data: params,
method: "post"
})
//kiting发料任务列表
export const getKittingIssueList = (pageIndex,pageSize,isFinished) => request(
devUrl + "/api/pda/job/kitting-issue/list?pageIndex="+pageIndex+"&pageSize="+pageSize+"&isFinished="+isFinished, {
method: 'post',
data: {}
});
//根据Number 获取kiting发料任务列表
export const getKitingIssueJobByNumber = (jobNumber) => request(
devUrl + "/api/pda/job/kitting-issue/by-number/" + jobNumber, {
data: {},
method: "get"
});
// 根据MaterialRequest Number获取kiting发料任务列表
export const getKitingIssueListByRequest = (requestNumber) => request(
devUrl + "/api/pda/job/issue/list/by-request/" + requestNumber, { //
data: {},
method: "get"
});
//kiting发料任务详情
export const getKittingIssueDetail = (params) => request(
devUrl + "/api/pda/job/kitting-issue/" + params.id, { //
data: {},
method: "get"
});
//承接kiting发料任务
export const takeKittingIssueJob = (params) => request(
devUrl + "/api/pda/job/kitting-issue/take/" + params.id, { //
data: {},
method: "post"
});
//取消承接kiting发料任务
export const cancelTakeKittingIssueJob = (id) => request(
devUrl + "/api/pda/job/issue/cancel-take/" + id, { //
data: {},
method: "post"
});
//完成kiting发料任务
export const finshKittingIssueJob = (masterId,detailId, params) => request(
devUrl + "/api/pda/job/kitting-issue/ExecuteDetail/" + masterId+"?detailId="+detailId, { //
data: params,
method: "post"
})
//创建 kiting叫料申请
export const kittingIssueRequest = (params) => request(
devUrl + "/api/pda/store/kitting-request", { //
data: params,
method: "post"
})
//通过物料号查询收容数
export const getCountByItemCode = (itemCode) => request(
devUrl + "/api/pda/item-container/by-item?itemCode="+itemCode, { //
data: {},
method: "get"
})

2
fe/PDA/common/basic.js

@ -7,6 +7,7 @@ export function getJobStatuStyle(val) {
else if (val == 2) return 'pending'
else if (val == 3) return 'completed'
else if (val == 4) return 'close'
else if (val == 30) return 'close'
}
//任务状态
//open pending completed close
@ -16,6 +17,7 @@ export function getJobStatuDesc(val) {
else if (val == 2) return '进行中'
else if (val == 3) return '完成'
else if (val == 4) return '关闭'
else if (val == 30) return '等待'
else return '其他'
}

2
fe/PDA/common/new_style.css

@ -135,7 +135,7 @@ uni-page-head .uni-page-head__title {
position: fixed;
z-index: 10;
right: 20rpx;
bottom: 20%;
bottom: 25%;
width: 110rpx;
height: 110rpx;
background-color: #5A7CF3;

6
fe/PDA/common/pdabasic.css

@ -272,6 +272,12 @@
color: #FFFFFF;
}
/* 等待 */
.close {
background-color: #D5D5AD;
color: #FFFFFF;
}
/* 关闭 */
.other {

2
fe/PDA/common/request.js

@ -117,7 +117,7 @@ request.globalRequest = (url, options = {}, power) => {
}
})
.catch(params => {
throw new Error(params);
throw new Error("后台提示 : "+params);
})
}

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

@ -13,7 +13,7 @@
<view class="text_lightblue">总数量</view>
<view class="text_black text_bold">{{ allCount}}</view>
</view>
<view class="cell_info">
<view class="cell_info" v-if="isShowScanHint">
<view class="text_lightblue">{{scanHint}}</view>
<view class="text_black text_bold">{{ scanCount}}</view>
</view>
@ -50,6 +50,10 @@
type: String,
default: "已扫描"
},
isShowScanHint:{
type: Boolean,
default: true
}
},
data() {
return {

10
fe/PDA/mycomponents/coms/task/comCountScanDetail.vue

@ -25,7 +25,11 @@
<view class="text_black text_bold">{{ newCount}}</view>
</view> -->
<view class="cell_info">
<view class="text_lightblue">盘点</view>
<view class="text_lightblue">盘点次数</view>
<view class="text_black text_bold">{{ countOrder}}</view>
</view>
<view class="cell_info">
<view class="text_lightblue">已经盘点</view>
<view class="text_black text_bold">{{ scanCount}}</view>
</view>
</view>
@ -61,6 +65,10 @@
type: Number,
default: 0
},
countOrder: {
type: Number,
default: 0
},
location: {
type: Object,
default: {}

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

@ -0,0 +1,83 @@
<!--发料任务卡片-->
<template>
<view class="device-detail issuelist">
<!-- <view class="card_task issuecard nopad uni-flex space-between"> -->
<view class="card_task nopad space-between">
<com-job-top-info :jobContent="dataContent"></com-job-top-info>
<image v-if="dataContent.useOnTheWayLocation" class="tag_icon" src="@/static/icons_ui/icon_kw_use.svg">
</image>
</view>
<view class="margin_xs_bottom" style="clear: both;">
<view class="label_order">
<image class="icon_normal" src="@/static/icons_ui/icon_apply_num.svg"></image>
<text>{{dataContent.kittingRequestNumber}}</text>
<!-- <text>申请单{{dataContent.materialRequestNumber}}</text> -->
</view>
<!-- <view class="label_order">
<image class="icon_normal" src="@/static/icons_ui/icon_prod_line.svg"></image>
<text>{{dataContent.prodLine}}</text>
</view> -->
</view>
<view class="uni-flex uni-row receipt_bot">
<view class="label_order">
<image class="icon_normal" src="@/static/icons_ui/icon_date.svg">
</image>
<text
class="text_darkblue">{{dataContent.creationTime===null?'无':dataContent.creationTime| formatDate}}</text>
</view>
</view>
</view>
</template>
<script>
import {
getJobStatuStyle,
getJobStatuDesc,
getInventoryTypeStyle,
getInventoryStatusDesc,
dateFormat
} from '@/common/basic.js';
import comItemTop from '@/mycomponents/comItem/comItemTop.vue'
import comItemBottom from '@/mycomponents/comItem/comItemBottom.vue'
import comJobTopInfo from '@/mycomponents/comjob/comJobTopInfo.vue'
export default {
name: "comissue",
components: {
comItemTop,
comItemBottom,
comJobTopInfo
},
data() {
return {};
},
computed: {},
//
props: {
dataContent: {
type: Object,
value: null
}
},
filters: {
jobStatusStyle: function(val) {
return getJobStatuStyle(val);
},
jobStatusColor: function(val) {
return getJobStatuDesc(val);
},
statusStyle: function(val) {
return getInventoryTypeStyle(val);
},
statusColor: function(val) {
return getInventoryStatusDesc(val);
},
formatDate: function(val) {
return dateFormat(val)
}
},
}
</script>
<style scoped lang="scss">
</style>

11
fe/PDA/mycomponents/wincom/winScanButton.vue

@ -1,12 +1,18 @@
<template>
<view class="scan_float" @click="goScan('bottom')">
<image src="@/static/icons_ui/icon_scan_white.svg"></image>
<view>扫描</view>
<view>{{title}}</view>
</view>
</template>
<script>
export default {
props: {
title: {
type: String,
default: "扫描"
}
},
data() {
return {
}
@ -23,4 +29,7 @@
</script>
<style>
.scan_float{
opacity: 0.4;
}
</style>

58
fe/PDA/mycomponents/wincom/winScanButtonLeft.vue

@ -0,0 +1,58 @@
<template>
<view class="scan_float_top" @click="goScan('bottom')">
<image src="@/static/icons_ui/icon_scan_white.svg"></image>
<view >{{title}}</view>
</view>
</template>
<script>
export default {
props: {
title: {
type: String,
value: "扫描"
}
},
data() {
return {
}
},
created() {
},
methods: {
goScan(content) {
this.$emit("goScan", '');
}
}
}
</script>
<style>
.scan_float_top{
opacity: 0.4;
position: fixed;
z-index: 11;
left: 20rpx;
bottom: 25%;
width: 110rpx;
height: 110rpx;
color: #000;
background-color: #5A7CF3;
border-radius: 50%;
text-align: center;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
}
.scan_float_top image {
width: 40rpx;
height: 40rpx;
margin-top: 10rpx;
}
.scan_float_top view {
color: #fff;
font-size: .725rem;
margin-top: -8rpx;
}
</style>

58
fe/PDA/mycomponents/wincom/winScanButtonTop.vue

@ -0,0 +1,58 @@
<template>
<view class="scan_float_top" @click="goScan('bottom')">
<image src="@/static/icons_ui/icon_scan_white.svg"></image>
<view >{{title}}</view>
</view>
</template>
<script>
export default {
props: {
title: {
type: String,
value: "扫描"
}
},
data() {
return {
}
},
created() {
},
methods: {
goScan(content) {
this.$emit("goScan", '');
}
}
}
</script>
<style>
.scan_float_top{
opacity: 0.4;
position: fixed;
z-index: 11;
left: 20rpx;
bottom: 35%;
width: 110rpx;
height: 110rpx;
color: #000;
background-color: #5A7CF3;
border-radius: 50%;
text-align: center;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
}
.scan_float_top image {
width: 40rpx;
height: 40rpx;
margin-top: 10rpx;
}
.scan_float_top view {
color: #fff;
font-size: .725rem;
margin-top: -8rpx;
}
</style>

58
fe/PDA/mycomponents/wincom/winScanButtonbottom.vue

@ -0,0 +1,58 @@
<template>
<view class="scan_float_top" @click="goScan('bottom')">
<image src="@/static/icons_ui/icon_scan_white.svg"></image>
<view >{{title}}</view>
</view>
</template>
<script>
export default {
props: {
title: {
type: String,
value: "扫描"
}
},
data() {
return {
}
},
created() {
},
methods: {
goScan(content) {
this.$emit("goScan", '');
}
}
}
</script>
<style>
.scan_float_top{
opacity: 0.4;
position: fixed;
z-index: 11;
right: 20rpx;
bottom: 15%;
width: 110rpx;
height: 110rpx;
color: #000;
background-color: #5A7CF3;
border-radius: 50%;
text-align: center;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
}
.scan_float_top image {
width: 40rpx;
height: 40rpx;
margin-top: 10rpx;
}
.scan_float_top view {
color: #fff;
font-size: .725rem;
margin-top: -8rpx;
}
</style>

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

@ -3,7 +3,7 @@
<uni-popup ref="popup" @change="change" @maskClick="closeScanPopup()">
<view class="popup_box">
<view class="pop_title">
扫描箱标签
扫描{{title}}
<text class="fr" @click="closeScanPopup()">关闭</text>
</view>
<view class="pop_tab">
@ -11,7 +11,7 @@
<view class="tab_tit tab_tit_active">箱标签</view>
</view> -->
<view class="tab_info">
<win-com-scan ref="comscan" @getScanResult="getScanResult" placeholder="箱标签"
<win-com-scan ref="comscan" @getScanResult="getScanResult" :placeholder="title"
:clearResult="true"></win-com-scan>
<view class="uni-flex">
<button class="clean_scan_btn" @click="cancelClick()">清空</button>
@ -41,7 +41,7 @@
props: {
title: {
type: String,
default: ''
default: '箱标签'
},
},
data() {

8
fe/PDA/mycomponents/wincom/winScanByPosition.vue

@ -70,10 +70,10 @@
getScanResult(result) {
console.log("扫描",result.data.code)
if (result != null) {
if(result.data.code[0].toUpperCase()!="W"){
this.showMessage("标签格式不正确")
return;
}
// if(result.data.code[0].toUpperCase()!="W"){
// this.showMessage("")
// return;
// }
uni.showLoading({
title: '扫描中...',
mask: true

56
fe/PDA/pages.js

@ -737,6 +737,62 @@ module.exports = () => ({
"navigationBarTitleText": "注塑发料任务详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/task/sprayIssuleJob",
"style": {
"navigationBarTitleText": "喷涂发料",
"enablePullDownRefresh": false
}
},
{
"path": "pages/task/sprayIssuleJobDetail",
"style": {
"navigationBarTitleText": "喷涂发料详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/task/assemblingIssueJob",
"style": {
"navigationBarTitleText": "装配发料",
"enablePullDownRefresh": false
}
},
{
"path": "pages/task/assemblingIssueJobDetail",
"style": {
"navigationBarTitleText": "装配发料详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/task/kittingIssueJob",
"style": {
"navigationBarTitleText": "kiting发料",
"enablePullDownRefresh": false
}
},
{
"path": "pages/task/kittingIssueJobDetail",
"style": {
"navigationBarTitleText": "kiting发料详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/task/kittingIssueJobDetailByQty",
"style": {
"navigationBarTitleText": "kiting发料详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/request/kittingIssueRequest",
"style": {
"navigationBarTitleText": "kiting叫料申请",
"enablePullDownRefresh": false
}
}

60
fe/PDA/pages.json

@ -714,11 +714,65 @@
"navigationBarTitleText": "注塑发料任务详情",
"enablePullDownRefresh": false
}
}
},
{
"path": "pages/task/sprayIssuleJob",
"style": {
"navigationBarTitleText": "喷涂发料",
"enablePullDownRefresh": false
}
},
{
"path": "pages/task/sprayIssuleJobDetail",
"style": {
"navigationBarTitleText": "喷涂发料详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/task/assemblingIssueJob",
"style": {
"navigationBarTitleText": "装配发料",
"enablePullDownRefresh": false
}
},
{
"path": "pages/task/assemblingIssueJobDetail",
"style": {
"navigationBarTitleText": "装配发料详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/task/kittingIssueJob",
"style": {
"navigationBarTitleText": "kiting发料",
"enablePullDownRefresh": false
}
},
{
"path": "pages/task/kittingIssueJobDetail",
"style": {
"navigationBarTitleText": "kiting发料详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/task/kittingIssueJobDetailByQty",
"style": {
"navigationBarTitleText": "kiting发料详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/request/kittingIssueRequest",
"style": {
"navigationBarTitleText": "kiting叫料申请",
"enablePullDownRefresh": false
}
}
],

19
fe/PDA/pages/new_file.html

@ -0,0 +1,19 @@
<!doctype html>
<html id="myDiv">
<head>
<meta charset="UTF-8">
<title>段落文本</title>
</head>
<body>
<h2 align="center">这是一个h2标签层级的居中标题</h2>
<p align="left">这是一个使用了P段落标签的文章的开头</p>
<p align="center"> 类型:实例</p>
<p>这是文章的正文,通过使用两个段落标签p可以实现两个
段落文本的分层</p>
</body>
<script>
var htmlString = document.getElementById("myDiv").outerHTML;
console.log("打印:"+htmlString);
</script>
</html>

286
fe/PDA/pages/request/kittingIssueRequest.vue

@ -0,0 +1,286 @@
<template>
<page-meta root-font-size="18px"></page-meta>
<view class="">
<win-blank-view @goScan='openScanPopup' v-if="itemList.length==0"></win-blank-view>
<view class="top_wrap" v-if="itemList.length>0">
<view class="top_card">
<view class="device-detail">
<view class="list-style nopad">
<view class="ljh_box nopad">
<view class="tit_ljh uni-flex">
<text class="font_xl text_black text_bold">位置码 : {{dataContent.code}}</text>
</view>
</view>
</view>
</view>
</view>
</view>
<scroll-view scroll-y="true" @scroll="scroll" class="scroll-detail">
<view class="detail-list margin_top" v-for="(item, index) in itemList" :key="item.id">
<view class="detail-content">
<view class="choose_main">
<view class="ljh_box">
<view class="tit_ljh">{{ item.partCode }}</view>
<view class="ljh_left desc_ljh">
<view class="font_xs text_lightblue">{{ item.partName }}</view>
<view class="font_xs text_lightblue">{{ item.partDesc }}</view>
</view>
</view>
<view class="list_form">
<view class="uni-container">
<uni-table style="overflow-x: hidden;">
<uni-tr>
<uni-th width="50">库位</uni-th>
<uni-th width="240" align="center">
<view class="text_packingCode">
{{ item.locationCode }}({{item.locationName}})
</view>
</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="50">数量</text></uni-th>
<uni-th width="240" align="center">
<view
style="display: flex;flex-direction: row;justify-content:center;align-items: center;">
<com-number-box :ref="'comNumberBox_'+index" v-model="item.qty"
:max="999999" :min="0" style='width: 100px;'
@change="qtyChanged($event,item,index)">
</com-number-box>
</view>
</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="50">单位</uni-th>
<uni-th width="240" align="center">
<view class="text_packingCode">
{{ item.basicUom }}
</view>
</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="50">标包数</uni-th>
<uni-th width="240" align="center">
<view class="text_black">{{item.stdPackQty }}</view>
</uni-th>
</uni-tr>
</uni-table>
</view>
</view>
</view>
<view class="choose_marked" v-if="item.scaned">
<image src="@/static/image_marked.svg"></image>
</view>
</view>
</view>
</scroll-view>
<div class="new_bot_box" v-show="itemList.length>0">
<view class="new_btn_bot bot_pos uni-flex">
<button class="new_clear_btn btn_double" @click="clear()">清空</button>
<button class="new_save_btn btn_double" @click="submit()">提交</button>
</view>
</div>
<!-- <win-scan-button @goScan='openScanPopup' v-if="itemList.length>0"></win-scan-button> -->
<winScanByPosition ref="scanPopup" @getScanResult='getScanResult'></winScanByPosition>
<com-message ref="comMessage" @afterCloseScanMessage='closeScanMessage' @afterRescanMessage='afterRescan'
@afterCloseCommitMessage='closeCommitMessage'>
</com-message>
</view>
</template>
<script>
import {
kittingIssueRequest
} from '@/api/index.js';
import {
showConfirmMsg,
goHome,
getRemoveOption,
getISODateTime
} from '@/common/basic.js';
import winBlankView from '@/mycomponents/wincom/winBlankView.vue'
import winScanButton from '@/mycomponents/wincom/winScanButton.vue'
import winScanByPosition from '@/mycomponents/wincom/winScanByPosition.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import comNumberBox from '@/mycomponents/common/comNumberBox.vue';
export default {
name: 'purchasePutaway',
components: {
winBlankView,
comMessage,
winScanButton,
winScanByPosition,
comNumberBox
},
data() {
return {
itemList: [],
dataContent: {}
};
},
props: {
// locationTypes: {
// type: [Array, String, Number],
// value: ''
// },
},
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index === 1) {
window.location.reload();
}
},
mounted: function() {
this.options = getRemoveOption();
this.openScanPopup();
},
methods: {
openScanPopup() {
this.$refs.scanPopup.openScanPopup()
},
getScanResult(result) {
this.dataContent = result;
result.qty =result.stdPackQty;
this.itemList.push(result)
this.$forceUpdate()
},
clear() {
this.itemList = [];
this.dataContent = {}
},
submit() {
let that = this;
if (that.itemList.length === 0) {
that.showMessage('请扫描位置码');
return;
}
uni.showLoading({
title: "提交中....",
mask: true
});
var params = this.setParams();
console.log(JSON.stringify(params))
kittingIssueRequest(params).then(res => {
uni.hideLoading();
this.showMessage("提交成功")
this.clear();
}).catch(error => {
uni.hideLoading();
this.showMessage(error.message);
})
},
setParams() {
var param = {
worker: localStorage.userName_CN == "" ? localStorage.userName : localStorage.userName_CN,
remark: "",
extraProperties: {},
activeDate: getISODateTime(),
autoSubmit: true,
autoAgree: false,
autoHandle: false,
autoCompleteJob: false,
directCreateNote: true,
issueRequestType: 4,
useOnTheWayLocation: false,
details: []
}
this.itemList.forEach(res => {
var data = {
remark: "",
qty:res.qty,
itemCode: res.partCode,
itemName: res.partName,
itemDesc1: res.itemDesc2,
uom: res.basicUom,
stdPackQty: res.stdPackQty,
toLocationCode: res.locationCode,
prodLine: null,
requestStatus: 1,
issuedQty: res.qty,
receivedQty: 0,
status: 1,
positionCode: this.dataContent.code,
recommendType: 0,
boxQty: res.qty
}
param.details.push(data)
})
return param;
},
qtyChanged(value, item, index) {
if (value <= 0) {
this.showMessage('发料数量不能小于或等于0')
item.handledQty = item.defaultHandleQty
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty);
return;
}
// else if (value > item.defaultHandleQty) {
// item.handledQty = item.defaultHandleQty
// this.showMessage(':' + item.handledQty)
// this.$refs['comNumberBox_' + index][0].setValue(item.handledQty);
// }
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
showConfirmMessage(message) {
this.$refs.comMessage.showConfirmMessage(message);
},
showCommitSuccess() {
this.$refs.comMessage.showCommitSuccess();
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
showRescanMessage(message) {
this.$refs.comMessage.showRescanMessage(message);
},
closeScanMessage() {
this.scanPopupGetFocus();
},
closeCommitMessage() {
// this.openScanPopup();
},
scanPopupGetFocus() {
this.$refs.scanPopup.getfocus();
},
scanPopupLoseFocus(message) {
this.$refs.scanPopup.losefocus();
},
}
};
</script>
<style scoped lang="scss">
</style>

238
fe/PDA/pages/task/assemblingIssueJob.vue

@ -0,0 +1,238 @@
<template>
<page-meta root-font-size="18px"></page-meta>
<view class="">
<!-- <view class="uni-flex uni-row require_wrap">
<button @click="isTodayChange" :class="[isToday==true?'require_cell require_active':'require_cell']">
<text></text>
只看当天发料
</button>
<button @click="timeSortingChange"
:class="[isIssueTimeChange==true?'require_cell require_active':'require_cell']">
<text></text>
按发料时间排序
</button>
</view> -->
<win-empty-view v-if="issueList.length==0"></win-empty-view>
<view hover-class="uni-list-cell-hover" v-for="(item, index) in issueList" :key="item.id"
@click="openDetail(item)">
<com-issue :dataContent="item"></com-issue>
</view>
<uni-load-more :status="loadingType" v-if="issueList.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 {
getAssemblingIssueList,
getAssemblingIssueJobByNumber,
getAssemblingIssueListByRequest
} from '@/api/index.js';
import {
goHome
} from '@/common/basic.js';
import winEmptyView from '@/mycomponents/wincom/winEmptyView.vue'
import issueDetail from './issue_detail.vue';
import comIssue from '@/mycomponents/coms/task/comIssue.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,
comIssue,
issueDetail,
comMessage,
winScanButton,
winMulitScan,
comScanIssueList
},
data() {
return {
//popup
type: '',
issueList: [],
reload: false,
status: '',
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
},
pageSize: this.modelConfig,
pageIndex: 1,
isIssueTimeChange: false,
isToday: false,
titleArray: ['任务编号'],
loadingType: "nomore"
};
},
props: {
datacontent: {
type: Object,
value: null
},
isByFIFO: {
type: Boolean,
value: false
}
},
mounted() {
this.getList('refresh');
},
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.issueList = [];
}
let params = {
pageSize: that.pageSize,
pageIndex: that.pageIndex,
isCreationTimeSorting: that.isIssueTimeChange,
isToday: that.isToday
};
getAssemblingIssueList(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.issueList = type === "refresh" ? list : this.issueList.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;
}
if (type == '申请单号') {
this.scanByRequesNumber(code, type);
} else if (type == '任务编号') {
this.scanByNumber(code, type);
}
},
//
scanByRequesNumber(code, type) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getAssemblingIssueListByRequest(code).then(res => {
uni.hideLoading();
let items = res.items;
if (res.totalCount > 0) {
if (res.totalCount == 1) {
that.openDetail(items[0]);
} else {
that.showItemList(items);
}
} else {
that.showMessage('未查找到' + type + '为【' + code + '】的发料任务');
}
}).catch(err => {
that.showMessage(err.message);
uni.hideLoading();
});
},
//
scanByNumber(code, type) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getAssemblingIssueJobByNumber(code).then(res => {
uni.hideLoading();
if (res != null) {
that.openDetail(res);
} else {
that.showMessage('未查找到' + type + '为【' + code + '】的发料任务');
}
}).catch(err => {
that.showMessage(err.message);
uni.hideLoading();
});
},
openDetail(item) {
uni.navigateTo({
url: './assemblingIssueJobDetail?id=' + item.id + '&jobStatus=' + item.jobStatus
});
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
onPull() {
this.getList('refresh');
},
onReach() {
//
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>

713
fe/PDA/pages/task/assemblingIssueJobDetail.vue

@ -0,0 +1,713 @@
<!-- 发料任务详情 -->
<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-top="scrollTop" 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="120" align="center">推荐</uni-th>
<uni-th width="120" align="center">实际</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="50">数量</text></uni-th>
<uni-th width="120" align="center">
<text class="text_black">{{item.recommendQty}}({{item.uom}})</text>
</uni-th>
<uni-th width="120" 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">({{item.uom}})</text>
</view>
</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="50">箱码</uni-th>
<uni-th width="120" align="center">
<view class="text_packingCode">
{{ item.recommendPackingCode }}
</view>
</uni-th>
<uni-th width="120" align="center">
<view v-if="item.scaned" class="text_packingCode">
{{ item.handledPackingCode }}
</view>
</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="50">批次</uni-th>
<uni-th width="120" align="center">
<view class="text_black">{{item.recommendLot }}</view>
</uni-th>
<uni-th width="120" align="center">
<view v-if="item.scaned" class="text_black">{{item.handledLot }}</view>
</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="60">库位</uni-th>
<uni-th width="100" align="center">
<view class="text_black">{{ item.recommendFromLocationCode }}</view>
</uni-th>
<uni-th width="100" align="center">
<view class="text_black" v-if="item.scaned">
{{ item.handledFromLocationCode }}
</view>
</uni-th>
</uni-tr>
</uni-table>
</view>
</view>
</view>
<view class="choose_marked" v-if="item.scaned">
<image src="@/static/image_marked.svg"></image>
</view>
<view class="fr"
>
</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'></win-scan-button>
<win-scan-by-pack ref="scanPopup" @getScanResult='getScanResult'></win-scan-by-pack>
<com-message ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'
@afterCloseScanMessage='closeScanMessage'></com-message>
</view>
</template>
<script>
import {
getAssemblingIssueDetail,
takeAssemblingIssueJob,
cancelTakeAssemblingIssueJob,
finshAssemblingIssueJob,
issueBalances
} 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 comUnPacking from '@/mycomponents/coms/comUnPacking.vue'
export default {
components: {
comMessage,
winScanButton,
winMulitScan,
comBalance,
comJobScanDetail,
winScanByPack,
comNumberBox,
comUnPacking
},
data() {
return {
id: "",
datacontent: {},
details: {},
toLocation: '',
scrollTop: 0,
old: {
scrollTop: 0
},
ispending: false,
balancesItem: null,
currentItem: null,
currentScanLebel: null,
allCount: 0,
scanCount: 0,
isPack: true,
titleArray: ['箱标签'],
jobStatus:""
}
},
props: {
itemCode: "",
},
onLoad(param) {
this.id = param.id;
if (param.jobStatus == 1) {
this.receive((callback => {
this.getDetail();
}));
} else {
this.getDetail();
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}else if(e.index === 1){
window.location.reload();
}
},
//
onBackPress(e) {
//
if (e.from == 'backbutton') {
if (this.jobStatus == 2) {
//
cancelTakeAssemblingIssueJob(this.id).then(res => {
uni.navigateBack();
}).catch(error => {
uni.navigateBack();
})
} else {
uni.navigateBack();
}
return true;
}
},
mounted() {
uni.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: "#5A7CF3 !important"
})
},
methods: {
openScanPopup() {
// if (this.allCount === this.scanCount) {
// this.showMessage("");
// return;
// }
this.$refs.scanPopup.openScanPopup();
},
//
getDetail() {
let that = this;
if (that.id == undefined) {
return;
}
uni.showLoading({
title: '加载中...',
mask: true
})
let params = {
id: that.id,
};
getAssemblingIssueDetail(params)
.then(item => {
console.log('item', item);
that.datacontent = item;
that.jobStatus =item.jobStatus;
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;
}
uni.hideLoading();
})
.catch(err => {
this.showMessage('未查找到详细信息')
uni.hideLoading();
});
},
getScanResult(result) {
//
let item = this.details.find(r => r.recommendPackingCode === result.data.packingCode && r
.scanPackingCode != result.data.packingCode);
if (item != undefined && item.scaned) {
showConfirmMsg('扫描的箱码【' + result.data.packingCode + '】匹配到任务中的【' + item.scanPackingCode +
'】箱,是否要重新匹配任务中的【' + item.scanPackingCode + '】箱?',
confirm => {
if (confirm) {
this.handledPackCode(result, true);
} else {
return;
}
})
} else {
if (this.allCount === this.scanCount) {
this.showMessage("零件已经全部扫描完成");
return;
}
this.handledPackCode(result, false);
}
this.scrollToTop();
},
//
//scaned
handledPackCode(result, scaned) {
//
let that = this;
that.currentScanLebel = result;
let scanItem = this.details.find(r => r.scanItemCode === that.currentScanLebel.data.itemCode &&
r.scanPackingCode === that.currentScanLebel.data.packingCode &&
r.scanLot === that.currentScanLebel.data.lot &&
r.scaned == true)
if (scanItem != undefined) {
this.showScanMessage('箱码【' + that.currentScanLebel.data.packingCode + '】已经扫描,请扫描下一箱零件');
} else {
this.dyIssue(result, scaned);
}
},
dyIssue(result, scaned) {
let that = this;
var itemCode = that.details.find(r => {
return r.itemCode === result.data.itemCode&&
r.scaned === scaned
})
if (itemCode == undefined) {
that.showScanMessage('所扫描的箱码【' + result.data.code + '】对应的物料【' + result.data.itemCode + '】不在任务中');
}else {
//
var itemCode1 = that.details.find(r => {
return r.itemCode === result.data.itemCode&&
r.recommendPackingCode === result.data.code
r.scaned === scaned
})
//
if(itemCode1 == undefined){
var itemCode2 = that.details.find(r => {
return r.itemCode === result.data.itemCode&&
r.recommendLot === result.data.lot
&&r.scaned === scaned
})
//
if(itemCode2==undefined){
//
console.log("零件号相同、箱码不相同、批次不相同")
setTimeout(res => {
showConfirmMsg(itemCode.recommendPackingCode+'未执行先进先出或不是最先批次,是否继续?', confirm => {
if (confirm) {
that.currentItem = itemCode;
that.afterScanPackLabel(result);
} else {
that.scanPopupGetFocus();
}
});
}, 100)
}else {
console.log("零件号相同、箱码不相同、批次相同")
//
that.currentItem = itemCode2;
that.afterScanPackLabel(result);
}
}else {
//
var itemCode3 = that.details.find(r => {
return r.itemCode === result.data.itemCode&&
r.recommendPackingCode === result.data.code&&
r.recommendLot === result.data.lot
&&r.scaned === scaned
})
if(itemCode3==undefined){
//
console.log("零件号相同、箱码相同、批次不同")
setTimeout(res => {
showConfirmMsg(itemCode1.recommendPackingCode+'未执行先进先出或不是最先批次,是否继续?', confirm => {
if (confirm) {
that.currentItem = itemCode1;
that.afterScanPackLabel(result);
} else {
that.scanPopupGetFocus();
}
});
}, 100)
}else {
console.log("零件号相同、箱码相同、批次相同")
//
that.currentItem = itemCode3;
that.afterScanPackLabel(result);
}
}
}
// that.currentItem = that.details.find(r => {
// return r.itemCode === result.data.itemCode &&
// r.recommendPackingCode === result.data.code &&
// r.recommendLot === result.data.lot &&
// r.scaned === scaned
// });
// //
// if (that.currentItem === undefined) {
// var itemCode = that.details.find(res => {
// return res.itemCode === result.data.itemCode &&
// res.scaned === scaned
// })
// //
// if (itemCode != undefined) {
// var lot = that.details.find(res => {
// return res.itemCode === result.data.itemCode &&
// res.recommendLot === result.data.lot &&
// res.scaned === scaned
// })
// if (lot != undefined) {
// //
// that.currentItem = lot;
// that.afterScanPackLabel(result);
// } else {
// //
// //
// setTimeout(res => {
// showConfirmMsg(',?', confirm => {
// if (confirm) {
// that.currentItem = itemCode;
// that.afterScanPackLabel(result);
// } else {
// that.scanPopupGetFocus();
// }
// });
// }, 100)
// }
// } else {
// //
// var lot = that.details.find(res => {
// return res.recommendLot === result.data.lot &&
// res.scaned === scaned
// })
// //
// if (lot != undefined) {
// //
// that.showScanMessage('');
// } else {
// //,
// that.showScanMessage('');
// }
// }
// } else {
// that.afterScanPackLabel(result);
// }
},
afterScanPackLabel(result) {
let that = this;
that.getBalance(result, res => {
if (res.totalCount === 1) {
that.balancesItem = res.items[0];
if (that.balancesItem != null || that.balancesItem != undefined) {
that.setBalanceInfo(this.currentItem, that.balancesItem);
that.scanPopupGetFocus();
}
} else {
this.$refs['issueitems'].openPopup(res.items);
}
});
},
//
getBalance(result, callback) {
uni.showLoading({
title: '扫描中...',
mask: true
})
let params = {
pageSize: 1000,
pageIndex: 1,
packingCode: result.data.code,
itemCode: result.data.itemCode,
lot: result.data.lot,
inventoryStatus: 2, //2
locationTypes: [2, 3],
sortBy: 'PackingCode asc'
};
issueBalances(params)
.then(res => {
if (res.totalCount === 0) {
this.showScanMessage('按零件号【' + result.data.itemCode + '】箱码【' + result.data.code + '】批次【' +
result
.data.lot + '】在【原料库、半成品库】未查询到库存信息');
} else {
callback(res);
}
uni.hideLoading();
})
.catch(err => {
this.showScanMessage(err.message);
uni.hideLoading();
});
},
setBalanceInfo(item, balanceItem) {
item.scaned = true;
item.scanDate = new Date() //
item.fromLocationCode = balanceItem.locationCode;
item.fromLocationErpCode = balanceItem.locationErpCode;
item.toLocationCode = item.locationCode;
item.toLocationErpCode = item.locationErpCode;
//
item.handledContainerCode = balanceItem.containerCode;
item.handledPackingCode = balanceItem.packingCode;
item.handledBatch = balanceItem.batch;
item.handledLot = balanceItem.lot;
item.handledQty = balanceItem.qty>item.recommendQty?item.recommendQty:balanceItem.qty;
item.defaultHandleQty = item.handledQty;
item.handledFromLocationCode = balanceItem.locationCode;
item.handledFromLocationArea = balanceItem.locationArea;
item.handledFromLocationGroup = balanceItem.locationErpCode;
item.handledFromLocationErpCode = balanceItem.locationGroup;
item.handledFromWarehouseCode = balanceItem.warehouseCode;
item.toLocationArea = balanceItem.locationArea;
item.toLocationGroup = balanceItem.locationGroup;
item.toLocationErpCode = balanceItem.locationErpCode;
//
item.scanItemCode = this.currentScanLebel.data.itemCode;
item.scanPackingCode = this.currentScanLebel.data.code;
item.scanLot = this.currentScanLebel.data.lot;
item.worker = localStorage.userName_CN ==""?localStorage.userName:localStorage.userName_CN;
item.uom = balanceItem.uom;
this.details.sort(compareDesc('scanDate')); //
this.calcScanCount(); //
this.$forceUpdate();
},
selectedBalanceItem(balanceItem) {
this.setBalanceInfo(this.currentItem, balanceItem);
},
// //
receive(callback) {
let params = {
id: this.id
};
takeAssemblingIssueJob(params)
.then(res => {
callback(true);
})
.catch(err => {
this.showMessage(err.message);
callback(false);
});
},
submit() {
let that = this;
if (that.datacontent.details.length === 0) {
this.showMessage('该任务没有要上架的零件');
return;
}
let checkItems = that.details.filter(r => r.scaned === true);
if (checkItems.length < that.details.length) {
showConfirmMsg('还有未扫描的零件,是否继续发料', confirm => {
if (confirm) {
that.finsh();
}
});
} else {
that.finsh();
}
},
handleLocation() {
let that = this;
if (that.details[0].requestLocationCode != that.toLocation) {
showConfirmMsg('目标库位【' + that.toLocation + '】与需求库位不一致,是否要将以上零件发到目标库位?', confirm => {
if (confirm) {
that.handledPackingCode();
} else {
that.clearScanLocation();
}
});
} else {
showConfirmMsg('是否要将以上零件发到目标库位:【' + that.toLocation + "】", confirm => {
if (confirm) {
that.handledPackingCode();
} else {
that.clearScanLocation();
}
});
}
},
//
handledPackingCode() {
let that = this;
let items = this.details.filter(r => {
return r.scaned && (r.handledPackingCode === null || r.handledPackingCode === '')
})
if (items.length > 0) {
let packingCodes = '';
items.forEach(r => {
packingCodes += r.recommendPackingCode + ','
})
showConfirmMsg('以下箱码对应的实际箱码为空,是否要继续发料?【' + packingCodes + "】", confirm => {
if (confirm) {
that.finsh();
} else {
that.clearScanLocation();
}
});
} else {
that.finsh();
}
},
finsh() {
let that = this;
uni.showLoading({
title: "提交中...",
mask: true
});
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);
finshAssemblingIssueJob(that.id, params)
.then(res => {
uni.hideLoading();
if (res != null) {
that.showCommitSuccessMessage();
}
})
.catch(err => {
that.showMessage(err.message);
uni.hideLoading();
});
},
clear() {
this.scanCount = 0;
this.currentItem = null;
this.currentScanLebel = null;
this.getDetail();
},
clearScanLocation() {
this.currentItem = null;
},
unPacking(item) {
this.$refs.comUnPacking.openPopup3(this.datacontent, item,item.handledQty,item.recommendQty,false);
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
calcScanCount() {
this.scanCount = this.details.filter(r => r.scaned === true).length;
this.closeScanPopup();
},
showCommitSuccessMessage() {
this.$refs.comMessage.showCommitSuccess();
},
closeCommitMessage() {
navigateBack(1)
uni.hideLoading();
},
closeScanPopup() {
if (this.allCount == this.scanCount) {
this.$refs.scanPopup.closeScanPopup();
}
},
closeScanMessage() {
this.scanPopupGetFocus();
},
scanPopupGetFocus() {
this.$refs.scanPopup.getfocus();
},
scrollToTop() {
let that = this;
// view
that.scrollTop = that.old.scrollTop
this.$nextTick(function() {
that.scrollTop = 0
});
},
scroll: function(e) {
// console.log(e)
this.old.scrollTop = e.detail.scrollTop;
},
qtyChanged(value, item, index) {
if (value <= 0) {
this.showMessage('发料数量不能小于或等于0')
item.handledQty = item.defaultHandleQty
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty);
} else if (value > item.defaultHandleQty) {
item.handledQty = item.defaultHandleQty
this.showMessage('发料数量不能大于叫料数量:' + item.handledQty)
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty);
}
},
}
}
</script>
<style scoped lang="scss">
</style>

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

@ -4,7 +4,7 @@
<view class="" style="display:flex;flex-direction: column;">
<view class="top_card">
<com-count-scan-detail :jobContent="datacontent" :allCount="allCount" :scanCount="scanCount"
:newCount="newCount" :location="location">
:newCount="newCount" :location="location" :countOrder="datacontent.inventoryStage">
</com-count-scan-detail>
</view>
<scroll-view scroll-y="true" style="margin-bottom: 50rpx;">
@ -360,8 +360,8 @@
that.originalDetails = res.details;
that.allCount = res.details.length
that.scanAllDetails = res.depDetails;
that.scanCount = res.depDetails.length
that.scanAllDetails = res.depDetails.filter(r=>r.inventoryStage==res.inventoryStage);
that.scanCount = that.scanAllDetails.length
that.scanAllDetails.forEach(res=>{
res.IsDelete = false;

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

@ -0,0 +1,246 @@
<template>
<page-meta root-font-size="18px"></page-meta>
<view class="">
<!-- <view class="uni-flex uni-row require_wrap">
<button @click="isTodayChange" :class="[isToday==true?'require_cell require_active':'require_cell']">
<text></text>
只看当天发料
</button>
<button @click="timeSortingChange"
:class="[isIssueTimeChange==true?'require_cell require_active':'require_cell']">
<text></text>
按发料时间排序
</button>
</view> -->
<win-empty-view v-if="issueList.length==0"></win-empty-view>
<view hover-class="uni-list-cell-hover" v-for="(item, index) in issueList" :key="item.id"
@click="openDetail(item)">
<comKittingIssue :dataContent="item"></comKittingIssue>
</view>
<uni-load-more :status="loadingType" v-if="issueList.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 {
getKittingIssueList,
getKitingIssueJobByNumber,
getKitingIssueListByRequest
} from '@/api/index.js';
import {
goHome
} from '@/common/basic.js';
import winEmptyView from '@/mycomponents/wincom/winEmptyView.vue'
import issueDetail from './issue_detail.vue';
import comKittingIssue from '@/mycomponents/coms/task/comKittingIssue.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,
comKittingIssue,
issueDetail,
comMessage,
winScanButton,
winMulitScan,
comScanIssueList
},
data() {
return {
//popup
type: '',
issueList: [],
reload: false,
status: '',
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
},
pageSize: this.modelConfig,
pageIndex: 1,
isIssueTimeChange: false,
isToday: false,
titleArray: ['任务编号'],
loadingType: "nomore"
};
},
props: {
datacontent: {
type: Object,
value: null
},
isByFIFO: {
type: Boolean,
value: false
}
},
onShow() {
this.getList('refresh');
},
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.issueList = [];
}
getKittingIssueList(that.pageIndex,that.pageSize,false)
.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.issueList = type === "refresh" ? list : this.issueList.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;
}
if (type == '申请单号') {
this.scanByRequesNumber(code, type);
} else if (type == '任务编号') {
this.scanByNumber(code, type);
}
},
//
scanByRequesNumber(code, type) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getKitingIssueListByRequest(code).then(res => {
uni.hideLoading();
let items = res.items;
if (res.totalCount > 0) {
if (res.totalCount == 1) {
that.openDetail(items[0]);
} else {
that.showItemList(items);
}
} else {
that.showMessage('未查找到' + type + '为【' + code + '】的发料任务');
}
}).catch(err => {
that.showMessage(err.message);
uni.hideLoading();
});
},
//
scanByNumber(code, type) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getKitingIssueJobByNumber(code).then(res => {
uni.hideLoading();
if (res != null) {
that.openDetail(res);
} else {
that.showMessage('未查找到' + type + '为【' + code + '】的发料任务');
}
}).catch(err => {
that.showMessage(err.message);
uni.hideLoading();
});
},
openDetail(item) {
if(item.enumIssueSendType==1){
uni.navigateTo({
url: './kittingIssueJobDetailByQty?id=' + item.id + '&jobStatus=' + item.jobStatus
});
}else {
uni.navigateTo({
url: './kittingIssueJobDetail?id=' + item.id + '&jobStatus=' + item.jobStatus
});
}
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
onPull() {
this.getList('refresh');
},
onReach() {
//
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>

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

@ -0,0 +1,554 @@
<!-- 发料任务详情 -->
<template>
<page-meta root-font-size="16px"></page-meta>
<view class="">
<view class="top_card">
<com-job-scan-detail :jobContent="datacontent" :allCount="allCount" :isShowScanHint="false">
</com-job-scan-detail>
</view>
<scroll-view scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll"
class="scroll-detail">
<view class="" v-for="(item, index) in details" :key="index">
<view class="detail-list margin_top">
<!-- 单选卡片 -->
<view class="detail-content">
<view class="choose_main">
<view class="ljh_box">
<view class="tit_ljh">{{ item.itemCode }}</view>
<view class="ljh_left">
<view class="font_xs text_lightblue">{{ item.itemName }}</view>
<view class="font_xs text_lightblue">{{ item.itemDesc1 }}</view>
</view>
</view>
<view class="list_form hold_form">
<view class="uni-container">
<uni-table style="">
<uni-tr>
<uni-th width="100" align="center">
<text
style="font-weight:800; font-size: 35rpx; color: black; ">推荐</text>
</uni-th>
<uni-th width="120" align="center">来源</uni-th>
<uni-th width="120" align="center">目标</uni-th>
</uni-tr>
<uni-tr>
<uni-td width="100" align="center">箱码</uni-td>
<uni-td width="120" align="center">
{{item.recommendFromPackingCode}}</uni-td>
<uni-td width="120" align="center"> {{item.recommendToPackingCode}}</uni-td>
</uni-tr>
<uni-tr>
<uni-td width="100" align="center">批次</uni-td>
<uni-td width="120" align="center">{{item.recommendFromLot}}</uni-td>
<uni-td width="120" align="center">{{item.recommendToLot}}</uni-td>
</uni-tr>
<uni-tr>
<uni-td width="100" align="center">库位</uni-td>
<uni-td width="120" align="center">
{{item.recommendFromLocationCode}}</uni-td>
<uni-td width="120" align="center">
{{item.recommendToLocationCode}}</uni-td>
</uni-tr>
<uni-tr>
<uni-td width="100" align="center">数量({{item.uom}})</uni-td>
<uni-td width="120" align="center">{{item.recommendFromQty}}</uni-td>
<uni-td width="120" align="center">{{item.recommendToQty}}</uni-td>
</uni-tr>
</uni-table>
</view>
</view>
<view class="list_form hold_form">
<view class="uni-container">
<uni-table style="">
<uni-tr>
<uni-th width="100" align="center">
<text style="font-weight:800; font-size: 35rpx; color: black; ">库移
</text>
</uni-th>
</uni-th>
<uni-th width="120" align="center">来源</uni-th>
<uni-th width="120" align="center">目标</uni-th>
</uni-tr>
<uni-tr>
<uni-td width="100" align="center">箱码</uni-td>
<uni-td width="120" align="center">
{{item.transferLibFromPackingCode}}</uni-td>
<uni-td width="120" align="center">
{{item.transferLibToPackingCode}}</uni-td>
</uni-tr>
<uni-tr>
<uni-td width="100" align="center">批次</uni-td>
<uni-td width="120" align="center">{{item.transferLibFromLot}}</uni-td>
<uni-td width="120" align="center">{{item.transferLibToLot}}</uni-td>
</uni-tr>
<uni-tr>
<uni-td width="100" align="center">库位</uni-td>
<uni-td width="120" align="center">
{{item.transferLibFromLocationCode}}</uni-td>
<uni-td width="120" align="center">
{{item.transferLibToLocationCode}}</uni-td>
</uni-tr>
<uni-tr>
<uni-td width="100" align="center">数量({{item.uom}})</uni-td>
<uni-td width="120" align="center">{{item.transferLibFromQty}}</uni-td>
<uni-td width="120" align="center">{{item.transferLibToQty}}</uni-td>
</uni-tr>
</uni-table>
</view>
</view>
<view class="list_form hold_form">
<view class="uni-container">
<uni-table style="">
<uni-tr>
<uni-th width="100" align="center">
<text
style="font-weight:800; font-size: 35rpx; color: black; ">实际</text></uni-th>
<uni-th width="120" align="center">来源</uni-th>
<uni-th width="120" align="center">目标</uni-th>
</uni-tr>
<uni-tr>
<uni-td width="100" align="center">箱码</uni-td>
<uni-td width="120" align="center"> {{item.handledFromPackingCode}}</uni-td>
<uni-td width="120" align="center"> {{item.handledToPackingCode}}</uni-td>
</uni-tr>
<uni-tr>
<uni-td width="100" align="center">批次</uni-td>
<uni-td width="120" align="center">{{item.handledFromLot}}</uni-td>
<uni-td width="120" align="center">{{item.handledToLot}}</uni-td>
</uni-tr>
<uni-tr>
<uni-td width="100" align="center">库位</uni-td>
<uni-td width="120" align="center">
{{item.handledFromLocationCode}}</uni-td>
<uni-td width="120" align="center"> {{item.handledToLocationCode}}</uni-td>
</uni-tr>
<uni-tr>
<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.handledToQty}}</uni-td>
</uni-tr>
</uni-table>
</view>
</view>
</view>
<view class="choose_marked" v-if="item.scaned">
<image src="@/static/image_marked.svg"></image>
</view>
</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>
<winScanButtonTop @goScan='openScanPopupFrom' title="箱码"></winScanButtonTop>
<win-scan-button @goScan='openLocationTo' title="库位"></win-scan-button>
<win-scan-by-pack ref="scanPopupFrom" @getScanResult='getScanResultFrom' title="来源箱码"></win-scan-by-pack>
<winScanLocationCode ref="locationTo" title="目标库位" @getLocation="geToLocation"></winScanLocationCode>
<com-message ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'
@afterCloseScanMessage='closeScanMessage'></com-message>
</view>
</template>
<script>
import {
getKittingIssueDetail,
takeKittingIssueJob,
cancelTakeKittingIssueJob,
finshKittingIssueJob,
balances
} 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 winScanButtonTop from '@/mycomponents/wincom/winScanButtonTop.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 winScanLocationCode from '@/mycomponents/wincom/winScanLocationCode.vue';
export default {
components: {
comMessage,
winScanButton,
winScanButtonTop,
winMulitScan,
comBalance,
comJobScanDetail,
winScanByPack,
comNumberBox,
winScanLocationCode
},
data() {
return {
id: "",
datacontent: {},
details: {},
toLocation: '',
scrollTop: 0,
old: {
scrollTop: 0
},
ispending: false,
balancesItem: null,
allCount: 0,
isPack: true,
titleArray: ['箱标签'],
jobStatus: "",
toLocationInfo: {}
}
},
props: {
itemCode: "",
},
onLoad(param) {
this.id = param.id;
if (param.jobStatus == 1) {
this.receive((callback => {
this.getDetail();
}));
} else {
this.getDetail();
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index === 1) {
window.location.reload();
}
},
//
onBackPress(e) {
//
if (e.from == 'backbutton') {
if (this.jobStatus == 2) {
//
cancelTakeKittingIssueJob(this.id).then(res => {
uni.navigateBack();
}).catch(error => {
uni.navigateBack();
})
} else {
uni.navigateBack();
}
return true;
}
},
mounted() {
uni.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: "#5A7CF3 !important"
})
},
methods: {
openScanPopupFrom() {
this.$refs.scanPopupFrom.openScanPopup();
},
openLocationTo() {
this.$refs.locationTo.openScanPopup()
},
geToLocation(locationInfo) {
var current = this.details[0]
if (locationInfo.code != current.transferLibToLocationCode) {
this.showMessage(" 扫描目标库位[" + locationInfo.code + "]与推荐库位[" + this.details[0]
.transferLibToLocationCode + "]不一致,请重新扫描")
return;
}
current.handledToLocationCode = locationInfo.code
current.handledToLocationArea = locationInfo.locationArea
current.handledToLocationGroup = locationInfo.locationGroup
current.handledToLocationErpCode = locationInfo.locationErpCode
current.handledToWarehouseCode = locationInfo.warehouseCode
current.handledToPackingCode = ""
current.handledToLot = ""
},
//
getDetail() {
let that = this;
if (that.id == undefined) {
return;
}
uni.showLoading({
title: '加载中...',
mask: true
})
let params = {
id: that.id,
};
getKittingIssueDetail(params)
.then(item => {
console.log('item', item);
that.datacontent = item;
that.jobStatus = item.jobStatus;
that.details = item.details;
if (that.details != null) {
that.details.forEach(
r => {
r.scaned = false;
r.scanDate = new Date()
r.handledFromContainerCode = r.transferLibFromContainerCode
r.handledFromPackingCode = r.transferLibFromPackingCode
r.handledFromSupplierBatch = r.transferLibFromSupplierBatch
r.handledFromArriveDate = r.transferLibFromArriveDate
r.handledFromProduceDate = r.transferLibFromProduceDate
r.handledFromExpireDate = r.transferLibFromExpireDate
r.handledFromLot = r.transferLibFromLot
r.handledFromLocationCode = r.transferLibFromLocationCode
r.handledFromLocationArea = r.transferLibFromLocationArea
r.handledFromLocationGroup = r.transferLibFromLocationGroup
r.handledFromLocationErpCode = r.transferLibFromLocationErpCode
r.handledFromWarehouseCode = r.transferLibFromWarehouseCode
r.handledFromQty = r.transferLibFromQty
r.handledToQty = r.handledFromQty
}
);
that.ispending = item.jobStatus === 2;
this.allCount = that.details.length;
}
uni.hideLoading();
})
.catch(err => {
this.showMessage('未查找到详细信息')
uni.hideLoading();
});
},
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()
}
});
},
getScanResultTo(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.handledToContainerCode = balancesItem.containerCode
item.handledToPackingCode = balancesItem.packingCode
item.handledToSupplierBatch = balancesItem.supplierBatch
item.handledToArriveDate = balancesItem.arriveDate
item.handledToProduceDate = balancesItem.produceDate
item.handledToExpireDate = balancesItem.expireDate
item.handledToLot = balancesItem.lot
item.handledToLocationCode = balancesItem.locationCode
item.handledToLocationArea = balancesItem.locationArea
item.handledToLocationGroup = balancesItem.locationGroup
item.handledToLocationErpCode = balancesItem.locationErpCode
item.handledToWarehouseCode = balancesItem.warehouseCode
item.handledToQty = balancesItem.qty
this.$forceUpdate()
}
});
},
//
getBalance(result, callback) {
uni.showLoading({
title: '扫描中...',
mask: true
})
let params = {
pageSize: 1000,
pageIndex: 1,
packingCode: result.data.code,
// itemCode: result.data.itemCode,
// lot: result.data.lot,
// inventoryStatus: 2, //2
// locationTypes: [2, 3],
// sortBy: 'PackingCode asc'
};
balances(params)
.then(res => {
if (res.totalCount === 0) {
this.showScanMessage('按箱码【' + result.data.code + '】未查询到库存信息');
} else {
callback(res);
}
uni.hideLoading();
})
.catch(err => {
this.showScanMessage(err.message);
uni.hideLoading();
});
},
// //
receive(callback) {
let params = {
id: this.id
};
takeKittingIssueJob(params)
.then(res => {
callback(true);
})
.catch(err => {
this.showMessage(err.message);
callback(false);
});
},
submit() {
let that = this;
if (that.details.length === 0) {
this.showMessage('该任务没有要上架的零件');
return;
}
if (!that.details[0].handledFromPackingCode) {
this.showMessage('请先扫描箱码');
return;
}
if (!that.details[0].handledToLocationCode) {
this.showMessage('请先扫描库位');
return;
}
that.finsh();
},
finsh() {
let that = this;
uni.showLoading({
title: "提交中...",
mask: true
});
let params = that.details[0];
finshKittingIssueJob(that.id, params.id, params)
.then(res => {
uni.hideLoading();
if (res != null) {
that.showCommitSuccessMessage();
}
})
.catch(err => {
that.showMessage(err.message);
uni.hideLoading();
});
},
clear() {
this.getDetail();
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
showCommitSuccessMessage() {
this.$refs.comMessage.showCommitSuccess();
},
closeCommitMessage() {
navigateBack(1)
uni.hideLoading();
},
closeScanPopup() {
this.$refs.scanPopupForm.closeScanPopup();
},
closeScanMessage() {
this.scanPopupGetFocus();
},
scanPopupGetFocus() {
this.$refs.scanPopupForm.getfocus();
},
scrollToTop() {
let that = this;
// view
that.scrollTop = that.old.scrollTop
this.$nextTick(function() {
that.scrollTop = 0
});
},
scroll: function(e) {
// console.log(e)
this.old.scrollTop = e.detail.scrollTop;
},
qtyChanged(value, item, index) {
if (value <= 0) {
this.showMessage('发料数量不能小于或等于0')
item.handledQty = item.defaultHandleQty
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty);
} else if (value > item.defaultHandleQty) {
item.handledQty = item.defaultHandleQty
this.showMessage('发料数量不能大于叫料数量:' + item.handledQty)
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty);
}
},
}
}
</script>
<style scoped lang="scss">
</style>

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

@ -0,0 +1,554 @@
<!-- 发料任务详情 -->
<template>
<page-meta root-font-size="16px"></page-meta>
<view class="">
<view class="top_card">
<com-job-scan-detail :jobContent="datacontent" :allCount="allCount" :isShowScanHint="false">
</com-job-scan-detail>
</view>
<scroll-view scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll"
class="scroll-detail" style="padding-bottom: 40rpx;" >
<view class="" v-for="(item, index) in details" :key="index">
<view class="detail-list margin_top">
<!-- 单选卡片 -->
<view class="detail-content">
<view class="choose_main">
<view class="ljh_box">
<view class="tit_ljh">{{ item.itemCode }}</view>
<view class="ljh_left">
<view class="font_xs text_lightblue">{{ item.itemName }}</view>
<view class="font_xs text_lightblue">{{ item.itemDesc1 }}</view>
</view>
</view>
<view class="list_form hold_form">
<view class="uni-container">
<uni-table style="">
<uni-tr>
<uni-th width="100" align="center">
<text
style="font-weight:800; font-size: 35rpx; color: black; ">推荐</text>
</uni-th>
<uni-th width="120" align="center">来源</uni-th>
<uni-th width="120" align="center">目标</uni-th>
</uni-tr>
<uni-tr>
<uni-td width="100" align="center">库位</uni-td>
<uni-td width="120" align="center">
{{item.recommendFromLocationCode}}</uni-td>
<uni-td width="120" align="center">
{{item.recommendToLocationCode}}</uni-td>
</uni-tr>
<uni-tr>
<uni-td width="100" align="center">数量({{item.uom}})</uni-td>
<uni-td width="120" align="center">{{item.recommendFromQty}}</uni-td>
<uni-td width="120" align="center">{{item.recommendToQty }}</uni-td>
</uni-tr>
</uni-table>
</view>
</view>
<view class="list_form hold_form">
<view class="uni-container">
<uni-table style="">
<uni-tr>
<uni-th width="100" align="center">
<text
style="font-weight:800; font-size: 35rpx; color: black; ">实际</text></uni-th>
<uni-th width="120" align="center">来源</uni-th>
<uni-th width="120" align="center">目标</uni-th>
</uni-tr>
<uni-tr>
<uni-td width="100" align="center">库位</uni-td>
<uni-td width="120" align="center">
{{item.handledFromLocationCode}}</uni-td>
<uni-td width="120" align="center"> {{item.handledToLocationCode}}</uni-td>
</uni-tr>
<uni-tr>
<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">
<view
style="display: flex;flex-direction: row;justify-content:center;align-items: center;">
<com-number-box ref="comNumberBox" v-model="item.handledToQty"
:max="999999" :min="0" style='width: 100px;'
@change="qtyChanged($event,item,index)">
</com-number-box>
</view>
</uni-td>
</uni-tr>
</uni-table>
</view>
</view>
</view>
</view>
</view>
</view>
</scroll-view>
<view class="" style=" display: flex; width: 100%;padding-bottom: 150rpx; flex-direction: row; justify-content: space-around;">
<view class="" style=" align-items: center;">
<view class="scan_float_top" @click="openScanPopup">
<image src="@/static/icons_ui/icon_scan_white.svg"></image>
<view >单件码</view>
</view>
</view>
<view class="" style="">
<view class="scan_float_top" @click="openLocationFrom">
<image src="@/static/icons_ui/icon_scan_white.svg"></image>
<view >来源库位</view>
</view>
</view>
<view class="" style="">
<view class="scan_float_top" @click="openLocationTo">
<image src="@/static/icons_ui/icon_scan_white.svg"></image>
<view >目标库位</view>
</view>
</view>
</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-by-pack ref="scanPopupFrom" @getScanResult='getScanResultFrom' title="来源箱码"></win-scan-by-pack>
<winScanLocationCode ref="locationFrom" title="来源库位" @getLocation="geFromLocation"></winScanLocationCode>
<winScanLocationCode ref="locationTo" title="目标库位" @getLocation="geToLocation"></winScanLocationCode>
<winScanByProductCode ref="scanPackPopup" title="单件码" @getScanResult='getScanResult'></winScanByProductCode>
<com-message ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'
@afterCloseScanMessage='closeScanMessage'></com-message>
</view>
</template>
<script>
import {
getKittingIssueDetail,
takeKittingIssueJob,
cancelTakeKittingIssueJob,
finshKittingIssueJob,
balances,
getCountByItemCode
} 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 winScanButtonLeft from '@/mycomponents/wincom/winScanButtonLeft.vue'
import winScanButtonTop from '@/mycomponents/wincom/winScanButtonTop.vue'
import winScanButtonbottom from '@/mycomponents/wincom/winScanButtonbottom.vue'
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue'
import comBalance from '@/mycomponents/common/comBalance.vue'
import comJobScanDetail from '@/mycomponents/comjob/comJobScanDetail.vue'
import winScanByPack from '@/mycomponents/wincom/winScanByPack.vue'
import comNumberBox from '@/mycomponents/common/comNumberBox.vue';
import winScanLocationCode from '@/mycomponents/wincom/winScanLocationCode.vue';
import winScanByProductCode from '@/mycomponents/wincom/winScanByProductCode.vue'
export default {
components: {
comMessage,
winScanButtonLeft,
winScanButtonTop,
winScanButtonbottom,
winMulitScan,
comBalance,
comJobScanDetail,
winScanByPack,
comNumberBox,
winScanLocationCode,
winScanByProductCode
},
data() {
return {
id: "",
datacontent: {},
details: {},
toLocation: '',
scrollTop: 0,
old: {
scrollTop: 0
},
ispending: false,
balancesItem: null,
allCount: 0,
isPack: true,
titleArray: ['箱标签'],
jobStatus: "",
toLocationInfo: {},
singCode:""
}
},
props: {
itemCode: "",
},
onLoad(param) {
this.id = param.id;
if (param.jobStatus == 1) {
this.receive((callback => {
this.getDetail();
}));
} else {
this.getDetail();
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index === 1) {
window.location.reload();
}
},
//
onBackPress(e) {
//
if (e.from == 'backbutton') {
if (this.jobStatus == 2) {
//
cancelTakeKittingIssueJob(this.id).then(res => {
uni.navigateBack();
}).catch(error => {
uni.navigateBack();
})
} else {
uni.navigateBack();
}
return true;
}
},
mounted() {
uni.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: "#5A7CF3 !important"
})
},
methods: {
openScanPopup() {
this.$refs.scanPackPopup.openScanPopup();
},
openLocationTo() {
this.$refs.locationTo.openScanPopup()
},
openLocationFrom() {
this.$refs.locationFrom.openScanPopup()
},
geFromLocation(locationInfo) {
var current = this.details[0]
if (locationInfo.code != current.recommendFromLocationCode) {
this.showMessage(" 扫描来源库位[" + locationInfo.code + "]与推荐来源库位[" + current
.recommendFromLocationCode + "]不一致,请重新扫描")
return;
}
current.handledFromLocationCode = locationInfo.code
current.handledFromLocationArea = locationInfo.locationArea
current.handledFromLocationGroup = locationInfo.locationGroup
current.handledFromLocationErpCode = locationInfo.locationErpCode
current.handledFromWarehouseCode = locationInfo.warehouseCode
current.handledFromPackingCode = ""
current.handledFromLot = ""
},
geToLocation(locationInfo) {
var current =this.details[0]
if (locationInfo.code != current.recommendToLocationCode) {
this.showMessage("扫描目标库位[" + locationInfo.code + "]与推荐目标库位[" +current
.recommendToLocationCode + "]不一致,请重新扫描")
return;
}
this.toLocationInfo = locationInfo
current.handledToLocationCode = locationInfo.code
current.handledToLocationArea = locationInfo.locationArea
current.handledToLocationGroup = locationInfo.locationGroup
current.handledToLocationErpCode = locationInfo.locationErpCode
current.handledToWarehouseCode = locationInfo.warehouseCode
current.handledToPackingCode = ""
current.handledToLot = ""
},
//
getDetail() {
let that = this;
if (that.id == undefined) {
return;
}
uni.showLoading({
title: '加载中...',
mask: true
})
let params = {
id: that.id,
};
getKittingIssueDetail(params)
.then(item => {
console.log('item', item);
that.datacontent = item;
that.jobStatus = item.jobStatus;
that.details = item.details;
if (that.details != null) {
that.details.forEach(
r => {
r.scaned = false;
r.scanDate = new Date()
}
);
that.ispending = item.jobStatus === 2;
this.allCount = that.details.length;
that.details[0].defaultHandleQty =that.details[0].handledFromQty;
}
uni.hideLoading();
})
.catch(err => {
this.showMessage('未查找到详细信息')
uni.hideLoading();
});
},
getScanResult(result) {
let item = this.details.find(r => {
return r.itemCode == result.itemCode
});
if (item == undefined) {
this.showMessage('在任务详情中,未找到物料号【' + result.itemCode + '】');
return;
}
//
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) {
uni.showLoading({
title: '扫描中...',
mask: true
})
let params = {
pageSize: 1000,
pageIndex: 1,
packingCode: result.data.code,
// itemCode: result.data.itemCode,
// lot: result.data.lot,
// inventoryStatus: 2, //2
// locationTypes: [2, 3],
// sortBy: 'PackingCode asc'
};
balances(params)
.then(res => {
if (res.totalCount === 0) {
this.showScanMessage('按箱码【' + result.data.code + '】未查询到库存信息');
} else {
callback(res);
}
uni.hideLoading();
})
.catch(err => {
this.showScanMessage(err.message);
uni.hideLoading();
});
},
// //
receive(callback) {
let params = {
id: this.id
};
takeKittingIssueJob(params)
.then(res => {
callback(true);
})
.catch(err => {
this.showMessage(err.message);
callback(false);
});
},
submit() {
let that = this;
if (that.details.length === 0) {
this.showMessage('该任务没有零件');
return;
}
if(this.singCode==""){
this.showMessage('请先扫描单件码');
return;
}
if (!that.details[0].handledFromLocationCode) {
this.showMessage('请先扫描来源库位');
return;
}
if (!that.details[0].handledToLocationCode) {
this.showMessage('请先扫描目标库位');
return;
}
if (that.details[0].handledToQty==0||that.details[0].handledToQty=="") {
this.showMessage('发料数量必须大于0');
return;
}
that.finsh();
},
finsh() {
let that = this;
uni.showLoading({
title: "提交中...",
mask: true
});
let params = that.details[0];
finshKittingIssueJob(that.id, params.id, params)
.then(res => {
uni.hideLoading();
if (res != null) {
that.showCommitSuccessMessage();
}
})
.catch(err => {
that.showMessage(err.message);
uni.hideLoading();
});
},
clear() {
this.singCode == ""
this.getDetail();
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
showCommitSuccessMessage() {
this.$refs.comMessage.showCommitSuccess();
},
closeCommitMessage() {
navigateBack(1)
uni.hideLoading();
},
closeScanPopup() {
this.$refs.scanPopupForm.closeScanPopup();
},
closeScanMessage() {
this.scanPopupGetFocus();
},
scanPopupGetFocus() {
this.$refs.scanPopupForm.getfocus();
},
qtyChanged(value, item, index) {
if(value==0){
this.showMessage('发料数量不能小于或等于0')
item.handledToQty = item.handledFromQty
this.$refs.comNumberBox.setValue(item.handledToQty);
}else {
if(value>item.defaultHandleQty){
this.showMessage('发料数量不能大于实际来源数量')
item.handledToQty = item.handledFromQty
this.$refs.comNumberBox.setValue(item.handledToQty);
}
item.handledFromQty =item.handledToQty
this.$forceUpdate()
}
},
}
}
</script>
<style scoped lang="scss">
.scan_float_top{
opacity: 0.4;
width: 110rpx;
height: 110rpx;
color: #000;
background-color: #5A7CF3;
border-radius: 50%;
text-align: center;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
}
.scan_float_top image {
width: 40rpx;
height: 40rpx;
margin-top: 10rpx;
}
.scan_float_top view {
color: #fff;
font-size: .725rem;
margin-top: -8rpx;
}
</style>

238
fe/PDA/pages/task/sprayIssuleJob.vue

@ -0,0 +1,238 @@
<template>
<page-meta root-font-size="18px"></page-meta>
<view class="">
<!-- <view class="uni-flex uni-row require_wrap">
<button @click="isTodayChange" :class="[isToday==true?'require_cell require_active':'require_cell']">
<text></text>
只看当天发料
</button>
<button @click="timeSortingChange"
:class="[isIssueTimeChange==true?'require_cell require_active':'require_cell']">
<text></text>
按发料时间排序
</button>
</view> -->
<win-empty-view v-if="issueList.length==0"></win-empty-view>
<view hover-class="uni-list-cell-hover" v-for="(item, index) in issueList" :key="item.id"
@click="openDetail(item)">
<com-issue :dataContent="item"></com-issue>
</view>
<uni-load-more :status="loadingType" v-if="issueList.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 {
getSprayIssueList,
getSprayIssueJobByNumber,
getSprayIssueListByRequest
} from '@/api/index.js';
import {
goHome
} from '@/common/basic.js';
import winEmptyView from '@/mycomponents/wincom/winEmptyView.vue'
import issueDetail from './issue_detail.vue';
import comIssue from '@/mycomponents/coms/task/comIssue.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,
comIssue,
issueDetail,
comMessage,
winScanButton,
winMulitScan,
comScanIssueList
},
data() {
return {
//popup
type: '',
issueList: [],
reload: false,
status: '',
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
},
pageSize: this.modelConfig,
pageIndex: 1,
isIssueTimeChange: false,
isToday: false,
titleArray: ['任务编号'],
loadingType: "nomore"
};
},
props: {
datacontent: {
type: Object,
value: null
},
isByFIFO: {
type: Boolean,
value: false
}
},
mounted() {
this.getList('refresh');
},
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.issueList = [];
}
let params = {
pageSize: that.pageSize,
pageIndex: that.pageIndex,
isCreationTimeSorting: that.isIssueTimeChange,
isToday: that.isToday
};
getSprayIssueList(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.issueList = type === "refresh" ? list : this.issueList.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;
}
if (type == '申请单号') {
this.scanByRequesNumber(code, type);
} else if (type == '任务编号') {
this.scanByNumber(code, type);
}
},
//
scanByRequesNumber(code, type) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getSprayIssueListByRequest(code).then(res => {
uni.hideLoading();
let items = res.items;
if (res.totalCount > 0) {
if (res.totalCount == 1) {
that.openDetail(items[0]);
} else {
that.showItemList(items);
}
} else {
that.showMessage('未查找到' + type + '为【' + code + '】的发料任务');
}
}).catch(err => {
that.showMessage(err.message);
uni.hideLoading();
});
},
//
scanByNumber(code, type) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getSprayIssueJobByNumber(code).then(res => {
uni.hideLoading();
if (res != null) {
that.openDetail(res);
} else {
that.showMessage('未查找到' + type + '为【' + code + '】的发料任务');
}
}).catch(err => {
that.showMessage(err.message);
uni.hideLoading();
});
},
openDetail(item) {
uni.navigateTo({
url: './sprayIssuleJobDetail?id=' + item.id + '&jobStatus=' + item.jobStatus
});
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
onPull() {
this.getList('refresh');
},
onReach() {
//
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>

713
fe/PDA/pages/task/sprayIssuleJobDetail.vue

@ -0,0 +1,713 @@
<!-- 发料任务详情 -->
<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-top="scrollTop" 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="120" align="center">推荐</uni-th>
<uni-th width="120" align="center">实际</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="50">数量</text></uni-th>
<uni-th width="120" align="center">
<text class="text_black">{{item.recommendQty}}({{item.uom}})</text>
</uni-th>
<uni-th width="120" 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">({{item.uom}})</text>
</view>
</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="50">箱码</uni-th>
<uni-th width="120" align="center">
<view class="text_packingCode">
{{ item.recommendPackingCode }}
</view>
</uni-th>
<uni-th width="120" align="center">
<view v-if="item.scaned" class="text_packingCode">
{{ item.handledPackingCode }}
</view>
</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="50">批次</uni-th>
<uni-th width="120" align="center">
<view class="text_black">{{item.recommendLot }}</view>
</uni-th>
<uni-th width="120" align="center">
<view v-if="item.scaned" class="text_black">{{item.handledLot }}</view>
</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="60">库位</uni-th>
<uni-th width="100" align="center">
<view class="text_black">{{ item.recommendFromLocationCode }}</view>
</uni-th>
<uni-th width="100" align="center">
<view class="text_black" v-if="item.scaned">
{{ item.handledFromLocationCode }}
</view>
</uni-th>
</uni-tr>
</uni-table>
</view>
</view>
</view>
<view class="choose_marked" v-if="item.scaned">
<image src="@/static/image_marked.svg"></image>
</view>
<view class="fr"
>
</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'></win-scan-button>
<win-scan-by-pack ref="scanPopup" @getScanResult='getScanResult'></win-scan-by-pack>
<com-message ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'
@afterCloseScanMessage='closeScanMessage'></com-message>
</view>
</template>
<script>
import {
getIssueDetail,
takeSprayIssueJob,
cancelTakeSprayIssueJob,
finshSprayIssueJob,
issueBalances
} 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 comUnPacking from '@/mycomponents/coms/comUnPacking.vue'
export default {
components: {
comMessage,
winScanButton,
winMulitScan,
comBalance,
comJobScanDetail,
winScanByPack,
comNumberBox,
comUnPacking
},
data() {
return {
id: "",
datacontent: {},
details: {},
toLocation: '',
scrollTop: 0,
old: {
scrollTop: 0
},
ispending: false,
balancesItem: null,
currentItem: null,
currentScanLebel: null,
allCount: 0,
scanCount: 0,
isPack: true,
titleArray: ['箱标签'],
jobStatus:""
}
},
props: {
itemCode: "",
},
onLoad(param) {
this.id = param.id;
if (param.jobStatus == 1) {
this.receive((callback => {
this.getDetail();
}));
} else {
this.getDetail();
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}else if(e.index === 1){
window.location.reload();
}
},
//
onBackPress(e) {
//
if (e.from == 'backbutton') {
if (this.jobStatus == 2) {
//
cancelTakeSprayIssueJob(this.id).then(res => {
uni.navigateBack();
}).catch(error => {
uni.navigateBack();
})
} else {
uni.navigateBack();
}
return true;
}
},
mounted() {
uni.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: "#5A7CF3 !important"
})
},
methods: {
openScanPopup() {
// if (this.allCount === this.scanCount) {
// this.showMessage("");
// return;
// }
this.$refs.scanPopup.openScanPopup();
},
//
getDetail() {
let that = this;
if (that.id == undefined) {
return;
}
uni.showLoading({
title: '加载中...',
mask: true
})
let params = {
id: that.id,
};
getIssueDetail(params)
.then(item => {
console.log('item', item);
that.datacontent = item;
that.jobStatus =item.jobStatus;
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;
}
uni.hideLoading();
})
.catch(err => {
this.showMessage('未查找到详细信息')
uni.hideLoading();
});
},
getScanResult(result) {
//
let item = this.details.find(r => r.recommendPackingCode === result.data.packingCode && r
.scanPackingCode != result.data.packingCode);
if (item != undefined && item.scaned) {
showConfirmMsg('扫描的箱码【' + result.data.packingCode + '】匹配到任务中的【' + item.scanPackingCode +
'】箱,是否要重新匹配任务中的【' + item.scanPackingCode + '】箱?',
confirm => {
if (confirm) {
this.handledPackCode(result, true);
} else {
return;
}
})
} else {
if (this.allCount === this.scanCount) {
this.showMessage("零件已经全部扫描完成");
return;
}
this.handledPackCode(result, false);
}
this.scrollToTop();
},
//
//scaned
handledPackCode(result, scaned) {
//
let that = this;
that.currentScanLebel = result;
let scanItem = this.details.find(r => r.scanItemCode === that.currentScanLebel.data.itemCode &&
r.scanPackingCode === that.currentScanLebel.data.packingCode &&
r.scanLot === that.currentScanLebel.data.lot &&
r.scaned == true)
if (scanItem != undefined) {
this.showScanMessage('箱码【' + that.currentScanLebel.data.packingCode + '】已经扫描,请扫描下一箱零件');
} else {
this.dyIssue(result, scaned);
}
},
dyIssue(result, scaned) {
let that = this;
var itemCode = that.details.find(r => {
return r.itemCode === result.data.itemCode&&
r.scaned === scaned
})
if (itemCode == undefined) {
that.showScanMessage('所扫描的箱码【' + result.data.code + '】对应的物料【' + result.data.itemCode + '】不在任务中');
}else {
//
var itemCode1 = that.details.find(r => {
return r.itemCode === result.data.itemCode&&
r.recommendPackingCode === result.data.code
r.scaned === scaned
})
//
if(itemCode1 == undefined){
var itemCode2 = that.details.find(r => {
return r.itemCode === result.data.itemCode&&
r.recommendLot === result.data.lot
&&r.scaned === scaned
})
//
if(itemCode2==undefined){
//
console.log("零件号相同、箱码不相同、批次不相同")
setTimeout(res => {
showConfirmMsg(itemCode.recommendPackingCode+'未执行先进先出或不是最先批次,是否继续?', confirm => {
if (confirm) {
that.currentItem = itemCode;
that.afterScanPackLabel(result);
} else {
that.scanPopupGetFocus();
}
});
}, 100)
}else {
console.log("零件号相同、箱码不相同、批次相同")
//
that.currentItem = itemCode2;
that.afterScanPackLabel(result);
}
}else {
//
var itemCode3 = that.details.find(r => {
return r.itemCode === result.data.itemCode&&
r.recommendPackingCode === result.data.code&&
r.recommendLot === result.data.lot
&&r.scaned === scaned
})
if(itemCode3==undefined){
//
console.log("零件号相同、箱码相同、批次不同")
setTimeout(res => {
showConfirmMsg(itemCode1.recommendPackingCode+'未执行先进先出或不是最先批次,是否继续?', confirm => {
if (confirm) {
that.currentItem = itemCode1;
that.afterScanPackLabel(result);
} else {
that.scanPopupGetFocus();
}
});
}, 100)
}else {
console.log("零件号相同、箱码相同、批次相同")
//
that.currentItem = itemCode3;
that.afterScanPackLabel(result);
}
}
}
// that.currentItem = that.details.find(r => {
// return r.itemCode === result.data.itemCode &&
// r.recommendPackingCode === result.data.code &&
// r.recommendLot === result.data.lot &&
// r.scaned === scaned
// });
// //
// if (that.currentItem === undefined) {
// var itemCode = that.details.find(res => {
// return res.itemCode === result.data.itemCode &&
// res.scaned === scaned
// })
// //
// if (itemCode != undefined) {
// var lot = that.details.find(res => {
// return res.itemCode === result.data.itemCode &&
// res.recommendLot === result.data.lot &&
// res.scaned === scaned
// })
// if (lot != undefined) {
// //
// that.currentItem = lot;
// that.afterScanPackLabel(result);
// } else {
// //
// //
// setTimeout(res => {
// showConfirmMsg(',?', confirm => {
// if (confirm) {
// that.currentItem = itemCode;
// that.afterScanPackLabel(result);
// } else {
// that.scanPopupGetFocus();
// }
// });
// }, 100)
// }
// } else {
// //
// var lot = that.details.find(res => {
// return res.recommendLot === result.data.lot &&
// res.scaned === scaned
// })
// //
// if (lot != undefined) {
// //
// that.showScanMessage('');
// } else {
// //,
// that.showScanMessage('');
// }
// }
// } else {
// that.afterScanPackLabel(result);
// }
},
afterScanPackLabel(result) {
let that = this;
that.getBalance(result, res => {
if (res.totalCount === 1) {
that.balancesItem = res.items[0];
if (that.balancesItem != null || that.balancesItem != undefined) {
that.setBalanceInfo(this.currentItem, that.balancesItem);
that.scanPopupGetFocus();
}
} else {
this.$refs['issueitems'].openPopup(res.items);
}
});
},
//
getBalance(result, callback) {
uni.showLoading({
title: '扫描中...',
mask: true
})
let params = {
pageSize: 1000,
pageIndex: 1,
packingCode: result.data.code,
itemCode: result.data.itemCode,
lot: result.data.lot,
inventoryStatus: 2, //2
locationTypes: [2, 3],
sortBy: 'PackingCode asc'
};
issueBalances(params)
.then(res => {
if (res.totalCount === 0) {
this.showScanMessage('按零件号【' + result.data.itemCode + '】箱码【' + result.data.code + '】批次【' +
result
.data.lot + '】在【原料库、半成品库】未查询到库存信息');
} else {
callback(res);
}
uni.hideLoading();
})
.catch(err => {
this.showScanMessage(err.message);
uni.hideLoading();
});
},
setBalanceInfo(item, balanceItem) {
item.scaned = true;
item.scanDate = new Date() //
item.fromLocationCode = balanceItem.locationCode;
item.fromLocationErpCode = balanceItem.locationErpCode;
item.toLocationCode = item.locationCode;
item.toLocationErpCode = item.locationErpCode;
//
item.handledContainerCode = balanceItem.containerCode;
item.handledPackingCode = balanceItem.packingCode;
item.handledBatch = balanceItem.batch;
item.handledLot = balanceItem.lot;
item.handledQty = balanceItem.qty>item.recommendQty?item.recommendQty:balanceItem.qty;
item.defaultHandleQty = item.handledQty;
item.handledFromLocationCode = balanceItem.locationCode;
item.handledFromLocationArea = balanceItem.locationArea;
item.handledFromLocationGroup = balanceItem.locationErpCode;
item.handledFromLocationErpCode = balanceItem.locationGroup;
item.handledFromWarehouseCode = balanceItem.warehouseCode;
item.toLocationArea = balanceItem.locationArea;
item.toLocationGroup = balanceItem.locationGroup;
item.toLocationErpCode = balanceItem.locationErpCode;
//
item.scanItemCode = this.currentScanLebel.data.itemCode;
item.scanPackingCode = this.currentScanLebel.data.code;
item.scanLot = this.currentScanLebel.data.lot;
item.worker = localStorage.userName_CN ==""?localStorage.userName:localStorage.userName_CN;
item.uom = balanceItem.uom;
this.details.sort(compareDesc('scanDate')); //
this.calcScanCount(); //
this.$forceUpdate();
},
selectedBalanceItem(balanceItem) {
this.setBalanceInfo(this.currentItem, balanceItem);
},
// //
receive(callback) {
let params = {
id: this.id
};
takeSprayIssueJob(params)
.then(res => {
callback(true);
})
.catch(err => {
this.showMessage(err.message);
callback(false);
});
},
submit() {
let that = this;
if (that.datacontent.details.length === 0) {
this.showMessage('该任务没有要上架的零件');
return;
}
let checkItems = that.details.filter(r => r.scaned === true);
if (checkItems.length < that.details.length) {
showConfirmMsg('还有未扫描的零件,是否继续发料', confirm => {
if (confirm) {
that.finsh();
}
});
} else {
that.finsh();
}
},
handleLocation() {
let that = this;
if (that.details[0].requestLocationCode != that.toLocation) {
showConfirmMsg('目标库位【' + that.toLocation + '】与需求库位不一致,是否要将以上零件发到目标库位?', confirm => {
if (confirm) {
that.handledPackingCode();
} else {
that.clearScanLocation();
}
});
} else {
showConfirmMsg('是否要将以上零件发到目标库位:【' + that.toLocation + "】", confirm => {
if (confirm) {
that.handledPackingCode();
} else {
that.clearScanLocation();
}
});
}
},
//
handledPackingCode() {
let that = this;
let items = this.details.filter(r => {
return r.scaned && (r.handledPackingCode === null || r.handledPackingCode === '')
})
if (items.length > 0) {
let packingCodes = '';
items.forEach(r => {
packingCodes += r.recommendPackingCode + ','
})
showConfirmMsg('以下箱码对应的实际箱码为空,是否要继续发料?【' + packingCodes + "】", confirm => {
if (confirm) {
that.finsh();
} else {
that.clearScanLocation();
}
});
} else {
that.finsh();
}
},
finsh() {
let that = this;
uni.showLoading({
title: "提交中...",
mask: true
});
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);
finshSprayIssueJob(that.id, params)
.then(res => {
uni.hideLoading();
if (res != null) {
that.showCommitSuccessMessage();
}
})
.catch(err => {
that.showMessage(err.message);
uni.hideLoading();
});
},
clear() {
this.scanCount = 0;
this.currentItem = null;
this.currentScanLebel = null;
this.getDetail();
},
clearScanLocation() {
this.currentItem = null;
},
unPacking(item) {
this.$refs.comUnPacking.openPopup3(this.datacontent, item,item.handledQty,item.recommendQty,false);
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
calcScanCount() {
this.scanCount = this.details.filter(r => r.scaned === true).length;
this.closeScanPopup();
},
showCommitSuccessMessage() {
this.$refs.comMessage.showCommitSuccess();
},
closeCommitMessage() {
navigateBack(1)
uni.hideLoading();
},
closeScanPopup() {
if (this.allCount == this.scanCount) {
this.$refs.scanPopup.closeScanPopup();
}
},
closeScanMessage() {
this.scanPopupGetFocus();
},
scanPopupGetFocus() {
this.$refs.scanPopup.getfocus();
},
scrollToTop() {
let that = this;
// view
that.scrollTop = that.old.scrollTop
this.$nextTick(function() {
that.scrollTop = 0
});
},
scroll: function(e) {
// console.log(e)
this.old.scrollTop = e.detail.scrollTop;
},
qtyChanged(value, item, index) {
if (value <= 0) {
this.showMessage('发料数量不能小于或等于0')
item.handledQty = item.defaultHandleQty
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty);
} else if (value > item.defaultHandleQty) {
item.handledQty = item.defaultHandleQty
this.showMessage('发料数量不能大于叫料数量:' + item.handledQty)
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty);
}
},
}
}
</script>
<style scoped lang="scss">
</style>
Loading…
Cancel
Save