niexiting 1 year ago
parent
commit
f8df179714
  1. 1
      .gitignore
  2. 14
      api/httpRequest3.js
  3. 6
      api/request2.js
  4. 2
      mycomponents/scan/winScanPackAndLocation.vue
  5. 210
      mycomponents/scan/winScanPackAndPosition.vue
  6. 7
      pages/deliver/coms/comScanDeliverPack.vue
  7. 56
      pages/deliver/job/deliverDetail.vue
  8. 3
      pages/productionReturn/coms/comReturn.vue
  9. 148
      pages/productionReturn/coms/comReturnDetailCard.vue
  10. 2
      pages/productionReturn/coms/comReturnRecord.vue
  11. 68
      pages/productionReturn/coms/returnDetailInfoPopup.vue
  12. 51
      pages/productionReturn/job/returnDetail.vue
  13. 480
      pages/productionReturn/record/returnToStore.vue
  14. 28
      pages/repleinsh/job/repleinshDetail.vue
  15. 13
      pages/scrap/record/scrapRecord.vue
  16. 2
      pages/unPlanned/job/receiptJobDetail.vue
  17. 28
      pages/unPlanned/record/issueRecord.vue

1
.gitignore

@ -2,3 +2,4 @@
/node_modules
/unpackage
/static/config.json

14
api/httpRequest3.js

@ -27,27 +27,27 @@ function service(options = {}) {
if(res.data.code==0){
resolve(res.data);
}else {
reject( res.data.msg)
reject("系统:"+res.data.msg)
}
}else {
reject( res.data.msg)
reject("系统:"+ res.data.msg)
}
} else {
reject(res.data.msg)
reject("系统:"+res.data.msg)
}
};
options.fail = (error) => {
var message = error.errMsg
if (message === 'Network Error') {
message = '后端接口连接异常'
message = '接口连接异常'
} else if (message.includes('timeout')) {
message = '系统接口请求超时'
message = '接口请求超时'
} else if (message.includes('Request failed with status code')) {
message = '系统接口' + message.substr(message.length - 3) + '异常'
message = '接口' + message.substr(message.length - 3) + '异常'
}
reject(message);
reject("系统:"+message);
};
uni.request(options);
});

6
api/request2.js

@ -1394,7 +1394,7 @@ export function unPlannedReceiptRequestHandle(id) {
* 计划外入库记录 提交
* @param {*} params
*/
export function unPlannedReceiptRecordbSubmit(id, params) {
export function unPlannedReceiptRecordbSubmit(params) {
return request({
url: baseApi + "/wms/unplannedreceipt-record-main/create",
method: "post",
@ -1549,8 +1549,8 @@ export function unPlannedIssueRequestHandle(id) {
*/
export function unPlannedIssueRecordSubmit(params) {
return request({
url: baseApi + "/magic-api/pda/job/purchasereturn/jobSubmit",
method: "put",
url: baseApi + "/wms/unplannedissue-record-main/create",
method: "post",
data: params,
});
}

2
mycomponents/scan/winScanPackAndLocation.vue

@ -98,7 +98,7 @@
},
headerType: {
type: String,
default: "HPQ"
default: "HPQ,HMQ"
},
},
data() {

210
mycomponents/scan/winScanPackAndPosition.vue

@ -0,0 +1,210 @@
<template>
<view>
<uni-popup ref="popup" @change="change" @maskClick="closeScanPopup()">
<view class="popup_box">
<view class="pop_title uni-flex space-between">
<view class="" style="font-size: 35rpx;">
扫描{{title}}
</view>
<view class="">
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg"
@click="closeScanPopup()"></image>
</view>
</view>
<view class="uni-flex uni-row" style="align-items: center;
background-color: #fff;
margin-left: 20rpx;
margin-right: 20rpx;
border-radius: 8rpx;
height: 30px;">
<view class="uni-center" style="width: 25%; ">
位置
</view>
<view class="" style="width: 75%;padding: 8rpx">
<view class="uni-flex u-col-center uni-row" @click="showSelect">
<view class="" style="margin-left: 20rpx;">
{{positionInfo}}
</view>
<u-select v-model="show" mode="mutil-column-auto" :list="positionList"
@confirm="confirmSelect"></u-select>
</view>
</view>
</view>
<view class="">
<view class="">
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult" :headerType="headerType"
:isShowHistory="isShowHistory" :clearResult="true"></win-com-scan>
</view>
</view>
</view>
</uni-popup>
</view>
<com-message ref="comMessage" @afterClose="getfocus"></com-message>
</template>
<script>
import winComScan from '@/mycomponents/scan/winComScan.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import {
getWorkShopLineStation
} from '@/api/request2.js';
export default {
name: 'winScanPack',
emits: ["getResult", "close"],
components: {
winComScan,
comMessage,
},
props: {
title: {
type: String,
default: '箱标签'
},
isShowHistory: {
type: Boolean,
default: true
},
headerType:{
type: String,
default: 'HPQ,HMQ'
}
},
data() {
return {
show: false,
positionInfo: "请选择位置",
positionList: [],
productionLineCode: '',
rawLocationCode: "",
fgLocationCode: "",
workshopCode: "",
workStationCode: "",
workShopName: "",
productionLineName: "",
workStationName: "",
isEditPosition:true
}
},
created() {
},
methods: {
openScanPopup() {
if(this.positionList.length==0){
uni.showLoading({
title: "数据加载中....",
mask: true
});
getWorkShopLineStation().then(res => {
uni.hideLoading()
this.positionList = res.data
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
}
this.$refs.popup.open('bottom');
},
closeScanPopup() {
this.$refs.popup.close();
this.$emit("close", '');
},
scanClick() {
this.$refs.comscan.clickScanMsg();
},
cancelClick() {
this.$refs.comscan.clearScanValue();
},
getScanResult(result) {
if(this.positionInfo=="请选择位置"){
this.showErrorMessage("请先选择位置")
return
}
var param = {
positionInfo:this.positionInfo,
workshopCode:this.workshopCode,
productionLineCode:this.productionLineCode,
workStationCode:this.workStationCode
}
if (result.success) {
this.isEditPosition = false
this.$emit("getResult", result,param);
} else {
this.showErrorMessage(result.message)
}
},
getfocus() {
if (this.$refs.comscan != undefined) {
this.$refs.comscan.getfocus();
}
},
losefocus() {
if (this.$refs.comscan != undefined) {
this.$refs.comscan.losefocus();
}
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
showSelect() {
if(this.isEditPosition){
this.show = !this.show
}
},
confirmSelect(e) {
this.positionInfo = e[0].label + "-" + e[1].label + "-" + e[2].label
console.log("位置", this.positionInfo)
this.workshopCode = e[0].value
this.productionLineCode = e[1].value
this.workStationCode = e[2].value
this.workShopName = e[0].label
this.productionLineName = e[1].label
this.workStationName = e[2].label
let shop = this.positionList.find(shop => shop.value == this.workshopCode);
if (shop != undefined && shop.children != undefined) {
let prodLine = shop.children.find(line => line.value == this.productionLineCode);
if (prodLine != undefined && prodLine.children != undefined) {
let station = prodLine.children.find(r => r.value == this.workStationCode);
if (station.rawLocationCode == '' && station.rawLocationCode == null) {
this.showErrorMessage(this.workStationName + "的原材料库位为空,请重新选择")
return;
} else {
this.rawLocationCode = station.rawLocationCode;
this.fgLocationCode = station.fgLocationCode;
}
} else {
this.showErrorMessage("生产线-工位基础信息维护错误")
}
} else {
this.showErrorMessage("车间-生产线基础信息维护错误")
}
},
}
}
</script>
<style lang="scss">
.scroll-view {
overflow-y: scroll;
height: auto;
max-height: 300rpx;
}
</style>

7
pages/deliver/coms/comScanDeliverPack.vue

@ -45,7 +45,7 @@
<view class="">
<view class="">
<win-com-scan ref="comscan" placeholder="箱标签" @getResult="onScan" :clearResult="true"
<win-com-scan ref="comscan" placeholder="箱标签" @getResult="onScan" :clearResult="true" :headerType="headerType"
:isShowHistory="false">
</win-com-scan>
@ -124,6 +124,11 @@
type: String,
default: ''
},
headerType: {
type: String,
default: "HPQ,HMQ"
},
},
data() {

56
pages/deliver/job/deliverDetail.vue

@ -1,30 +1,31 @@
<template>
<view class="page-wraper">
<view class="page-header">
<view class="header_job_top">
<job-top :dataContent="jobContent" ></job-top>
</view>
<view class="header_item" >
申请单号{{jobContent.requestNumber}}
</view>
<u-line color="#D8D8D8" style="margin-bottom: 15rpx;margin-top: 10rpx;"></u-line>
<view class="cen_card" style="padding: 5rpx;">
<view class="cell_box uni-flex uni-row">
<view class="cell_info">
<view class="text_lightblue">客户代码</view>
<view>{{jobContent.customerCode}}</view>
</view>
<view class="cell_info">
<view class="text_lightblue">客户寄售库</view>
<view>{{toLocationCode}}</view>
</view>
</view>
<u-line />
</view>
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="">
<view v-for="(toLocation, index) in detailSource">
<view class="cen_card" style="padding: 20rpx;">
<view class="cell_box uni-flex uni-row">
<view class="cell_info">
<view class="text_lightblue">客户代码</view>
<view>{{jobContent.customerCode}}</view>
</view>
<!-- <view class="cell_info">
<view class="text_lightblue">生产线</view>
<view>{{toLocation.productionLineCode}}</view>
</view>
<view class="cell_info">
<view class="text_lightblue">工位</view>
<view>{{ toLocation.workStationCode }}</view>
</view> -->
<view class="cell_info">
<view class="text_lightblue">客户寄售库</view>
<view>{{ toLocation.toLocationCode}}</view>
</view>
</view>
<u-line />
</view>
<comDeliverDetailCard ref='comIssueDetailCard' :dataContent="toLocation" @updateData='updateData'>
</comDeliverDetailCard>
</view>
@ -78,7 +79,8 @@
import comDeliverDetailCard from '@/pages/deliver/coms/comDeliverDetailCard.vue'
import comScanDeliverPack from '@/pages/deliver/coms/comScanDeliverPack.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
export default {
name: 'issueDetail',
components: {
@ -86,7 +88,8 @@
winScanButton,
comDeliverDetailCard,
comScanDeliverPack,
comMessage
comMessage,
jobTop
},
data() {
return {
@ -97,7 +100,8 @@
detailOptions: [],
scanOptions: [],
status:"",
received :false
received :false,
toLocationCode:""
};
},
@ -164,8 +168,8 @@
that.jobContent = res.data;
that.subList = res.data.subList;
that.detailSource = getDataSource(that.detailSource, that.subList)
that.toLocationCode =that.subList[0].toLocationCode
that.resizeCollapse();
uni.hideLoading();
} else {
that.showMessage('列表数据为0');
}

3
pages/productionReturn/coms/comReturn.vue

@ -107,7 +107,6 @@
data() {
return {
id: '',
scanCount: 0,
dataContent: {}, //
subList: [], //subList
detailSource: [], //
@ -297,7 +296,7 @@
productionReturnRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成制品收货记录<br>" + res.data)
this.showCommitSuccessMessage("提交成功<br>生成退料收货记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}

148
pages/productionReturn/coms/comReturnDetailCard.vue

@ -0,0 +1,148 @@
<template>
<view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty"></itemCompareQty>
</template>
<u-line />
<view class="" v-for="(item,index) in dataContent.subList">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions">
<recommend :detail="item" :isShowLocation="false" :isShowFromLocation="false" :isShowToLocation="settingParam.allowModifyLocation=='TRUE'"></recommend>
</uni-swipe-action-item>
</uni-swipe-action>
<u-line color="#D8D8D8"></u-line>
</view>
</uni-collapse-item>
</uni-collapse>
<recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam"
@confirm="confirm">
</recommend-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
:locationTypeList="locationTypeList"></win-scan-location>
<returnDetailInfoPopup ref="jobDetailPopup" :dataContent="showItem"></returnDetailInfoPopup>
<com-message ref="message"></com-message>
</view>
</template>
<script>
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
import jobDetailPopup from '@/mycomponents/detail/jobDetailPopup.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import returnDetailInfoPopup from '@/pages/productionReturn/coms/returnDetailInfoPopup.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import {
getDetailOption,
getPurchaseReceiptOption
} from '@/common/array.js';
export default {
components: {
itemCompareQty,
recommend,
recommendQtyEdit,
jobDetailPopup,
returnDetailInfoPopup,
comMessage,
winScanLocation
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
locationTypeList: {
type: Object,
default: {}
},
},
watch: {
},
data() {
return {
showItem: {},
editItem: {
record: {
}
},
locatonItem:{},
detailOptions: [],
scanOptions: []
}
},
mounted() {
if (this.detailOptions.length == 0) {
this.detailOptions = getDetailOption();
}
if (this.scanOptions.length == 0) {
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty,this.settingParam.allowModifyLocation)
}
},
methods: {
swipeClick(e, item) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "库位") {
this.showLocation(item)
} else if (e.content.text == "移除") {
this.remove(item)
}
},
edit(item) {
this.editItem = item;
this.$refs.receiptEdit.openTaskEditPopup(item.qty, item.handleQty,item.labelQty);
},
showLocation(item) {
this.locatonItem =item;
this.$refs.scanLocationCode.openScanPopup();
},
//
getLocation(location, code) {
this.locatonItem.toLocationCode =code;
this.$emit('updateData')
},
detail(item) {
this.showItem = item;
this.$refs.jobDetailPopup.openPopup(item)
},
remove(item) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false
item.handleQty = null
this.$forceUpdate()
this.$emit('remove', item)
}
});
},
confirm(qty) {
this.editItem.handleQty = qty;
this.$emit('updateData')
}
}
}
</script>
<style>
</style>

2
pages/productionReturn/coms/comReturnRecord.vue

@ -17,7 +17,7 @@
<uni-swipe-action-item @click="swipeClick($event,item,index)"
:right-options="item.scaned?scanOptions:detailOptions">
<balance :dataContent="item" :isShowStdPack="false" :isShowStatus="true"
:isShowPack="true" :isShowLocation="false"></balance>
:isShowPack="true" :isShowLocation="false" :isShowToLocation="true"></balance>
<!-- <production-label :dataContent="item" :packageContent="item.package"
:isShowLocation="false">
</production-label> -->

68
pages/productionReturn/coms/returnDetailInfoPopup.vue

@ -0,0 +1,68 @@
<template>
<view class="">
<uni-popup ref="popup">
<detail-common-info :dataContent="dataContent" @onClose="closePopup">
<view class="">
<view class="uni-flex uni-column">
<view class="item">
<text class="item_title">标包数量 : </text>
<text class="text_wrap">{{dataContent.stdPackQty}} </text>
</view>
<view class="item">
<text class="item_title">标包单位 : </text>
<text class="text_wrap">{{getStdPackUnitInfo(dataContent.stdPackUnit)}} </text>
</view>
</view>
</view>
<u-line></u-line>
</detail-common-info>
</uni-popup>
</view>
</template>
<script>
import {getStdPackUnitInfo} from "@/common/directory.js"
import {
dateFormat
} from '@/common/basic.js';
import detailCommonInfo from '@/mycomponents/detail/detailCommonInfo.vue'
export default {
components: {
detailCommonInfo
},
data() {
return {
dataContent: {
type: Object,
default: {}
}
}
},
mounted() {},
props: {},
methods: {
openPopup(val) {
this.dataContent = val;
this.$refs.popup.open('bottom')
},
closePopup() {
this.$refs.popup.close()
},
getStdPackUnitInfo(value){
return getStdPackUnitInfo(value).label
},
dateFormat(value){
return dateFormat(value)
}
}
}
</script>
<style>
</style>

51
pages/productionReturn/job/returnDetail.vue

@ -7,17 +7,37 @@
<view class="header_item">
申请单号 : {{jobContent.requestNumber}}
</view>
<u-line color="#D8D8D8" style="margin-bottom: 15rpx;margin-top: 10rpx;"></u-line>
</view>
<view class="cen_card" style="margin-top: 10rpx;">
<view class="cell_box uni-flex uni-row" style="margin-top: 10rpx;">
<view class="cell_info">
<view class="text_lightblue">车间</view>
<view>{{jobContent.workshopCode}}</view>
</view>
<view class="cell_info">
<view class="text_lightblue">生产线</view>
<view>{{titleInfo.productionLineCode}}</view>
</view>
<view class="cell_info">
<view class="text_lightblue">工位</view>
<view>{{ titleInfo.workStationCode }}</view>
</view>
<view class="cell_info">
<view class="text_lightblue">原材料库</view>
<view>{{ titleInfo.toLocationCode}}</view>
</view>
</view>
</view>
<u-line color="#D8D8D8" style="margin-bottom: 0rpx;margin-top: 10rpx;"></u-line>
</view>
<u-line color="#D8D8D8" style="margin-bottom: 15rpx;margin-top: 10rpx;"></u-line>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<com-detail-card :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" @openDetail="openDetail"
:locationTypeList='tolocationTypeList'>
</com-detail-card>
<comReturnDetailCard :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" :locationTypeList='toLocationTypeList'>
</comReturnDetailCard>
</view>
<u-line />
</view>
@ -29,8 +49,8 @@
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<requiredLocation title="目标库位" :locationCode="toLocationCode"
:isShowEdit="jobContent.allowModifyLocation==1" @getLocation='scanLocationCode'
:locationTypeList="tolocationTypeList"></requiredLocation>
:isShowEdit="jobContent.allowModifyLocation=='TRUE'" @getLocation='scanLocationCode'
:locationTypeList="toLocationTypeList"></requiredLocation>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
@ -78,7 +98,7 @@
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue"
import comReturnDetailCard from "@/pages/productionReturn/coms/comReturnDetailCard.vue"
import detailInfoPopup from '@/pages/productionReturn/coms/detailInfoPopup.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
@ -91,7 +111,7 @@
requiredLocation,
// winScanPackAndLocation,
winScanPack,
comDetailCard,
comReturnDetailCard,
detailInfoPopup,
comMessage,
jobTop
@ -109,9 +129,10 @@
detailSource: [], //
fromLocationCode: '',
toLocationCode: '',
tolocationTypeList: [],
toLocationTypeList: [],
toLocationInfo: {},
businessTypeInfo: {}
businessTypeInfo: {},
titleInfo: ""
};
},
onLoad(option) {
@ -192,6 +213,7 @@
that.fromLocationCode = that.subList[0].fromLocationCode
that.toLocationCode = that.subList[0].toLocationCode
that.tolocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes)
that.titleInfo = that.subList[0];
} else {
that.showMessage('列表数据为0');
}
@ -278,11 +300,12 @@
} else {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.package.qty)
itemDetail.inventoryStatus = "OK"
itemDetail.stdPackQty = result.package.stdPackQty
itemDetail.stdPackUnit = result.package.stdPackUnit
this.calcHandleQty();
//退,退000000 --nxt
// let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
// let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);

480
pages/productionReturn/record/returnToStore.vue

@ -1,29 +1,497 @@
<template>
<view class="page-wraper">
<comReturn businessTypeCode="ReturnToStore" > </comReturn>
<view class="">
<com-blank-view @goScan='openScanPopup' v-if="detailSource.length==0"></com-blank-view>
</view>
<view class="page-wraper" v-if="detailSource.length>0">
<view class="">
<view class="uni-flex uni-row u-col-center" style="margin: 10rpx;">
<text style="font-size: 32rpx;margin-left: 20rpx;">位置 : </text>
<view class="uni-flex u-col-center uni-row">
<view class="" style="margin-left: 20rpx;font-size: 30rpx;">
{{positionInfo}}
</view>
</view>
</view>
<u-line />
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<comReturnRecord :dataContent="item" :index="index"
@removeItem="removeItem(index,item)" @updateData="updateData" @removePack="removePack">
</comReturnRecord>
</view>
<u-line />
</view>
</scroll-view>
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<winScanPackAndPosition ref="scanPopup" @getResult='getScanResult'></winScanPackAndPosition>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import comReturn from '@/pages/productionReturn/coms/comReturn.vue'
import {
productionReturnRecordSubmit,
getWorkShopLineStation
} from '@/api/request2.js';
import {
goHome,
getPackingNumberAndBatchByList
} from '@/common/basic.js';
import {
getDirectoryItemArray
} from '@/common/directory.js';
import {
getBusinessType,
createItemInfo,
createDetailInfo,
calcHandleQty
} from '@/common/record.js';
import {
getPrecisionStrategyList
} from '@/common/balance.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comReturnRecord from '@/pages/productionReturn/coms/comReturnRecord.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import winScanPackAndPosition from "@/mycomponents/scan/winScanPackAndPosition.vue"
export default {
name: 'comReturn',
components: {
comReturn
winScanButton,
// comReturnRecord,
requiredLocation,
comBlankView,
comMessage,
comReturnRecord,
winScanPack,
winScanPackAndPosition
},
data() {
watch: {},
data() {
return {
id: '',
dataContent: {}, //
subList: [], //subList
detailSource: [], //
fromLocationCode: '',
fromLocationTypeList: [],
toLocationCode: '',
tolocationTypeList: [],
businessType: {},
inventoryStatus: '',
managementList: [],
show: false,
positionList: [],
productionLineCode: '',
rawLocationCode: "",
fgLocationCode: "",
workshopCode: "",
workStationCode: "",
workShopName: "",
productionLineName: "",
workStationName: "",
businessTypeCode :"ReturnToStore",
positionInfo:""
};
},
onLoad() {
getBusinessType(this.businessTypeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.fromlocationTypeList = res.fromlocationTypeList;
this.tolocationTypeList = res.tolocationTypeList;
this.openScanPopup();
} else {
this.showErrorMessage(res.message)
}
});
},
mounted() {
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
//
onBackPress(e) {},
onLoad(option) {
onPullDownRefresh() {
uni.stopPullDownRefresh();
},
methods: {
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
getScanResult(result,param) {
this.positionInfo = param.positionInfo;
this.workshopCode = param.workshopCode;
this.productionLineCode = param.productionLineCode;
this.workStationCode = param.workStationCode ;
let label = result.label;
let pack = result.package;
var item = this.detailSource.find(res => {
if (res.itemCode == label.itemCode) {
return res
}
})
if (item == undefined) {
var itemp = this.createItemInfo(label, pack);
let newDetail = this.createDetailInfo(label, pack);
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
} else {
var detail = item.subList.find(r => {
if (r.packingNumber == label.packingNumber &&
r.batch == label.batch) {
return r;
}
})
if (detail == undefined) {
let newDetail = this.createDetailInfo(label, pack);
item.subList.push(newDetail);
} else {
if (detail.scaned == true) {
this.showErrorMessage("箱码[" + label.packingNumber + "批次[" + label.batch + "]已经在列表中")
}
}
}
this.calcHandleQty();
},
createItemInfo(label, pack) {
let item = {
itemCode: label.itemCode,
itemName: pack.itemName,
stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit,
qty: Number(label.qty),
handleQty: 0,
uom: pack.uom,
subList: []
}
return item;
},
createDetailInfo(label, pack) {
let detail = {};
Object.assign(detail, label)
detail.scaned = true;
detail.qty = Number(label.qty);
detail.inventoryStatus = "OK"
detail.stdPackQty = pack.stdPackQty;
detail.stdPackUnit = pack.stdPackUnit;
detail.package = pack;
detail.label = label;
return detail;
},
calcHandleQty() {
for (let item of this.detailSource) {
item.qty = 0;
for (let detail of item.subList) {
if (detail != undefined) {
item.qty += Number(detail.qty)
}
}
}
this.scanPopupGetFocus();
this.$forceUpdate();
},
removeItem(index, item) {
this.detailSource.splice(index, 1)
},
removePack() {
for (var i = 0; i < this.detailSource.length; i++) {
var item = this.detailSource[i];
if (item.subList.length == 0) {
this.detailSource.splice(i, 1)
}
}
this.updateData();
},
showSelect() {
this.show = !this.show
},
updateData() {
this.calcHandleQty();
},
removeData(item) {
for (let i = 0; i < this.detailSource.length; i++) {
if (this.detailSource[i].itemCode == item.itemCode) {
this.detailSource.splice(i, 1)
}
}
},
commit() {
if (this.positionInfo == "请选择位置") {
this.showMessage("请先选择位置")
return;
}
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
//
uni.showLoading({
title: "提交中....",
mask: true
});
this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams()
getPrecisionStrategyList(precisionStrategParams, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
productionReturnRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成退料收货记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
})
} else {
this.showErrorMessage("没有要提交的数据,请先扫描")
}
},
setPrecisionStrategParams() {
var itemList = []
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.toLocationCode = this.fgLocationCode;
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode &&
detail.toLocationCode == res.locationCode) {
return res
}
})
//
if (filterResult.length == 0) {
var result = {
itemCode: item.itemCode,
locationCode: detail.toLocationCode
}
itemList.push(result)
}
}
})
})
return itemList;
},
setParams() {
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
detail.packingNumber, detail.toLocationCode, detail.batch);
detail.itemCode = detail.itemCode;
detail.itemName = detail.package.itemName;
detail.itemDesc1 = detail.package.itemDesc1;
detail.itemDesc2 = detail.package.itemDesc2;
detail.inventoryStatus = detail.inventoryStatus;
detail.fromPackingNumber = info.packingNumber;
detail.toPackingNumber = info.packingNumber;
detail.fromContainerNumber = detail.containerNumber;
detail.toContainerNumber = detail.containerNumber
detail.fromBatch = info.batch;
detail.toBatch = info.batch;
detail.fromLocationCode = detail.locationCode;
detail.toLocationCode = detail.toLocationCode;
detail.productionlineCode = this.productionLineCode;
detail.workStationCode = this.workStationCode;
subList.push(detail)
}
})
})
this.dataContent.subList = subList;
this.dataContent.creator = creator;
this.dataContent.workshopCode = this.workshopCode;
this.dataContent.businessType = this.businessTypeCode;
return this.dataContent;
},
showMessage(message) {
this.scanPopupLoseFocus();
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
showErrorMessage(message) {
this.scanPopupLoseFocus();
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
scanPopupGetFocus() {
this.$refs.scanPopup.getfocus();
},
scanPopupLoseFocus() {
this.$refs.scanPopup.losefocus();
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.subList = [];
this.detailSource = [];
this.toLocationCode = '';
this.dataContent = {};
this.positionInfo = "请选择位置";
this.fgLocationCode = ""
})
},
confirmSelect(e) {
this.positionInfo = e[0].label + "-" + e[1].label + "-" + e[2].label
console.log("位置", this.positionInfo)
this.workshopCode = e[0].value
this.productionLineCode = e[1].value
this.workStationCode = e[2].value
this.workShopName = e[0].label
this.productionLineName = e[1].label
this.workStationName = e[2].label
let shop = this.positionList.find(shop => shop.value == this.workshopCode);
if (shop != undefined && shop.children != undefined) {
let prodLine = shop.children.find(line => line.value == this.productionLineCode);
if (prodLine != undefined && prodLine.children != undefined) {
let station = prodLine.children.find(r => r.value == this.workStationCode);
if (station.rawLocationCode == '' && station.rawLocationCode == null) {
this.showErrorMessage(this.workStationName + "的原材料库位为空,请重新选择")
return;
} else {
this.rawLocationCode = station.rawLocationCode;
this.fgLocationCode = station.fgLocationCode;
}
} else {
this.showErrorMessage("生产线-工位基础信息维护错误")
}
} else {
this.showErrorMessage("车间-生产线基础信息维护错误")
}
},
}
}
</script>
<style>
<style scoped lang="scss">
page {
width: 100%;
height: 100%;
background-color: #fff;
}
.page-wraper {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
}
.page-main {
flex: 1;
position: relative;
}
.page-main-scroll {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
.page-main-list {
/* height: 80rpx;
line-height: 80rpx; */
text-align: center;
background: #e0e0e0;
}
</style>

28
pages/repleinsh/job/repleinshDetail.vue

@ -57,7 +57,7 @@
getDirectoryItemArray,
getPackingNumberAndBatch,
} from '@/common/basic.js';
import {
getDataSource
} from '@/pages/issue/js/issue.js';
@ -173,7 +173,6 @@
that.tolocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes)
that.detailSource = getDataSource(that.detailSource, that.subList)
that.resizeCollapse();
uni.hideLoading();
} else {
that.showMessage('列表数据为0');
}
@ -198,6 +197,11 @@
submit() {
var scanCount= this.getScanCount(this.subList);
if(scanCount==0){
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
uni.showLoading({
title: "提交中....",
mask: true
@ -236,7 +240,7 @@
repleinshJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成补料记录" + res.data)
this.showCommitSuccessMessage("提交成功<br>生成补料记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
@ -431,6 +435,24 @@
})
},
getScanCount(subList){
var scanCount = 0;
this.detailSource.forEach(toLocationCode => {
toLocationCode.Items.forEach(item => {
item.Locations.forEach(fromLocation => {
fromLocation.Batchs.forEach(batch => {
let subItem = batch.detail;
if (batch.Records.length > 0) {
scanCount+=batch.Records.length
}
})
})
})
})
return scanCount;
}
}
};
</script>

13
pages/scrap/record/scrapRecord.vue

@ -119,7 +119,7 @@
this.tolocationTypeList = res.tolocationTypeList;
this.showFromLocationPopup();
} else {
this.$refs.comMessage.showBreakMessage(res.message );
this.showErrorMessage(res.message)
}
});
@ -250,11 +250,12 @@
title: "提交中....",
mask: true
});
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
scrapRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成报废出库记录" + res.data)
this.showCommitSuccessMessage("提交成功<br>生成报废出库记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
@ -267,6 +268,7 @@
setParams() {
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
@ -294,7 +296,10 @@
}
})
})
return subList;
this.dataContent.subList =subList
this.dataContent.creator = creator;
return this.dataContent;
},

2
pages/unPlanned/job/receiptJobDetail.vue

@ -87,7 +87,6 @@
data() {
return {
id: '',
receiptJob: {},
received: false,
scanCount: 0,
jobContent: {}, //
@ -231,6 +230,7 @@
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.label.qty);
itemDetail.toLocationCode = this.toLocationCode;
itemDetail.stdPackQty = result.package.stdPackQty
itemDetail.labelQty = Number(result.label.qty);
calcHandleQty(this.detailSource);
this.continueScan()

28
pages/unPlanned/record/issueRecord.vue

@ -218,21 +218,22 @@
}
var params =this.setParams()
console.log("提交" + JSON.stringify(params))
// unPlannedIssueRecordSubmit(params).then(res => {
// uni.hideLoading()
// if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data, )
// } else {
// this.showErrorMessage("[" + res.msg + "]")
// }
// }).catch(error => {
// uni.hideLoading()
// this.showErrorMessage(error)
// })
unPlannedIssueRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成采购收货记录<br>" + res.data )
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
setParams() {
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
@ -260,7 +261,10 @@
}
})
})
return subList;
this.dataContent.subList = subList;
this.dataContent.creator = creator;
return this.dataContent;
},
reasonChange(e) {

Loading…
Cancel
Save