Browse Source

三方库发货和收货

pda_nev
李俊城 1 year ago
parent
commit
0817c935cc
  1. 49
      fe/PDA/api/index.js
  2. 183
      fe/PDA/components/uni-section/uni-section.vue
  3. 4
      fe/PDA/mycomponents/common/comMessage.vue
  4. 97
      fe/PDA/mycomponents/coms/task/comProductCode.vue
  5. 68
      fe/PDA/mycomponents/coms/task/comThird.vue
  6. 4
      fe/PDA/pages.js
  7. 4
      fe/PDA/pages.json
  8. 131
      fe/PDA/pages/container/containerCall.vue
  9. 2
      fe/PDA/pages/index/index.vue
  10. 480
      fe/PDA/pages/plastics/plasticsCompleteReceive.vue
  11. 26
      fe/PDA/pages/record/productionReturn.vue
  12. 97
      fe/PDA/pages/request/thirdLocationRequest.vue
  13. 3
      fe/PDA/pages/task/receipt_detail.vue
  14. 2
      fe/PDA/pages/task/receipt_result.vue
  15. 14
      fe/PDA/pages/task/thirdLocation.vue
  16. 387
      fe/PDA/pages/task/thirdLocationDetail.vue

49
fe/PDA/api/index.js

@ -1422,9 +1422,56 @@ export const finshContainerJob = (id, params) => request(
})
//生产退库详情
export const customerReturn = (params) => request(
export const customerReturnCommit = (params) => request(
devUrl + "/api/pda/job/production-return", { //
method: "post",
data: params,
});
//三方库发货申请
export const thirdLocationRequest = (params) => request(
devUrl + "/api/pda/store/third-location-request", { //
method: "post",
data: params,
});
//三方库收货任务列表
export const getThirdLocationList = (params) => request(
devUrl + "/api/pda/job/third-location/list", {
method: 'get',
data: params
});
//根据Number 获取三方库收货任务
export const getThirdLocationJobByNumber = (number) => request(
devUrl + "/api/pda/job/third-location/by-number/" + number, {
data: {},
method: "get"
});
//承接三方库收货任务
export const takeThirdLocationJob = (params) => request(
devUrl + "/api/pda/job/third-location/take/" + params.id, { //
data: {},
method: "post"
});
//取消承接三方库收货任务
export const cancelTakeThirdLocationJob = (id) => request(
devUrl + "/api/pda/job/third-location/cancel-take/" + id, { //
data: {},
method: "post"
});
//提交三方库收货任务
export const finshThirdLocationJob = (id, params) => request(
devUrl + "/api/pda/job/third-location/finish/" + id, { //
data: params,
method: "post"
})
//三方库收货任务详情
export const getThirdLocationDetail = (params) => request(
devUrl + "/api/pda/job/third-location/" + params.id, { //
data: {},
method: "get"
});

183
fe/PDA/components/uni-section/uni-section.vue

@ -1,30 +1,46 @@
<template>
<view class="uni-section" nvue>
<view v-if="type" class="uni-section__head">
<view :class="type" class="uni-section__head-tag" />
<view class="uni-section">
<view class="uni-section-header" @click="onClick">
<view class="uni-section-header__decoration" v-if="type" :class="type" />
<slot v-else name="decoration"></slot>
<view class="uni-section-header__content">
<text :style="{'font-size':titleFontSize,'color':titleColor}" class="uni-section__content-title" :class="{'distraction':!subTitle}">{{ title }}</text>
<text v-if="subTitle" :style="{'font-size':subTitleFontSize,'color':subTitleColor}" class="uni-section-header__content-sub">{{ subTitle }}</text>
</view>
<view class="uni-section-header__slot-right">
<slot name="right"></slot>
</view>
</view>
<view class="uni-section__content">
<text :class="{'distraction':!subTitle}" class="uni-section__content-title">{{ title }}</text>
<text v-if="subTitle" class="uni-section__content-sub">{{ subTitle }}</text>
<view class="uni-section-content" :style="{padding: _padding}">
<slot />
</view>
<slot />
</view>
</template>
<script>
/**
* Section 标题栏
* @description 标题栏
* @property {String} type = [line|circle] 标题装饰类型
* @property {String} type = [line|circle|square] 标题装饰类型
* @value line 竖线
* @value circle 圆形
* @value square 正方形
* @property {String} title 主标题
* @property {String} titleFontSize 主标题字体大小
* @property {String} titleColor 主标题字体颜色
* @property {String} subTitle 副标题
* @property {String} subTitleFontSize 副标题字体大小
* @property {String} subTitleColor 副标题字体颜色
* @property {String} padding 默认插槽 padding
*/
export default {
name: 'UniSection',
emits: ['click'],
emits:['click'],
props: {
type: {
type: String,
@ -32,16 +48,43 @@
},
title: {
type: String,
required: true,
default: ''
},
titleFontSize: {
type: String,
default: '14px'
},
titleColor:{
type: String,
default: '#333'
},
subTitle: {
type: String,
default: ''
},
subTitleFontSize: {
type: String,
default: '12px'
},
subTitleColor: {
type: String,
default: '#999'
},
padding: {
type: [Boolean, String],
default: false
}
},
data() {
return {}
},
computed:{
_padding(){
if(typeof this.padding === 'string'){
return this.padding
}
return this.padding?'1px':''
}
},
watch: {
title(newVal) {
if (uni.report && newVal !== '') {
@ -49,77 +92,77 @@
}
}
},
methods: {
methods: {
onClick() {
this.$emit('click')
}
}
}
</script>
<style scoped>
<style lang="scss" >
$uni-primary: #2979ff !default;
.uni-section {
position: relative;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
margin-top: 10px;
flex-direction: row;
align-items: center;
padding: 0 10px;
height: 50px;
background-color: #f8f8f8;
/* #ifdef APP-NVUE */
/* #endif */
font-weight: normal;
}
background-color: #fff;
// background-color: #2979ff;
.uni-section-header {
position: relative;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
align-items: center;
padding: 2px 1px;
font-weight: normal;
/* #ifndef APP-NVUE */
/* #endif */
.uni-section__head {
flex-direction: row;
justify-content: center;
align-items: center;
margin-right: 10px;
}
&__decoration{
margin-right: 6px;
background-color: $uni-primary;
&.line {
width: 4px;
height: 12px;
border-radius: 10px;
}
.line {
height: 15px;
background-color: #c0c0c0;
border-radius: 5px;
width: 3px;
}
&.circle {
width: 8px;
height: 8px;
border-top-right-radius: 50px;
border-top-left-radius: 50px;
border-bottom-left-radius: 50px;
border-bottom-right-radius: 50px;
}
.circle {
width: 8px;
height: 8px;
border-top-right-radius: 50px;
border-top-left-radius: 50px;
border-bottom-left-radius: 50px;
border-bottom-right-radius: 50px;
background-color: #c0c0c0;
}
&.square {
width: 8px;
height: 8px;
}
}
.uni-section__content {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
flex: 1;
color: #333;
}
&__content {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
flex: 1;
color: #333;
.uni-section__content-title {
font-size: 14px;
color: #333;
}
.distraction {
flex-direction: row;
align-items: center;
}
&-sub {
margin-top: 2px;
}
}
.distraction {
flex-direction: row;
align-items: center;
}
&__slot-right{
font-size: 14px;
}
}
.uni-section__content-sub {
font-size: 12px;
color: #999;
.uni-section-content{
font-size: 14px;
}
}
</style>

4
fe/PDA/mycomponents/common/comMessage.vue

@ -98,14 +98,14 @@
openMessage(content, type) {
this.content = content;
this.type = type;
this.$refs['popupMessage'].open("center");
this.$refs.popupMessage.open("center");
},
closeMessage() {
this.confirmResult = false;
clearInterval(this.timer) //timer
this.$refs['popupMessage'].close();
this.$refs.popupMessage.close();
this.afterClose();
},

97
fe/PDA/mycomponents/coms/task/comProductCode.vue

@ -0,0 +1,97 @@
<template>
<view>
<view class="detail-list margin_top" >
<!-- 单选卡片 -->
<view class="detail-content">
<view class="choose_main">
<view class="ljh_box">
<view class="tit_ljh">{{ dataContent.itemCode }}</view>
<view class="ljh_left">
<view class="font_xs text_lightblue">{{ dataContent.itemName }}</view>
<view class="font_xs text_lightblue">{{ dataContent.itemDesc1 }}</view>
</view>
</view>
<view class="list_form hold_form">
<view class="uni-container">
<uni-table style="overflow-x: hidden;">
<uni-tr>
<uni-th width="70"></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="70">数量</uni-th>
<uni-th width="120" align="center">
<view class="text_black">{{dataContent.recommendQty}}({{dataContent.uom}})</text>
</view>
</uni-th>
<!-- -->
<uni-th width="120" align="center">
<view class="" v-if="dataContent.scaned">
<com-number-box :ref="'comNumberBox_'+index" v-model="dataContent.handledQty"
:max="99999" :min="0" @change="qtyChanged($event,dataContent,index)">
</com-number-box>
</view>
<!-- <view v-if="dataContent.scaned" class="text_black">
{{dataContent.handledQty}}({{dataContent.uom}})
</view> -->
</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="70">来源库位</uni-th>
<uni-th width="120" align="center">
<view class="text_black">{{ dataContent.recommendFromLocationCode }}</view>
</uni-th>
<uni-th width="120" align="center">
<view class="">
<button v-if="dataContent.scaned" type="primary" size="mini"
style="margin-left: 30rpx;" @click="remove(dataContent,index)">移除</button>
</view>
</uni-th>
</uni-tr>
</uni-table>
</view>
</view>
</view>
{{dataContent.scaned}}
<view class="choose_marked" v-if="dataContent.scaned">
<image src="@/static/image_marked.svg"></image>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {}
},
props: {
dataContent: {
type: Object,
value: {}
}
},
watch:{
dataContent: {
handler(newName, oldName) {
this.dataContent=newName;
},
immediate: true,
deep: true
}
},
methods: {
remove() {
this.$emit("remove", dataContent)
}
}
}
</script>
<style>
</style>

68
fe/PDA/mycomponents/coms/task/comThird.vue

@ -0,0 +1,68 @@
<!--发料任务卡片-->
<template>
<view class="device-detail">
<view class="card_task nopad">
<com-job-top-info :jobContent="dataContent"></com-job-top-info>
</view>
<view class="margin_xs_bottom">
<view class="label_order">
<image class="icon_normal" src="@/static/icons_ui/icon_apply_num.svg"></image>
<text>{{dataContent.requestNumber}}</text>
<!-- <text>申请单{{dataContent.deliverRequestNumber}}</text> -->
</view>
<view class="label_order">
<image class="icon_normal" src="@/static/icons_ui/icon_customer.svg"></image>
<text>{{dataContent.worker}}</text>
<!-- <text>客户{{dataContent.customerCode}}</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,
dateFormat
} from '@/common/basic.js';
import comJobTopInfo from '@/mycomponents/comjob/comJobTopInfo.vue'
export default {
name: "comDeliver",
components: {
comJobTopInfo
},
data() {
return {};
},
//
props: {
dataContent: {
type: Object,
value: null
}
},
filters: {
statusStyle: function(val) {
return getJobStatuStyle(val);
},
statusColor: function(val) {
return getJobStatuDesc(val);
},
formatDate: function(val) {
return dateFormat(val)
}
},
}
</script>
<style scoped lang="scss">
</style>

4
fe/PDA/pages.js

@ -626,7 +626,7 @@ module.exports = () => ({
}
},
{
"path": "pages/record/thirdLocationDeviler",
"path": "pages/request/thirdLocationRequest",
"style": {
"navigationBarTitleText": "三方库发货",
"enablePullDownRefresh": true
@ -643,7 +643,7 @@ module.exports = () => ({
"path": "pages/task/thirdLocationDetail",
"style": {
"navigationBarTitleText": "三方库收货详情",
"enablePullDownRefresh": true
"enablePullDownRefresh": false
}
}

4
fe/PDA/pages.json

@ -604,7 +604,7 @@
}
},
{
"path": "pages/record/thirdLocationDeviler",
"path": "pages/request/thirdLocationRequest",
"style": {
"navigationBarTitleText": "三方库发货",
"enablePullDownRefresh": true
@ -621,7 +621,7 @@
"path": "pages/task/thirdLocationDetail",
"style": {
"navigationBarTitleText": "三方库收货详情",
"enablePullDownRefresh": true
"enablePullDownRefresh": false
}
}

131
fe/PDA/pages/container/containerCall.vue

@ -1,53 +1,78 @@
<template>
<view class="">
<!-- <view class="" style="width: 100%; background-color: #fff;">
<uni-section title="1.物流类型" subTitle="内物流" subTitleFontSize="32rpx" titleFontSize="40rpx"
type="line" padding>
</uni-section>
</view>
<view class="" style="width: 100%; background-color: #fff;">
<uni-section title="2.器具规格" subTitleFontSize="32rpx" titleFontSize="40rpx"
type="line" padding>
</uni-section>
</view>
-->
<view class="uni-list">
<view class="uni-list-cell"
style="padding-left: 15rpx; padding-top: 20rpx;padding-bottom:20rpx; padding-right: 15rpx; ; align-items: center; display: flex;">
<view class="" style="color: red; font-size: 40rpx; ">
*
</view>
<view class="uni-list-cell-left"
style="font-size:35rpx; align-items: center;display: flex; text-align: center;font-weight: bold;">
呼叫库位 :
</view>
<view class="uni-list-cell-db" style="font-size:35rpx" @click="openScanLocation">
<text>{{locationCode}}</text>
<text v-if="locationName!=''">({{locationName}})</text>
</view>
</view>
</view>
<view class="uni-list">
<view class="uni-list-cell " style="padding:10rpx; ">
<view class="" style="color: red; font-size: 40rpx; ">
*
</view>
<view class="uni-list-cell-left" style="font-size:35rpx">
<view class="uni-list-cell-left" style="font-size:35rpx;font-weight: bold;">
器具类型 :
</view>
<view class="uni-list-cell-db">
<picker @change="containerTypeChange" :value="typeIndex" :range="containerTypeList"
range-key="name">
<view class="uni-input" style="font-size:35rpx">{{containerType}}</view>
</picker>
<view class="uni-list-cell-db" style="font-size: 35rpx;">
内物流
</view>
</view>
</view>
<view class="uni-list">
<view class="uni-list-cell" style="padding:10rpx">
<view class="uni-flex uni-row" style="padding:10rpx">
<view class="" style="color: red; font-size: 40rpx; ">
*
</view>
<view class="uni-list-cell-left" style="font-size:35rpx">
<view class="uni-list-cell-left" style="font-size:35rpx;font-weight: bold;">
器具规格 :
</view>
<view class="uni-list-cell-db">
<picker @change="containerModelChange" :value="modelIndex" :range="containerModelList"
range-key="name">
<view class="uni-input" style="font-size:35rpx">{{containerModel}}</view>
</picker>
</view>
</view>
</view>
<view class="uni-list">
<view class="uni-list-cell"
style="padding-left: 15rpx; padding-top: 20rpx;padding-bottom:20rpx; padding-right: 15rpx; ; align-items: center; display: flex;">
<view class="" style="color: red; font-size: 40rpx; ">
*
</view>
<view class="uni-list-cell-left"
style="font-size:35rpx; align-items: center;display: flex; text-align: center;">
呼叫库位 :
</view>
<view class="uni-list-cell-db" style="font-size:35rpx" @click="openScanLocation">
<text>{{locationCode}}</text>
<text v-if="locationName!=''">({{locationName}})</text>
<view class="uni-list-cell-db" style="margin-bottom: 20rpx;">
<!-- <picker @change="containerModelChange" :value="modelIndex" :range="containerModelList"
range-key="name">
<view class="uni-input" style="font-size:35rpx">{{containerModel}}</view>
</picker> -->
<view class="uni-flex uni-row" style="flex-wrap: wrap;">
<view class="uni-flex" style=" width: 33.3%; justify-content: center; margin-top: 20rpx; "
v-for="(item, index) in containerModelList" :key="index">
<uni-tag :inverted="!item.checked" :circle="true" :text="item.name" type="primary"
@click="setContainerModel(item)" />
<!-- <u-radio size="45" labelSize="35" iconSize="40" :name="radio.name" @change="radioChangeType3(item,radio)">
{{radio.name}}
</u-radio> -->
</view>
</view>
</view>
</view>
<view class="new_btn_bot">
<button class="new_save_btn" @click="submit()">提交</button>
</view>
@ -78,22 +103,20 @@
},
data() {
return {
containerTypeList: [],
containerModelList: [],
typeIndex: 0,
modelIndex: 0,
location: "",
locationCode: "请扫描库位",
locationName: "",
containerType: "请选择器具类型",
containerTypeCode: "",
containerType: "内物流",
containerTypeCode: "InLogistics",
containerModel: "请选择器具规格",
containerModelCode: ""
}
},
onShow() {
this.getContainerModelList();
this.containerTypeList = getContainerTypeArray();
},
//
onNavigationBarButtonTap(e) {
@ -104,30 +127,24 @@
}
},
methods: {
setContainerModel(item) {
this.containerModelList.forEach(res => {
res.checked = false
})
item.checked = true;
this.containerModelCode =item.code;
},
getContainerModelList() {
getDictByCode("ContainerSpecificationsType").then(res => {
res.items.forEach(item => {
item.value = item.code;
item.checked = false
})
this.containerModelList = res.items;
}).catch(error => {
})
},
containerTypeChange(e) {
this.typeIndex = e.detail.value
var select = this.containerTypeList[this.typeIndex];
this.containerType = select.name
this.containerTypeCode = select.value
console.log(select)
},
containerModelChange(e) {
this.modelIndex = e.detail.value
var select = this.containerModelList[this.modelIndex];
this.containerModel = select.name
this.containerModelCode = select.value
console.log(select)
},
openScanLocation() {
this.$refs.scanLocation.openScanPopup()
},
@ -172,14 +189,10 @@
this.$refs.scanLocation.losefocus();
},
clearData() {
this.containerType = "请选择器具类型"
this.containerModel = "请选择器具规格";
this.locationCode = "请扫描库位"
this.locationName ="";
this.containerTypeCode = ""
this.containerModelCode = ""
this.modelIndex =0;
this.typeIndex =0;
this.containerModelList.forEach(res=>{
res.checked = false
});
},
@ -196,12 +209,7 @@
},
submit() {
if (this.containerType == "请选择器具类型") {
this.showMessage("请选择器具类型")
return;
}
if (this.containerModel == "请选择器具规格") {
if (this.containerModelCode == "") {
this.showMessage("请选择器具规格")
return;
}
@ -210,15 +218,12 @@
this.showMessage("请扫描库位")
return;
}
console.log(this.containerTypeCode)
console.log(this.containerModelCode)
console.log(this.locationCode)
uni.showLoading({
title: '提交中...',
mask: true
});
var params = this.setParams();
console.log(JSON.stringify(params))
containerRequest(params).then(res => {
uni.hideLoading();
this.showMessage("提交成功");

2
fe/PDA/pages/index/index.vue

@ -179,7 +179,7 @@
if (sessionStorage.hasLogin !== 'true') {
uni.showModal({
title: '未登录',
content: '您未登录需要登录后才能继续', //
content: '您未登录,需要登录后才能继续', //
showCancel: !this.forcedLogin,
success: (res) => {
if (res.confirm) {

480
fe/PDA/pages/plastics/plasticsCompleteReceive.vue

@ -1,176 +1,408 @@
<template>
<view style="padding: 15rpx;">
<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="button"
activeColor="#007AFF"></uni-segmented-control>
<view class="content">
<view v-show="current === 0">
<win-empty-view v-if="dataList.length==0"></win-empty-view>
<view class="" v-for="(item, index) in dataList">
<view class="device-detail">
<view>物料:</view>
<view>零件:</view>
<button type="primary" style="width: 140rpx; font-size: 32rpx; float: right;" >完成</button>
</view>
</view>
选项卡1的内容
</view>
<view v-show="current === 1">
<win-empty-view v-if="dataList.length==0"></win-empty-view>
<view class="" v-for="(item, index) in dataList">
<view class="" v-for="(item, index) in dataList">
<view class="device-detail">
<view>物料:</view>
<view>零件:</view>
<button type="primary" style="width: 140rpx; font-size: 32rpx; float: right;" >完成</button>
<page-meta root-font-size="18px"></page-meta>
<view class="">
<win-blank-view @goScan='openScanPopup' v-if="itemList.length==0"></win-blank-view>
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper"
@scrolltolower="lower" @scroll="scroll" style="padding-bottom:150px">
<view class="detail-list " v-for="(item, index) in itemList" :key="index">
<view class="detail-content">
<view class="" style="">
<view class="uni-flex uni-row u-col-center">
<view class="" style="margin-top: 20rpx; margin-left: 10rpx; font-weight: bold;">
({{index+1}}).
</view>
<comItemCode :itemData="item"></comItemCode>
</view>
<uni-table border stripe style="">
<!-- <uni-tr>
<uni-td align="center">物品代码</uni-td>
<uni-td>{{item.itemCode}}</uni-td>
</uni-tr> -->
<uni-tr>
<uni-td align="center">单位</uni-td>
<uni-td>{{item.uom}}</uni-td>
</uni-tr>
<uni-tr>
<uni-td align="center">标包数</uni-td>
<uni-td>{{item.stdPackQty}}</uni-td>
</uni-tr>
<uni-tr>
<uni-td align="center">来源库位</uni-td>
<uni-td>{{item.fromLocationCode}}</uni-td>
</uni-tr>
<uni-tr>
<uni-td align="center">数量</uni-td>
<uni-td>
<view class="uni-flex uni-row">
<view class="uni-flex uni-row space-between" style="width: 100%;">
<view class="">
<com-number-box :ref="'comNumberBox_'+index" v-model="item.qty"
:max="99999" :min="0" @change="qtyChanged($event,item,index)">
</com-number-box>
</view>
<view class="">
<button type="primary" size="mini" style="margin-left: 30rpx;"
@click="remove(item,index)">移除</button>
</view>
</view>
</view>
</uni-td>
</uni-tr>
</uni-table>
</view>
</view>
选项卡2的内容
</view>
</view>
<uni-load-more :status="loadingType" v-if="dataList.length>0" />
</scroll-view>
<div class="new_bot_box" v-show="itemList.length>0">
<win-collapse-location ref="location" @getLocationCode='getToLocation' @clear='clear'>
</win-collapse-location>
<view class="new_btn_bot bot_pos uni-flex">
<button class="new_clear_btn btn_double" @click="cancel()">清空</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>
<winScanByProductCode ref="scanPackPopup" title="产品编码" @getScanResult='getScanResult'></winScanByProductCode>
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance>
<com-message ref="comMessage" @afterClose='afterCloseMessagg'></com-message>
</view>
</view>
</template>
<script>
import {
getPlasticsList,
locations,
getBalancesByFilter,
completeTransfer
} from '@/api/index.js';
import {
goHome
showConfirmMsg,
goHome,
getRemoveOption
} from '@/common/basic.js';
import winEmptyView from '@/mycomponents/wincom/winEmptyView.vue'
import winBlankView from '@/mycomponents/wincom/winBlankView.vue'
import comBalanceItem from '@/mycomponents/comItem/comBalanceItem.vue'
import winScanButton from '@/mycomponents/wincom/winScanButton.vue'
import winScanByPack from '@/mycomponents/wincom/winScanByPack.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import comBalance from '@/mycomponents/common/comBalance.vue'
import winCollapseLocation from '@/mycomponents/wincom/winCollapseLocation.vue'
import winScanByProductCode from '@/mycomponents/wincom/winScanByProductCode.vue'
import comItemCode from '@/mycomponents/comItem/comItemCode.vue'
import comNumberBox from '@/mycomponents/common/comNumberBox.vue';
export default {
name: 'comtransfer',
components: {
winEmptyView
winBlankView,
comBalanceItem,
comMessage,
winScanButton,
comBalance,
winCollapseLocation,
winScanByProductCode,
comItemCode,
comNumberBox
},
data() {
return {
items: ['已完成', '未完成'],
current: 0,
pageSize: this.modelConfig,
pageIndex: 1,
loadingType: "nomore",
dataList:[]
options: [],
itemList: [],
fromLocationCode: '',
toLocationCode: '',
scrollTop: 0,
old: {
scrollTop: 0
},
inventoryStatus: -1,
inventoryStatusArray: [],
isClearPackCode: false, //
isClearContainerCode: false, //
isClearLot: false, //,
locationErpCode: '',
toLocationErpCode: '',
locationGotFocus: false
};
},
onShow() {
this.getList('refresh');
},
onReachBottom() {
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList("more");
},
onPullDownRefresh() {
this.getList('refresh');
},
//退
onBackPress(options) {
if (options.from === 'navigateBack') {
return false;
props: {
// locationTypes: {
// type: [Array, String, Number],
// value: ''
// },
byLocation: {
type: Boolean,
value: false
},
transferType: {
type: String,
value: 'Transfer_Inside' //Transfer_Inside: Transfer_Area:
}
goHome();
return true;
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index === 1) {
window.location.reload();
}
watch: {},
mounted: function() {
this.openScanPopup();
this.options = getRemoveOption();
},
methods: {
onClickItem(item){
this.current = item.currentIndex;
console.log("点击",this.current)
this.getList("refresh");
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
this.$refs.scanPackPopup.openScanPopup()
},
//?
swipeClick(e, index) {
let {
content
} = e;
if (content.text === '移除') {
uni.showModal({
title: '提示',
content: '是否移除选择的行?',
success: res => {
if (res.confirm) {
this.itemList.splice(index, 1);
}
}
});
}
},
//
getList(type) {
getScanResult(result) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageIndex = 1;
this.dataList = [];
}
let params = {
pageSize: that.pageSize,
pageIndex: that.pageIndex,
// isCreationTimeSorting: that.isTimeWindowSorting,
// isToday: that.isToday
};
getPlasticsList(params)
.then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.items;
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
//
this.loadingType = "nomore";
return;
}
// that.dataList = [...that.dataList, ...list];
that.dataList = type === "refresh" ? list : this.dataList.concat(list);
that.pageIndex++;
})
.catch(err => {
this.loadingType = "";
this.showMessage(err.message);
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
let code = result.itemCode;
let datas = that.itemList.filter(r => {
return r.itemCode == code
})
if (datas.length > 0) {
showConfirmMsg('物料【' + code + '】已经存在,是否要重新扫描?', confirm => {
if (confirm) {
that.itemList.forEach((r, i) => {
if (r.packingCode == code) {
that.itemList.splice(i, 1);
return;
}
});
// that.getBalance(code);
}
});
} else {
var item ={
itemCode: result.itemCode,
itemName: result.itemName,
itemDesc1: result.itemDesc1,
stdPackQty: result.stdPackQty,
uom: result.uom,
qty: result.stdPackQty,
fromLocationCode:"Z1C1"
}
this.itemList.unshift(item);
}
},
getScanResult(type, result) {
if (type == '任务编号') {
this.getByNumber(type, result.data.code);
qtyChanged(value, item, index) {
if (value <= 0) {
this.showMessage('退货数量必须大于0')
item.handledQty = item.qty
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty);
}
},
getByNumber(type, code) {
let that = this;
getToLocation(code) {
if (code == '') {
this.showMessage('目标库位不能为空');
return;
}
uni.showLoading({
title: "加载中....",
title: "扫描中",
mask: true
});
getDeliverJobByNumber(code).then(res => {
uni.hideLoading();
if (res != null) {
that.openDetail(res);
let that = this;
locations(code).then(res => {
if (res == null) {
that.toLocationCode = ''
that.showMessage('目标库位【' + code + '】不存在');
this.$refs.location.clearLocation()
this.locationGotFocus = true;
} else {
that.showMessage('未查找到' + type + '为【' + code + '】的盘点任务');
if (that.transferType == 'Transfer_Inside') //
{
if (that.locationErpCode != res.erpLocationCode) {
that.showMessage('目标库位的ERP储位【' + res.erpLocationCode + '】与【' + this
.locationErpCode +
'】不是同一ERP储位,请重新扫描目标库位');
that.toLocationCode = ''
that.$refs.location.clearLocation();
this.locationGotFocus = true;
} else {
that.toLocationCode = code;
that.toLocationErpCode = res.erpLocationCode;
}
} else //
{
let items = that.itemList.filter(r => {
return r.fromLocationErpCode == res.erpLocationCode;
})
if (items.length > 0) {
let msg = '';
for (var i = 0; i < items.length; i++) {
let r = items[i];
msg += (i == 0 ? '' : ',') + r.fromPackingCode
}
that.showMessage('【' + msg + '】所在ERP储位与目标库位的ERP储位【' + res
.erpLocationCode + '】相同,请重新扫描目标库位');
that.toLocationCode = ''
that.$refs.location.clearLocation();
this.locationGotFocus = true;
} else {
that.toLocationCode = res.code;
that.toLocationErpCode = res.erpLocationCode;
}
}
}
uni.hideLoading();
}).catch(err => {
that.toLocationCode = ''
this.locationGotFocus = true;
that.showMessage(err.message);
uni.hideLoading();
});
})
},
clear() {
this.location = null;
this.toLocationCode = "";
},
openDetail(item) {
uni.navigateTo({
url: './plasticsInventoryMoveDetail?id=' + item.id + '&jobStatus=' + item.jobStatus
submit() {
let that = this;
if (that.itemList.length === 0) {
this.showMessage('请选择要提交的零件');
return;
}
if (that.toLocationCode === '') {
this.showMessage('请扫描目标库位');
return;
}
uni.showLoading({
title: "提交中....",
mask: true
});
let item = {
worker: localStorage.userName_CN ==""?localStorage.userName:localStorage.userName_CN,
warehouseCode: localStorage.warehouseCode,
jobNumber: "",
supplierCode: "",
company: localStorage.company,
number: "",
type: this.transferType,
details: []
}
that.itemList.forEach(r => {
r.toLocationCode = that.toLocationCode;
r.toLocationErpCode = this.toLocationErpCode
r.worker = localStorage.userName_CN ==""?localStorage.userName:localStorage.userName_CN
item.details.push(r);
})
let params = JSON.stringify(item);
console.log('params', params);
completeTransfer(params)
.then(res => {
that.showCommitSuccess();
that.clearInfo();
uni.hideLoading();
})
.catch(err => {
that.showMessage(err.message);
uni.hideLoading();
});
},
cancel() {
let that = this;
showConfirmMsg('是否要清空已扫描的零件和目标库位信息?', confirm => {
if (confirm) {
that.clearInfo();
}
})
},
clearInfo() {
let that = this;
that.itemList = [];
that.toLocationCode = '';
that.inventoryStatus = -1;
},
afterCloseMessagg() {
if (this.locationGotFocus) {
this.$refs.location.gotFocus();
}
},
clearPackCode() {
this.isClearPackCode = !this.isClearPackCode;
},
clearContainerCode() {
this.isClearContainerCode = !this.isClearContainerCode;
},
clearLot() {
this.isClearLot = !this.isClearLot;
},
upper: function(e) {
// console.log(e)
},
lower: function(e) {
// console.log(e)
},
scroll: function(e) {
// console.log(e)
this.old.scrollTop = e.detail.scrollTop;
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
showCommitSuccess() {
this.$refs.comMessage.showCommitSuccess();
},
}
};
</script>
<style scoped lang="scss">
/deep/ .input-value {
font-size: 16px;
}
/deep/ .uni-collapse-item__title-text {
font-size: 16px;
}
/deep/ .uni-collapse-item--border {
border-bottom-width: 0px;
border-bottom-color: #ebeef5;
}
/deep/ .uni-collapse-item--border {
border-bottom-width: 1px;
border-bottom-color: #ebeef5;
}
</style>

26
fe/PDA/pages/record/productionReturn.vue

@ -121,8 +121,8 @@
options: [],
currentItem: {},
showList: [],
defaultToLocation: {},
defaultToLocationCode: "",
toLocationInfo:{},
toLocationCode: "",
allCount: 0,
allDataList: [],
loadingType: "",
@ -253,24 +253,23 @@
locations(locationCode).then(res => {
uni.hideLoading();
if (res) {
this.defaultToLocation = res;
this.defaultToLocationCode = res.code
this.toLocationInfo =res;
this.toLocationCode = res.code
} else {
this.showMessage('目标库位【' + locationCode + '】不存在');
}
}).catch(err => {
uni.hideLoading();
this.defaultToLocation = {};
this.defaultToLocationCode = ""
this.toLocationInfo={}
this.toLocationCode = ""
this.showMessage(err.message);
})
},
clearDefaultLocation() {
this.defaultToLocationCode = ""
this.defaultToLocation = {};
this.toLocationCode = ""
},
submit() {
@ -279,7 +278,7 @@
return;
}
if (this.defaultToLocationCode == "") {
if (this.toLocationCode == "") {
this.showMessage('请扫描目标库位');
return;
}
@ -335,7 +334,10 @@
uom: res.uom,
qty: res.qty,
stdPackQty: res.stdPackQty,
toLocationCode:this.defaultToLocationCode
toLocationCode:this.toLocationCode,
toLocationArea:this.toLocationInfo.areaCode,
toLocationGroup:this.toLocationInfo.locationGroupCode,
toLocationErpCode:this.toLocationInfo.erpLocationCode
}
item.details.push(detail)
})
@ -440,8 +442,8 @@
clearInfo() {
this.allDataList = [];
this.showList = [];
this.defaultToLocation = {};
this.defaultToLocationCode = "";
this.toLocationInfo={}
this.toLocationCode = "";
this.allCount = 0;
this.loadingType = ""
this.pageNo = 0

97
fe/PDA/pages/record/thirdLocationDeviler.vue → fe/PDA/pages/request/thirdLocationRequest.vue

@ -2,12 +2,12 @@
<page-meta root-font-size="18px"></page-meta>
<view class="">
<win-blank-view @goScan='openScanPopup' v-if="fromLocationCode==''"></win-blank-view>
<view class="" style=" background-color: #5A7CF3; color: #fff; border-radius: 20rpx; margin: 15rpx;" v-if="fromLocationCode!=''">
<view class="" style=" background-color: #5A7CF3; color: #fff; border-radius: 10rpx; margin: 15rpx;" v-if="fromLocationCode!=''">
<view class="" style="">
<view class="uni-flex top_lines_info" style="flex-direction: column;">
<view class="" style="padding: 10rpx;">
<view class="" style="padding: 20rpx;">
来源库位:
<text class="text_bold" >{{fromLocationCode.code}}</text>
<text class="text_bold" >{{fromLocationCode}}</text>
</view>
<!-- <view class="" style="padding: 10rpx;">
扫描数量:
@ -77,7 +77,7 @@
<button class="new_save_btn btn_double" @click="submit()">提交</button>
</view>
</div>
<win-scan-button @goScan='openScanPopup' v-if="showList.length>0"></win-scan-button>
<win-scan-button @goScan='openScanPopup' v-if="fromLocationCode!=''"></win-scan-button>
<winScanByProductCode ref="scanPackPopup" title="单件码" @getScanResult='getScanResult'></winScanByProductCode>
<win-scan-by-code ref="scanFromLocationPopup" title="来源库位" @getScanCode='scanFromLocation'></win-scan-by-code>
<com-message ref="comMessage" @afterCloseScanMessage='closeScanMessage' @afterRescanMessage='afterRescan'
@ -91,13 +91,14 @@
locations,
getBalancesByFilterAsync,
getWipListAsync,
customerReturn,
thirdLocationRequest,
} from '@/api/index.js';
import {
showConfirmMsg,
goHome,
getRemoveOption
getRemoveOption,
getISODateTime
} from '@/common/basic.js';
import winBlankView from '@/mycomponents/wincom/winBlankView.vue'
@ -116,7 +117,7 @@
export default {
name: 'customerReturn',
name: 'thirdLocationRequest',
components: {
winBlankView,
comBaseItem,
@ -136,9 +137,10 @@
options: [],
currentItem: {},
showList: [],
defaultToLocation: {},
defaultToLocationCode: "",
toLocationCode: "",
toLocationArea:"",
fromLocationCode: "",
fromLocationArea:"",
allCount: 0,
allDataList: [],
loadingType: "",
@ -151,9 +153,7 @@
};
},
onLoad() {
uni.setNavigationBarTitle({
title: "三方库发货"
})
this.updateTitle()
},
onPullDownRefresh() {
this.pageNo = 1;
@ -204,18 +204,21 @@
locations(code).then(res => {
uni.hideLoading();
if(res){
if(res.type == 3||res.type == 5){
that.fromLocationCode = res;
if(res.type == 3||res.type == 4){
this.fromLocationCode = res.code;
this.fromLocationArea = res.areaCode;
this.openPackLabel();
this.closeScanFromLocationPopup();
}else {
that.showMessage('扫描的库位【' + code + '】不是【半成品库】或【成品库位】');
this.showMessage('扫描的库位【' + code + '】不是【半成品库】或【成品库位】');
}
}else {
that.showMessage('未查询到库位【' + code + '】');
this.showMessage('未查询到库位【' + code + '】');
}
}).catch(err => {
this.fromLocationCode = "";
this.fromLocationArea = "";
uni.hideLoading();
that.showMessage(err.message);
});
@ -242,9 +245,7 @@
if (res) {
this.allDataList.splice(index, 1);
this.allCount = this.allDataList.length;
uni.setNavigationBarTitle({
title: "三方库发货"+"("+this.allCount+")"
})
this.updateTitle()
this.$forceUpdate()
}
})
@ -261,7 +262,7 @@
let balanceRes = await getBalancesByFilterAsync(balanceParam);
if(balanceRes.totalCount==0){
this.showMessage("单件码【" + filterItem[0].itemCode + "】在库位【"+this.fromLocationCode+"】没有库存")
this.showMessage("单件码【" + result.itemCode + "】在库位【"+this.fromLocationCode+"】没有库存")
return;
}
@ -290,10 +291,7 @@
this.showList = []
this.loadingType = "";
this.showList = this.getDataPage(this.pageNo, this.pageSize)
uni.setNavigationBarTitle({
title: "三方库发货"+"("+this.allCount+")"
})
this.updateTitle()
this.$forceUpdate();
},
@ -307,24 +305,24 @@
locations(locationCode).then(res => {
uni.hideLoading();
if (res) {
this.defaultToLocation = res;
this.defaultToLocationCode = res.code
this.toLocationCode = res.code
this.toLocationArea =res.areaCode;
} else {
this.showMessage('目标库位【' + locationCode + '】不存在');
}
}).catch(err => {
uni.hideLoading();
this.defaultToLocation = {};
this.defaultToLocationCode = ""
this.toLocationCode = ""
this.toLocationArea =""
this.showMessage(err.message);
})
},
clearDefaultLocation() {
this.defaultToLocationCode = ""
this.defaultToLocation = {};
this.toLocationCode = ""
this.toLocationArea =""
},
submit() {
@ -333,7 +331,7 @@
return;
}
if (this.defaultToLocationCode == "") {
if (this.toLocationCode == "") {
this.showMessage('请扫描目标库位');
return;
}
@ -349,8 +347,8 @@
});
let params = this.setSubmitParam();
console.log( JSON.stringify(params) )
customerReturn(params)
console.log("提交"+JSON.stringify(params) )
thirdLocationRequest(params)
.then(res => {
uni.hideLoading();
this.showCommitSuccess();
@ -379,6 +377,9 @@
setSubmitParam() {
let item = {
worker: localStorage.userName_CN == "" ? localStorage.userName : localStorage.userName_CN,
activeDate:getISODateTime(),
useOnTheWayLocation: true,
type: "Transfer_Warehouse",
details: []
}
this.allDataList.forEach(res => {
@ -389,7 +390,11 @@
uom: res.uom,
qty: res.qty,
stdPackQty: res.stdPackQty,
toLocationCode:this.defaultToLocationCode
toLocationCode:this.toLocationCode,
toLocationArea:this.toLocationArea,
fromLocationCode:this.fromLocationCode,
fromLocationArea:this.fromLocationArea,
useOnTheWayLocation: true
}
item.details.push(detail)
})
@ -494,14 +499,28 @@
clearInfo() {
this.allDataList = [];
this.showList = [];
this.defaultToLocation = {};
this.defaultToLocationCode = "";
this.toLocationCode = "";
this.toLocationCodeArea = "";
this.fromLocationCode= ""
this.fromLocationCodeArea= ""
this.allCount = 0;
this.loadingType = ""
this.pageNo = 0
uni.setNavigationBarTitle({
title: "三方库发货"
})
this.updateTitle()
this.$refs.comCollapseLocation.clearLocation();
},
updateTitle(){
if(this.allCount == 0){
uni.setNavigationBarTitle({
title: "三方库发货"
})
}else {
uni.setNavigationBarTitle({
title: "三方库发货"+"("+this.allCount+")"
})
}
},
openScanPopup() {

3
fe/PDA/pages/task/receipt_detail.vue

@ -142,6 +142,7 @@
loadingType: "",
jobContent:{},
jobStatus:""
};
},
onLoad(option) {
@ -222,7 +223,7 @@
that.ispending = that.receiptJob.jobStatus === 2;
if (that.receiptJob.details != null) {
that.jobContent =that.receiptJob;
that.jobStatus = item.jobStatus
that.jobStatus = that.receiptJob.jobStatus
that.allCount = that.receiptJob.details.length;
that.calcScanCount();
this.$nextTick();

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

@ -237,7 +237,7 @@
uni.hideLoading();
if (res != null) {
that.showCommitSuccessMessage();
navigateBack(1);
navigateBack(2);
}
}).catch(err => {
uni.hideLoading();

14
fe/PDA/pages/task/thirdLocation.vue

@ -4,7 +4,7 @@
<win-empty-view v-if="deliverList.length==0"></win-empty-view>
<view hover-class="uni-list-cell-hover" v-for="(item, index) in deliverList" :key="item.id"
@click="openDetail(item)">
<com-deliver :dataContent="item"></com-deliver>
<comThird :dataContent="item"></comThird>
</view>
<uni-load-more :status="loadingType" v-if="deliverList.length>0" />
<!-- <win-scan-button @goScan='openScanPopup'></win-scan-button>
@ -16,8 +16,8 @@
<script>
import {
getDeliverList,
getDeliverJobByNumber
getThirdLocationList,
getThirdLocationJobByNumber
} from '@/api/index.js';
import {
@ -25,7 +25,7 @@
} from '@/common/basic.js';
import winEmptyView from '@/mycomponents/wincom/winEmptyView.vue'
import comDeliver from '@/mycomponents/coms/task/comDeliver.vue';
import comThird from '@/mycomponents/coms/task/comThird.vue';
import winScanButton from '@/mycomponents/wincom/winScanButton.vue'
import winMulitScan from '@/mycomponents/wincom/winMulitScan.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
@ -35,7 +35,7 @@
winEmptyView,
winScanButton,
winMulitScan,
comDeliver,
comThird,
comMessage
},
data() {
@ -126,7 +126,7 @@
// isCreationTimeSorting: that.isTimeWindowSorting,
// isToday: that.isToday
};
getDeliverList(params)
getThirdLocationList(params)
.then(res => {
uni.hideLoading();
if (type === "refresh") {
@ -165,7 +165,7 @@
title: "加载中....",
mask: true
});
getDeliverJobByNumber(code).then(res => {
getThirdLocationJobByNumber(code).then(res => {
uni.hideLoading();
if (res != null) {
that.openDetail(res);

387
fe/PDA/pages/task/thirdLocationDetail.vue

@ -8,103 +8,93 @@
<scroll-view scroll-y="true" @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll"
class="scroll-detail">
<view class="detail-list margin_top" v-for="(item, index) in details" :key="item.id">
<!-- 单选卡片 -->
<view class="detail-content">
<view class="choose_main">
<view class="ljh_box">
<view class="tit_ljh">{{ item.itemCode }}</view>
<view class="ljh_left">
<view class="font_xs text_lightblue">{{ item.itemName }}</view>
<view class="font_xs text_lightblue">{{ item.itemDesc1 }}</view>
<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>
<view class="list_form hold_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">数量</uni-th>
<uni-th width="120" align="center">
<view class="text_black">{{item.recommendQty}}({{item.uom}})</text>
</view>
</uni-th>
<!-- -->
<uni-th width="120" align="center">
<view v-if="item.scaned" class="text_black">
{{item.handledQty}}({{item.uom}})
</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><text class="text_black">{{item.recommendLot }}</text>
</view>
</uni-th>
<uni-th width="120" align="center">
<view v-if="item.scaned">
<text class="text_black">{{item.handledLot }}</text>
</view>
</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="50">库位</uni-th>
<uni-th width="120" align="center">
<view class="text_black">{{ item.recommendLocationCode }}</view>
</uni-th>
<uni-th width="120" align="center">
<view v-if="item.scaned" class="text_black">
{{ item.handledFromLocationCode }}
</view>
</uni-th>
</uni-tr>
</uni-table>
<view class="list_form hold_form">
<view class="uni-container">
<uni-table style="overflow-x: hidden;">
<uni-tr>
<uni-th width="70"></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="70">数量</uni-th>
<uni-th width="120" align="center">
<view class="text_black">{{item.recommendQty}}({{item.uom}})</text>
</view>
</uni-th>
<!-- -->
<uni-th width="120" align="center">
<view class="" v-if="item.scaned">
<com-number-box :ref="'comNumberBox_'+index"
v-model="item.handledQty" :max="99999" :min="0"
@change="qtyChanged($event,item,index)">
</com-number-box>
</view>
<!-- <view v-if="dataContent.scaned" class="text_black">
{{dataContent.handledQty}}({{dataContent.uom}})
</view> -->
</uni-th>
</uni-tr>
<uni-tr>
<uni-th width="70">来源库位</uni-th>
<uni-th width="120" align="center">
<view class="text_black">{{ item.fromLocationCode }}</view>
</uni-th>
<uni-th width="120" align="center">
<view class="">
<button v-if="item.scaned" type="primary" size="mini"
style="margin-left: 30rpx;"
@click="remove(dataContent,index)">移除</button>
</view>
</uni-th>
</uni-tr>
</uni-table>
</view>
</view>
</view>
</view>
<view class="choose_marked" v-if="item.scaned">
<image src="@/static/image_marked.svg"></image>
<view class="choose_marked" v-if="item.scaned">
<image src="@/static/image_marked.svg"></image>
</view>
</view>
</view>
</view>
</scroll-view>
<view class="new_btn_bot count_shadow">
<button type="primary" class="new_save_btn" @click="submit()">提交</button>
</view>
<div class="new_bot_box">
<win-collapse-location scanTitle='扫描目标库位' ref='comCollapseLocation' @getLocationCode='getDefaultToLocation'
@clear='clearDefaultLocation'>
</win-collapse-location>
<view class="new_btn_bot bot_pos uni-flex">
<button class="new_clear_btn btn_double" @click="cancel()">清空</button>
<button class="new_save_btn btn_double" @click="submit()">提交</button>
</view>
</div>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-by-pack ref="scanPopup" @getScanResult='getScanResult'></win-scan-by-pack>
<com-balance ref="balanceItems" @selectedItem='selectedBalanceItem'></com-balance>
<winScanByProductCode ref="scanPackPopup" title="单件码" @getScanResult='getScanResult'></winScanByProductCode>
<comMessage ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'></comMessage>
</view>
</template>
<script>
import {
getDeliverDetail,
takeDeliverJob,
cancelTakeDeliverJob,
finshDeliverJob,
balances
getThirdLocationDetail,
takeThirdLocationJob,
cancelTakeThirdLocationJob,
finshThirdLocationJob,
locations
} from '@/api/index.js';
import {
showConfirmMsg,
@ -116,7 +106,12 @@
import winScanByPack from '@/mycomponents/wincom/winScanByPack.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import comJobScanDetail from '@/mycomponents/comjob/comJobScanDetail.vue'
import comBalance from '@/mycomponents/common/comBalance.vue'
import winCollapseLocation from '@/mycomponents/wincom/winCollapseLocation.vue'
import winScanByProductCode from '@/mycomponents/wincom/winScanByProductCode.vue'
import comNumberBox from '@/mycomponents/common/comNumberBox.vue';
import comProductCode from '@/mycomponents/coms/task/comProductCode.vue';
export default {
components: {
@ -125,14 +120,17 @@
winScanByPack,
comMessage,
comJobScanDetail,
comBalance
winCollapseLocation,
winScanByProductCode,
comNumberBox,
comProductCode
},
data() {
return {
type: '',
id: "",
datacontent: {},
details: {},
details: [],
toLocation: '',
scrollTop: 0,
old: {
@ -143,12 +141,10 @@
titleArray: ['箱标签', '目标库位'],
allCount: 0,
scanCount: 0,
jobStatus:""
jobStatus: "",
toLocationInfo: null
}
},
props: {
itemCode: "",
},
onLoad(param) {
this.id = param.id;
if (param.jobStatus == 1) {
@ -163,7 +159,7 @@
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}else if(e.index === 1){
} else if (e.index === 1) {
window.location.reload();
}
},
@ -173,7 +169,7 @@
if (e.from == 'backbutton') {
if (this.jobStatus == 2) {
//
cancelTakeDeliverJob(this.id).then(res => {
cancelTakeThirdLocationJob(this.id).then(res => {
uni.navigateBack();
}).catch(error => {
uni.navigateBack();
@ -191,8 +187,49 @@
})
},
methods: {
//
getDefaultToLocation(locationCode) {
uni.showLoading({
title: "扫描中",
mask: true
});
locations(locationCode).then(res => {
uni.hideLoading();
if (res) {
this.toLocationInfo = res
} else {
this.showMessage('目标库位【' + locationCode + '】不存在');
}
}).catch(err => {
uni.hideLoading();
this.toLocationInfo = null
this.showMessage(err.message);
})
},
clearDefaultLocation() {
this.toLocationInfo = null
},
remove(item, index) {
showConfirmMsg("是否移除当前【" + item.itemCode + "】扫描信息", res => {
if (res) {
item.scaned = false;
item.handledQty = null;
this.getScanCount()
}
})
},
qtyChanged(value, item, index) {
if (value <= 0) {
this.showMessage('收货货数量必须大于0')
item.qty = item.handledQty
this.$refs['comNumberBox_' + index][0].setValue(item.qty);
}
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
this.$refs.scanPackPopup.openScanPopup();
},
//
getDetail() {
@ -200,13 +237,15 @@
let params = {
id: that.id,
};
getDeliverDetail(params)
getThirdLocationDetail(params)
.then(item => {
console.log('item', item);
that.datacontent = item;
that.jobStatus = item.jobStatus
that.details = item.details;
that.details.forEach(r => r.scaned = false);
that.details.forEach(res => {
res.scaned = false;
})
that.ispending = item.jobStatus === 2;
that.allCount = item.details.length;
// that.toLocation = item.details[0].recommendLocationCode;
@ -217,92 +256,28 @@
},
//
getScanResult(result) {
let that = this;
let code = result.data.code;
let item = this.details.find(r => {
return r.recommendPackingCode === code
return r.itemCode == result.itemCode
});
if (item === undefined) {
this.showMessage('在发货任务详情中,未找到箱码【' + code + '】');
this.showMessage('在任务详情中,未找到物料号【' + result.itemCode + '】');
return;
} else {
if (item.scaned) {
this.showMessage('箱码【' + code + '】已经扫描,请扫描下一箱零件');
this.showMessage('物料号【' + result.itemCode + '】已经扫描,请扫描下一箱零件');
return;
} else {
item.scaned = true;
item.handledQty = item.recommendQty;
this.getScanCount()
setTimeout(res => {
this.$forceUpdate()
}, 1000)
}
}
//
let params = {
pageSize: 1000,
pageIndex: 1,
packingCode: code,
locationTypes: [4], //
inventoryStatuses: [2], //
};
balances(params)
.then(res => {
try {
if (res.totalCount == 0) {
this.showMessage('箱码【' + code + '】在【成品库】未查询到库存信息');
} else if (res.totalCount == 1) {
that.balancesItem = res.items[0];
this.createItem(item);
} else {
this.$refs.balanceItems.openPopup(res.items);
}
uni.hideLoading();
} catch (e) {
this.showMessage(e.message)
}
})
.catch(err => {
this.showMessage(err.message)
});
},
createItem(item) {
let that = this;
if (that.balancesItem != null || that.balancesItem != undefined) {
// if (that.balancesItem.qty != item.recommendQty) {
// this.showMessage('' + that.balancesItem.qty + '' + item.recommendQty + ',')
// } else {
item.scaned = true;
item.handledContainerCode = that.balancesItem.containerCode;
item.handledPackingCode = that.balancesItem.packingCode;
item.handledBatch = that.balancesItem.batch;
item.handledLot = that.balancesItem.lot;
item.handledFromLocationArea = that.balancesItem.locationCode;
item.handledQty = that.balancesItem.qty;
// ==================================
// item.recommendFromLocationCode = string;
// item.recommendFromLocationArea = string;
// item.recommendFromLocationGroup = string;
// item.recommendFromLocationErpCode = string;
// item.recommendFromWarehouseCode = string;
// item.uom = string;
// item.recommendQty = 0;
// item.handledFromLocationCode = string;
// item.handledFromLocationArea = string;
// item.handledFromLocationGroup = string;
// item.handledFromLocationErpCode = string;
// item.handledFromWarehouseCode = string;
// item.handledQty = that.balancesItem.qty;
// item.toLocationCode = string;
// item.toLocationArea = string;
// item.toLocationGroup = string;
// item.toLocationErpCode = string;
// item.toWarehouseCode = string;
// item.onTheWayLocationCode = string;
this.getScanCount();
this.closeScanPopup();
that.$forceUpdate();
// }
}
},
@ -316,17 +291,22 @@
}
},
selectedBalanceItem(balanceItem) {
that.balancesItem = balanceItem;
this.createItem(item);
cancel() {
showConfirmMsg("是否清除已经扫描的数据?", res => {
if (res) {
this.getDetail();
}
})
},
//
receive(callback) {
let params = {
id: this.id
};
takeDeliverJob(params)
takeThirdLocationJob(params)
.then(res => {
callback(true);
})
@ -339,41 +319,61 @@
submit() {
let that = this;
if (that.datacontent.details.length === 0) {
this.showMessage('该任务没有要货的零件');
this.showMessage('该任务没有要货的零件');
return;
}
let items = that.datacontent.details.filter(r => r.scaned);
if (items.length === 0) {
this.showMessage('请扫描要货的零件');
this.showMessage('请扫描要货的零件');
return;
} else if (items.length < that.datacontent.details.length) {
this.showMessage('还有未扫描的零件,不可以货');
this.showMessage('还有未扫描的零件,不可以收货货');
return;
} else {
if (this.toLocationInfo == null) {
this.showMessage('请扫描目标库位');
return;
}
that.finsh();
}
},
finsh() {
let that = this;
uni.showLoading({
title: "提交中..."
});
this.setParams();
let params = JSON.stringify(this.datacontent);
console.log("提交", params);
finshThirdLocationJob(this.id, params)
.then(res => {
uni.hideLoading();
if (res != null) {
this.showCommitSuccessMessage();
}
})
.catch(err => {
this.showMessage(err.message);
uni.hideLoading();
});
},
setParams() {
this.datacontent.details.forEach(res => {
// res.handledFromLocationCode = res.recommendFromLocationCode;
// res.handledFromLocationArea = res.recommendFromLocationArea;
// res.handledFromLocationGroup = res.recommendFromLocationGroup;
// res.handledFromLocationErpCode = res.recommendFromLocationErpCode
// res.handledFromWarehouseCode = res.recommendFromWarehouseCode;
res.toLocationCode = this.toLocationInfo.code;
res.toLocationArea = this.toLocationInfo.areaCode;
// res.toLocationGroup = this.toLocationInfo.locationGroupCode;
// res.toLocationErpCode = this.toLocationInfo.erpLocationCode;
})
let params = JSON.stringify(that.datacontent);
console.log(params);
// finshDeliverJob(that.id, params)
// .then(res => {
// uni.hideLoading();
// if (res != null) {
// that.showCommitSuccessMessage();
// navigateBack(1);
// }
// })
// .catch(err => {
// this.showMessage(err.message);
// uni.hideLoading();
// });
},
showCommitSuccessMessage() {
@ -385,11 +385,6 @@
uni.hideLoading();
},
closeScanPopup() {
if (this.allCount == this.scanCount) {
this.$refs.scanPopup.closeScanPopup();
}
},
clearScanLocation() {
// this.$refs.scanLocation.getfocus();

Loading…
Cancel
Save