niexiting 11 months ago
parent
commit
036fc04b50
  1. 4
      api/request2.js
  2. 9
      common/label.js
  3. 11
      mycomponents/qty/recommendQtyEdit.vue
  4. 1
      mycomponents/scan/winComScan.vue
  5. 10
      pages.json
  6. 81
      pages/inventoryMove/coms/comMove.vue
  7. 10
      pages/inventoryMove/coms/comMoveJob.vue
  8. 4
      pages/inventoryMove/coms/comMovebalance.vue
  9. 2
      pages/inventoryMove/record/holdToOkRecord.vue
  10. 2
      pages/inventoryMove/record/holdToScrapRecord.vue
  11. 2
      pages/inventoryMove/record/okToHoldRecord.vue
  12. 2
      pages/inventoryMove/record/oktoScrapRecord.vue
  13. 2
      pages/inventoryMove/record/scrapToHoldRecord.vue
  14. 31
      pages/issue/record/issueRecord.vue
  15. 1
      pages/issue/request/issueRequestCreate.vue
  16. 426
      pages/productionReturn/coms/comReturn.vue
  17. 171
      pages/productionReturn/coms/comReturnRecord.vue
  18. 8
      pages/productionReturn/record/returnToHold.vue
  19. 8
      pages/productionReturn/record/returnToStore.vue
  20. 1
      pages/transfer/coms/comTransferRecord.vue

4
api/request2.js

@ -2566,8 +2566,8 @@ export function productionReturnRequestCreate(params) {
*/ */
export function productionReturnRecordSubmit(params) { export function productionReturnRecordSubmit(params) {
return request({ return request({
url: baseApi + "/wms/purchasereturn-request-main/submit", url: baseApi + "/wms/productionreturn-record-main/create",
method: "put", method: "post",
data: params, data: params,
}); });
} }

9
common/label.js

@ -5,6 +5,12 @@ import {
getPackageByNumber getPackageByNumber
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
checkDirectoryItemExist,
getDirectoryItemArray
} from '@/common/directory.js';
export function getLabelInfo(scanMsg,headerType, callBack) { export function getLabelInfo(scanMsg,headerType, callBack) {
console.log('扫描信息:', scanMsg); console.log('扫描信息:', scanMsg);
@ -15,7 +21,8 @@ export function getLabelInfo(scanMsg,headerType, callBack) {
let header = items[0]; let header = items[0];
let version = items[1]; let version = items[1];
if ((header != undefined) && (version!=undefined)) { if ((header != undefined) && (version!=undefined)) {
if(header!=headerType){ var hearList =getDirectoryItemArray(headerType)
if(!checkDirectoryItemExist(hearList,header)){
let labelResult = { let labelResult = {
label: { label: {
labelType: "", labelType: "",

11
mycomponents/qty/recommendQtyEdit.vue

@ -67,7 +67,7 @@
data() { data() {
return { return {
allQty: 0, allQty: 0,
stdCount: 1, stdCount: 0,
labelQty: 0, labelQty: 0,
recommendQty: 0 recommendQty: 0
} }
@ -107,17 +107,18 @@
openEditPopup() { openEditPopup() {
this.$refs.popup.open('bottom') this.$refs.popup.open('bottom')
}, },
openTaskEditPopup(recommendQty, handleQty,labelQty) { openTaskEditPopup(recommendQty, handleQty, labelQty) {
this.recommendQty = Number(recommendQty); this.recommendQty = Number(recommendQty);
this.labelQty = Number(labelQty); this.labelQty = Number(labelQty);
this.allQty = Number(handleQty) this.allQty = Number(handleQty)
setTimeout(res=>{ setTimeout(res => {
this.$refs.popup.open('bottom') this.$refs.popup.open('bottom')
},500) }, 500)
}, },
openRecordEditPopup(labelQty) { openRecordEditPopup(labelQty) {
this.recommendQty = 0; this.recommendQty = 0;
this.labelQty = Number(labelQty); this.labelQty = Number(labelQty);
this.allQty = Number(labelQty)
this.$refs.popup.open('bottom') this.$refs.popup.open('bottom')
}, },
closeEditPopup() { closeEditPopup() {
@ -130,7 +131,9 @@
this.closeEditPopup(); this.closeEditPopup();
}, },
calcQty(val) { calcQty(val) {
if (val > 0) {
this.allQty = val * this.dataContent.stdPackQty; this.allQty = val * this.dataContent.stdPackQty;
}
}, },
setValue() { setValue() {
// var recommendQty = Number(this.dataContent.qty); // var recommendQty = Number(this.dataContent.qty);

1
mycomponents/scan/winComScan.vue

@ -154,6 +154,7 @@
if (that.isShowHistory) { if (that.isShowHistory) {
that.scanList.unshift(content); that.scanList.unshift(content);
} }
getLabelInfo(content,this.headerType, callback => { getLabelInfo(content,this.headerType, callback => {
let scanResult = callback; let scanResult = callback;
if (scanResult.success) { if (scanResult.success) {

10
pages.json

@ -861,7 +861,7 @@
} }
}, },
{ {
"path": "pages/inventoryMove/job/HoldToScrapMoveJob", "path": "pages/inventoryMove/job/holdToScrapMoveJob",
"style": { "style": {
"navigationBarTitleText": "隔离转报废", "navigationBarTitleText": "隔离转报废",
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
@ -913,7 +913,7 @@
} }
}, },
{ {
"path": "pages/inventoryMove/record/scrapToHoldMoveRecord", "path": "pages/inventoryMove/record/scrapToHoldRecord",
"style": { "style": {
"navigationBarTitleText": "报废转隔离记录", "navigationBarTitleText": "报废转隔离记录",
"enablePullDownRefresh": true "enablePullDownRefresh": true
@ -929,14 +929,14 @@
} }
}, },
{ {
"path": "pages/inventoryMove/record/moveOkToHoldRecord", "path": "pages/inventoryMove/record/okToHoldRecord",
"style": { "style": {
"navigationBarTitleText": "合格转隔离记录", "navigationBarTitleText": "合格转隔离记录",
"enablePullDownRefresh": true "enablePullDownRefresh": true
} }
}, },
{ {
"path": "pages/inventoryMove/record/moveHoldToOkRecord", "path": "pages/inventoryMove/record/holdToOkRecord",
"style": { "style": {
"navigationBarTitleText": "隔离转合格记录", "navigationBarTitleText": "隔离转合格记录",
"enablePullDownRefresh": true "enablePullDownRefresh": true
@ -950,7 +950,7 @@
} }
}, },
{ {
"path": "pages/inventoryMove/record/oktoScrapRecord", "path": "pages/inventoryMove/record/okToScrapRecord",
"style": { "style": {
"navigationBarTitleText": "合格转报废记录", "navigationBarTitleText": "合格转报废记录",
"enablePullDownRefresh": true "enablePullDownRefresh": true

81
pages/inventoryMove/coms/comMove.vue

@ -17,15 +17,16 @@
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationTypeList="toLocationTypeArray"></requiredLocation>
<view class="page-footer"> <view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10" <view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationTypeList="toLocationTypeArray"></requiredLocation>
</view> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after">提交</button> <button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view> </view>
</view> </view>
</view> </view>
@ -57,6 +58,9 @@
import { import {
getBusinessType, getBusinessType,
createItemInfo,
createDetailInfo,
calcHandleQty
} from '@/common/record.js'; } from '@/common/record.js';
export default { export default {
@ -96,8 +100,7 @@
toLocationCode: "", toLocationCode: "",
toLocationInfo: {}, toLocationInfo: {},
toLocationTypeArray: [], toLocationTypeArray: [],
fromInventoryStatus: [], toInventoryStatus: "",
toInventoryStatus: [],
businessType: {}, // businessType: {}, //
detailSource: [], // detailSource: [], //
} }
@ -126,16 +129,21 @@
var name ="" var name =""
if(this.businessTypeCode=="Move"){ if(this.businessTypeCode=="Move"){
name = "库存转移记录"; name = "库存转移记录";
}else if(this.businessTypeCode=="HoldToOk"){ }else if(this.businessTypeCode=="HoldToOkRecord"){
name = "隔离转合格记录"; name = "隔离转合格记录";
}else if(this.businessTypeCode=="HoldToScrap"){ this.toInventoryStatus = "OK"
}else if(this.businessTypeCode=="HoldToScrapRecord"){
name = "隔离转报废记录"; name = "隔离转报废记录";
}else if(this.businessTypeCode=="OkToHold"){ this.toInventoryStatus = "SCRAP"
}else if(this.businessTypeCode=="OkToHoldRecord"){
name = "合格转隔离记录"; name = "合格转隔离记录";
}else if(this.businessTypeCode=="OktoScrap"){ this.toInventoryStatus ="HOLD"
}else if(this.businessTypeCode=="OktoScrapRecord"){
name = "合格转报废记录"; name = "合格转报废记录";
}else if(this.businessTypeCode=="ScrapToHold"){ this.toInventoryStatus ="SCRAP"
}else if(this.businessTypeCode=="ScrapToHoldRecord"){
name = "报废转隔离记录"; name = "报废转隔离记录";
this.toInventoryStatus ="HOLD"
} }
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: name title: name
@ -163,14 +171,6 @@
this.openScanPopup(); this.openScanPopup();
}, },
getToLocationCode(location, code) { getToLocationCode(location, code) {
if (this.fromLocationCode == code) {
uni.showToast({
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致",
duration: 2000
})
return
}
this.toLocationCodeInfo = location;
this.toLocationCode = code; this.toLocationCode = code;
}, },
getScanResult(result) { getScanResult(result) {
@ -186,8 +186,8 @@
} }
}) })
if (item == undefined) { if (item == undefined) {
var itemp = this.createItemInfo(balance,pack); var itemp = createItemInfo(balance,pack);
let newDetail = this.createDetailInfo(balance, pack); // let newDetail = createDetailInfo(balance, pack); //
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
this.detailSource.push(itemp) this.detailSource.push(itemp)
} else { } else {
@ -202,13 +202,13 @@
}) })
if (detail == undefined) { if (detail == undefined) {
let newDetail = this.createDetailInfo(balance, pack); let newDetail = createDetailInfo(balance, pack);
item.subList.push(newDetail); item.subList.push(newDetail);
} else { } else {
this.showErrorMessage(balance.packingNumber + "已经在列表中") this.showErrorMessage(balance.packingNumber + "已经在列表中")
} }
} }
this.calcHandleQty(); calcHandleQty(this.detailSource);
}, },
@ -256,7 +256,13 @@
}); });
}, },
updateData() { updateData() {
this.calcHandleQty(); calcHandleQty(this.detailSource);
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
if (item.qty == 0) {
this.detailSource.splice(i, 1)
}
}
}, },
removePack() { removePack() {
@ -276,7 +282,36 @@
this.detailSource.splice(i, 1) this.detailSource.splice(i, 1)
} }
} }
},
commit() {
uni.showLoading({
title: "提交中....",
mask: true
});
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
console.log("提交参数", JSON.stringify(params));
//
//退
var params = this.setRecordParams(true)
console.log("提交参数", JSON.stringify(params));
purchaseReturnRecordSubmit(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)
})
} else {
this.showErrorMessage("没有要提交的数据")
}
},
} }
} }
</script> </script>

10
pages/inventoryMove/coms/comMoveJob.vue

@ -114,15 +114,15 @@
var name = "" var name = ""
if (this.businessTypeCode == "Move") { if (this.businessTypeCode == "Move") {
name = "库存转移"; name = "库存转移";
} else if (this.businessTypeCode == "HoldToOk") { } else if (this.businessTypeCode == "HoldToOkJob") {
name = "隔离转合格"; name = "隔离转合格";
} else if (this.businessTypeCode == "HoldToScrap") { } else if (this.businessTypeCode == "HoldToScrapJob") {
name = "隔离转报废"; name = "隔离转报废";
} else if (this.businessTypeCode == "OkToHold") { } else if (this.businessTypeCode == "OkToHoldJob") {
name = "合格转隔离"; name = "合格转隔离";
} else if (this.businessTypeCode == "OktoScrap") { } else if (this.businessTypeCode == "OktoScrapJob") {
name = "合格转报废"; name = "合格转报废";
} else if (this.businessTypeCode == "ScrapToHold") { } else if (this.businessTypeCode == "ScrapToHoldJob") {
name = "报废转隔离"; name = "报废转隔离";
} }

4
pages/inventoryMove/coms/comMovebalance.vue

@ -29,8 +29,8 @@
</view> </view>
</view> </view>
<u-line></u-line> <!-- <u-line></u-line> -->
<purchase-info :dataContent="dataContent.package"></purchase-info> <!-- <purchase-info :dataContent="dataContent.package"></purchase-info> -->
</view> </view>
</view> </view>
</template> </template>

2
pages/inventoryMove/record/moveHoldToOkRecord.vue → pages/inventoryMove/record/holdToOkRecord.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<comMove businessTypeCode='HoldToOk' :isShowStatus="false"> </comMove> <comMove businessTypeCode='HoldToOkRecord' :isShowStatus="false"> </comMove>
</view> </view>
</template> </template>

2
pages/inventoryMove/record/holdToScrapRecord.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<comMove :isShowStatus="true" businessTypeCode='HoldToScrap'> </comMove> <comMove :isShowStatus="true" businessTypeCode='HoldToScrapRecord'> </comMove>
</view> </view>
</template> </template>

2
pages/inventoryMove/record/moveOkToHoldRecord.vue → pages/inventoryMove/record/okToHoldRecord.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<comMove businessTypeCode='OkToHold' :isShowStatus="true"> </comMove> <comMove businessTypeCode='OkToHoldRecord' :isShowStatus="true"> </comMove>
</view> </view>
</template> </template>

2
pages/inventoryMove/record/oktoScrapRecord.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<comMove businessTypeCode='OktoScrap' :isShowStatus="true"> </comMove> <comMove businessTypeCode='OktoScrapRecord' :isShowStatus="true"> </comMove>
</view> </view>
</template> </template>

2
pages/inventoryMove/record/scrapToHoldMoveRecord.vue → pages/inventoryMove/record/scrapToHoldRecord.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<comMove :isShowStatus="true" businessTypeCode='ScrapToHold'> </comMove> <comMove :isShowStatus="true" businessTypeCode='ScrapToHoldRecord'> </comMove>
</view> </view>
</template> </template>

31
pages/issue/record/issueRecord.vue

@ -37,7 +37,6 @@
<script> <script>
import { import {
issueRequestSubmit,
issueRecordSubmit, issueRecordSubmit,
getBalanceByBatchOffShelf getBalanceByBatchOffShelf
} from '@/api/request2.js'; } from '@/api/request2.js';
@ -67,7 +66,7 @@
import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue' import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue'
export default { export default {
name: 'issueRequestSubmit', name: '',
components: { components: {
comBlankView, comBlankView,
comIssueRequestPopup, comIssueRequestPopup,
@ -85,7 +84,6 @@
detailSource: [], // detailSource: [], //
detailOptions: [], detailOptions: [],
scanOptions: [], scanOptions: [],
fromType: "",
workShopCode: "", workShopCode: "",
fromInventoryStatuses: "", fromInventoryStatuses: "",
toInventoryStatuses: "" toInventoryStatuses: ""
@ -95,13 +93,6 @@
}, },
onLoad(option) { onLoad(option) {
this.fromType = option.fromType
if (this.fromType == "requestType") {
updateTitle("发料申请")
} else {
updateTitle("发料记录")
}
var typeCode = "Issue" var typeCode = "Issue"
getBusinessType(typeCode, res => { getBusinessType(typeCode, res => {
if (res.success) { if (res.success) {
@ -118,7 +109,7 @@
}, },
methods: { methods: {
closeScan(){ closeScan() {
this.resizeCollapse(); this.resizeCollapse();
}, },
resizeCollapse() { resizeCollapse() {
@ -281,21 +272,7 @@
title: "提交中....", title: "提交中....",
mask: true mask: true
}); });
if (this.fromType == "requestType") {
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
issueRequestSubmit(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)
})
} else {
var params = this.setParams() var params = this.setParams()
console.log("提交参数", JSON.stringify(params)); console.log("提交参数", JSON.stringify(params));
issueRecordSubmit(params).then(res => { issueRecordSubmit(params).then(res => {
@ -309,7 +286,7 @@
uni.hideLoading() uni.hideLoading()
this.showErrorMessage(error) this.showErrorMessage(error)
}) })
}
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {

1
pages/issue/request/issueRequestCreate.vue

@ -29,7 +29,6 @@
<script> <script>
import { import {
issueRequestSubmit, issueRequestSubmit,
issueRecordSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {

426
pages/productionReturn/coms/comReturn.vue

@ -8,23 +8,30 @@
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<record-com-detail-card :dataContent="item" :settingParam="dataContent" <comReturnRecord :dataContent="item" :index="index"
@removeData="removeData" @updateData="updateData" @removePack="removePack"> @removeItem="removeItem(index,item)" @updateData="updateData" @removePack="removePack">
</record-com-detail-card> </comReturnRecord>
</view> </view>
<u-line /> <u-line />
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode" :isShowEdit="true"
:locationTypeList="tolocationTypeList"></requiredLocation>
<u-line></u-line>
<view class="page-footer"> <view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10" <view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<view class="uni-flex uni-row u-col-center">
<text style="font-size: 32rpx;">位置 : </text>
<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>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> <button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
@ -34,22 +41,20 @@
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
</view> </view>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location> <win-scan-pack ref="scanPopup" @getResult='getScanResult' title="箱标签" headerType="HPQ"></win-scan-pack>
<win-scan-location ref="scanFromLocationCode" title="来源库位" @getLocation='getFromLocation'
:locationTypeList="fromLocationTypeList"></win-scan-location>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
<script> <script>
import { import {
productionReturnRecordSubmit productionReturnRecordSubmit,
getWorkShopLineStation
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
goHome, goHome,
updateTitle, getPackingNumberAndBatchByList
getPackingNumberAndBatch
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
@ -63,17 +68,16 @@
calcHandleQty calcHandleQty
} from '@/common/record.js'; } from '@/common/record.js';
import { import {
getManagementPrecisions getPrecisionStrategyList
} from '@/common/balance.js'; } from '@/common/balance.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
// import comReturnRecord from '@/pages/productionReturn/coms/comReturnRecord.vue' import comReturnRecord from '@/pages/productionReturn/coms/comReturnRecord.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue' import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import comMessage from '@/mycomponents/common/comMessage.vue' import comMessage from '@/mycomponents/common/comMessage.vue'
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue'
export default { export default {
name: 'comReturn', name: 'comReturn',
@ -82,10 +86,9 @@
// comReturnRecord, // comReturnRecord,
requiredLocation, requiredLocation,
comBlankView, comBlankView,
winScanLocation,
comMessage, comMessage,
winScanPackAndLocation, comReturnRecord,
recordComDetailCard winScanPack
}, },
props: { props: {
returnType: { returnType: {
@ -96,23 +99,10 @@
type: String, type: String,
default: "Move" default: "Move"
}, // }, //
fromType: {
type: String,
default: ""
},
}, },
watch: { watch: {},
fromType: {
handler(newName, oldName) {
this.updateTitle()
},
immediate: true,
deep: true
}
},
data() { data() {
return { return {
@ -121,36 +111,44 @@
dataContent: {}, // dataContent: {}, //
subList: [], //subList subList: [], //subList
detailSource: [], // detailSource: [], //
fromLocationInfo: {},
fromLocationCode: '', fromLocationCode: '',
fromLocationTypeList: [], fromLocationTypeList: [],
toLocationInfo: {},
toLocationCode: '', toLocationCode: '',
tolocationTypeList: [], tolocationTypeList: [],
businessType: {}, businessType: {},
showToLoaction:false inventoryStatus: '',
managementList: [],
show: false,
positionInfo: "请选择位置",
positionList: [],
productionLineCode: '',
rawLocationCode: "",
fgLocationCode: "",
workshopCode: "",
workStationCode: "",
workShopName: "",
productionLineName: "",
workStationName: "",
}; };
}, },
onLoad() { onLoad() {},
// var typeCode = ""
// if (this.returnType == "returnToStore") {
// typeCode = "ReturnToStore"
// } else if (this.returnType == "returnToHold") {
// typeCode = "ReturnToHold"
// }
},
mounted() { mounted() {
getBusinessType(this.businessTypeCode, res => { getBusinessType(this.businessTypeCode, res => {
if (res.success) { if (res.success) {
this.businessType = res.businessType; this.businessType = res.businessType;
this.fromlocationTypeList = res.fromlocationTypeList; this.fromlocationTypeList = res.fromlocationTypeList;
this.tolocationTypeList = res.tolocationTypeList; this.tolocationTypeList = res.tolocationTypeList;
this.showFromLocationPopup(); this.openScanPopup();
} else { } else {
this.$refs.comMessage.showBreakMessage(res.message); this.$refs.comMessage.showBreakMessage(res.message);
} }
}); });
getWorkShopLineStation().then(res => {
this.positionList = res.data
}).catch(error => {
})
}, },
@ -169,82 +167,87 @@
}, },
methods: { methods: {
updateTitle(){
if(this.businessTypeCode=='returnToStore'){
if(this.fromType == 'requestType'){
updateTitle("合格退料申请")
this.showToLoaction=false
}else {
updateTitle("合格退料记录")
this.showToLoaction=true
}
}else if(this.businessTypeCode=='returnToHold'){
if(this.fromType == 'requestType'){
updateTitle("隔离退料申请")
this.showToLoaction=false
}else {
updateTitle("隔离退料记录")
this.showToLoaction=true
}
}
},
showFromLocationPopup() {
this.$nextTick(() => {
this.$refs.scanFromLocationCode.openScanPopup();
})
},
getFromLocation(location, code) {
this.fromLocationCode = code;
this.fromLocationInfo = location;
this.openScanPopup();
},
openScanPopup() { openScanPopup() {
if (this.fromLocationCode == "") { this.$refs.scanPopup.openScanPopup();
this.showFromLocationPopup();
return
}
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType);
}, },
getDataSource(result) { getScanResult(result) {
let balance = result.balance;
let label = result.label; let label = result.label;
let pack = result.package; let pack = result.package;
var item = this.detailSource.find(res => { var item = this.detailSource.find(res => {
if (res.itemCode == result.balance.itemCode) { if (res.itemCode == label.itemCode) {
return res return res
} }
}) })
if (item == undefined) { if (item == undefined) {
var itemInfo = createItemInfo(balance, pack); var itemp = this.createItemInfo(label, pack);
let newDetail = createDetailInfo(balance, pack); // let newDetail = this.createDetailInfo(label, pack);
itemInfo.subList.push(newDetail); itemp.subList.push(newDetail);
this.detailSource.push(itemInfo) this.detailSource.push(itemp)
} else { } else {
var detail = item.subList.find(r => { var detail = item.subList.find(r => {
if (r.packingNumber == result.balance.packingNumber && if (r.packingNumber == label.packingNumber &&
r.batch == result.balance.batch && r.batch == label.batch) {
r.locationCode == result.balance.locationCode &&
r.inventoryStatus == result.balance.inventoryStatus) {
return r; return r;
} }
}) })
if (detail == undefined) { if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack); let newDetail = this.createDetailInfo(label, pack);
item.subList.push(newDetail); item.subList.push(newDetail);
} else { } else {
if (detail.scaned) { if (detail.scaned == true) {
this.showErrorMessage(result.balance.packingNumber + "已经在列表中") this.showErrorMessage("箱码[" + label.packingNumber + "批次[" + label.batch + "]已经在列表中")
} }
} }
} }
calcHandleQty(this.detailSource); 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 = this.businessTypeCode == 'ReturnToStore' ? "OK" : "HOLD"
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() { removePack() {
for (var i = 0; i < this.detailSource.length; i++) { for (var i = 0; i < this.detailSource.length; i++) {
@ -256,14 +259,13 @@
this.updateData(); this.updateData();
}, },
showSelect() {
this.show = !this.show
},
updateData() { updateData() {
this.calcHandleQty(); this.calcHandleQty();
}, },
getScanResult(result) {
this.getDataSource(result)
},
removeData(item) { removeData(item) {
for (let i = 0; i < this.detailSource.length; i++) { for (let i = 0; i < this.detailSource.length; i++) {
if (this.detailSource[i].itemCode == item.itemCode) { if (this.detailSource[i].itemCode == item.itemCode) {
@ -273,123 +275,123 @@
}, },
commit() { commit() {
if (this.showToLoaction &&this.toLocationCode == "") { if (this.positionInfo == "请选择位置") {
this.showMessage("请先选择目标库位") this.showMessage("请先选择位")
return; return;
} }
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
//
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
}); });
this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams()
if(this.fromType=="requestType"){ getPrecisionStrategyList(precisionStrategParams, res => {
var params = this.setRequestParams()
console.log("提交" + JSON.stringify(params))
// productionReturnRequestSubmit(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)
// })
}else {
//
var itemCodes = []
this.detailSource.forEach(item => {
itemCodes.push(item.itemCode)
})
//
getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) { if (res.success) {
this.managementList = res.list; this.managementList = res.list;
var params = this.setParams(true) var params = this.setParams()
console.log("提交参数", JSON.stringify(params)); console.log("提交" + JSON.stringify(params))
productionReturnRecordSubmit(params).then(res => {
// productionReturnRecordSubmit(params).then(res => { uni.hideLoading()
// uni.hideLoading() if (res.data) {
// if (res.data) { this.showCommitSuccessMessage("提交成功<br>生成制品收货记录<br>" + res.data)
// this.showCommitSuccessMessage("<br>" + res.data, ) } else {
// } else { this.showErrorMessage("提交失败[" + res.msg + "]")
// this.showErrorMessage(""+res.msg) }
// } }).catch(error => {
// }).catch(error => { uni.hideLoading()
// uni.hideLoading() this.showErrorMessage(error)
// this.showErrorMessage(error) })
// })
} else { } else {
uni.hideLoading(); uni.hideLoading();
this.showErrorMessage(res.message); this.showErrorMessage(res.message);
} }
}); })
} else {
this.showErrorMessage("没有要提交的数据,请先扫描")
} }
}, },
setRequestParams(){ setPrecisionStrategParams() {
var subList = [] var itemList = []
var supplierCode=""
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
if(supplierCode==""){ detail.toLocationCode = this.fgLocationCode;
supplierCode = detail.package.supplierCode var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode &&
detail.toLocationCode == res.locationCode) {
return res
} }
subList.push(detail) })
//
if (filterResult.length == 0) {
var result = {
itemCode: item.itemCode,
locationCode: detail.toLocationCode
}
itemList.push(result)
}
} }
}) })
}) })
return itemList;
this.dataContent.subList = subList
this.dataContent.supplierCode = supplierCode
this.dataContent.businessType = "PurchasePutaway"
this.dataContent.departmentCode= "研发部门";
this.dataContent.status= 1 ;
this.dataContent.autoCommit = "FALSE";
this.dataContent.autoAgree = "FALSE";
this.dataContent.autoExecute = "FALSE";
this.dataContent.directCreateRecord = "FALSE";
return this.dataContent;
}, },
setParams(queryModel) { setParams() {
var subList = [] var subList = []
var creator = this.$store.state.user.id var creator = this.$store.state.user.id
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
// var subItem = {}; var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
// Object.assign(subItem, detail) detail.packingNumber, detail.toLocationCode, detail.batch);
if (queryModel) { detail.itemCode = detail.itemCode;
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, detail.itemName = detail.package.itemName;
detail.packingNumber, detail.batch); detail.itemDesc1 = detail.package.itemDesc1;
detail.toPackingNumber = info.packingNumber;; 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.toContainerNumber = detail.containerNumber
detail.fromBatch = info.batch;
detail.toBatch = info.batch; detail.toBatch = info.batch;
detail.toInventoryStatus = detail.inventoryStatus
detail.toLocationCode = this.toLocationCode detail.fromLocationCode = detail.locationCode;
} else { detail.toLocationCode = detail.toLocationCode;
detail.toPackingNumber = detail.packingNumber;
detail.toContainerNumber = detail.containerNumber detail.productionlineCode = this.productionLineCode;
detail.toBatch = detail.toBatch; detail.workStationCode = this.workStationCode;
detail.toInventoryStatus = detail.inventoryStatus
detail.toLocationCode = ""
}
subList.push(detail) subList.push(detail)
} }
}) })
}) })
this.dataContent.subList = subList this.dataContent.subList = subList;
this.dataContent.creator = creator; this.dataContent.creator = creator;
this.dataContent.workshopCode = this.workshopCode;
this.dataContent.businessType = this.businessTypeCode;
return this.dataContent; return this.dataContent;
}, },
showMessage(message) { showMessage(message) {
this.scanPopupLoseFocus(); this.scanPopupLoseFocus();
this.$refs.comMessage.showMessage(message, res => { this.$refs.comMessage.showMessage(message, res => {
@ -408,58 +410,58 @@
}); });
}, },
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
afterCloseMessage() { afterCloseMessage() {
this.scanPopupGetFocus(); this.scanPopupGetFocus();
}, },
closeScanPopup() {
this.$refs.scanPopup.closeScanPopup();
},
scanPopupGetFocus() { scanPopupGetFocus() {
this.$refs.scanPopup.packGetFocus(); this.$refs.scanPopup.getfocus();
}, },
scanPopupLoseFocus() { scanPopupLoseFocus() {
this.$refs.scanPopup.packLoseFocus(); this.$refs.scanPopup.losefocus();
},
scroll: function(e) {
// console.log(e)
},
/**
* BlobUrl转blob数据
* @param {Object} url blob URL
* @param {Object} callback 回调函数
*/
objectURLToBlob(url, callback) {
const http = new XMLHttpRequest();
http.open("GET", url, true);
http.responseType = "blob";
http.onload = function(e) {
if (this.status == 200 || this.status === 0) {
callback(this.response);
}
};
http.send();
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
this.subList = [];
this.detailSource = [];
this.toLocationCode = '';
this.dataContent = {};
this.positionInfo = "请选择位置";
this.fgLocationCode = ""
}) })
setTimeout(() => { },
// uni.navigateTo({ confirmSelect(e) {
// url: './receiptJob' this.positionInfo = e[0].label + "-" + e[1].label + "-" + e[2].label
// }) console.log("位置", this.positionInfo)
}, 3000) 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("车间-生产线基础信息维护错误")
}
}, },
} }
} }

171
pages/productionReturn/coms/comReturnRecord.vue

@ -0,0 +1,171 @@
<template>
<view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="removeData($event,dataContent)" :right-options="removeOptions">
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowBalance="true"></item-qty>
</uni-swipe-action-item>
</uni-swipe-action>
</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,index)"
:right-options="item.scaned?scanOptions:detailOptions">
<balance :dataContent="item" :isShowStdPack="false" :isShowStatus="true"
:isShowPack="true" :isShowLocation="false"></balance>
<!-- <production-label :dataContent="item" :packageContent="item.package"
:isShowLocation="false">
</production-label> -->
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</uni-collapse-item>
</uni-collapse>
<recommend-qty-edit ref="recommendQtyEdit" :dataContent="editItem" :handleQty="editItem.qty" @confirm="confirm" :isShowStatus="isShowStatus"></recommend-qty-edit>
<package-detail-popup ref='packageDetailPopup'>
</package-detail-popup>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import productionLabel from '@/mycomponents/balance/productionLabel.vue'
import record from '@/mycomponents/record/record.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import packageDetailPopup from '@/mycomponents/package/packageDetailPopup.vue'
import balance from '@/mycomponents/balance/balance.vue'
import {
getDetailOption,
getDetailEditRemoveOption,
getClearOption
} from '@/common/array.js';
export default {
components: {
itemQty,
recommend,
packageDetailPopup,
productionLabel,
recommendQtyEdit,
record,
comMessage,
balance
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
fromInventoryStatus: {
type: String,
default: ""
},
toInventoryStatus: {
type: String,
default: ""
},
isShowStatus: {
type: Boolean,
default: false
}
},
watch: {
dataContent: {
handler(newName, oldName) {
if (this.dataContent.subList.length > 0) {
if (this.$refs.collapse1 != undefined) {
this.$nextTick(res => {
this.$refs.collapse1.resize()
})
}
}
},
immediate: true,
deep: true
}
},
data() {
return {
option: [],
title: "推荐详情",
showItem: {},
editItem: {},
detailOptions: [],
scanOptions: [],
removeOptions: [],
dataList: []
}
},
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getDetailEditRemoveOption();
this.removeOptions = getClearOption();
},
methods: {
removeData(e, dataContent) {
if (e.content.text == "清空") {
this.$refs.comMessage.showQuestionMessage("确定清空零件及箱码信息?",
res => {
if (res) {
this.$emit('removeItem')
// this.$emit('removeItem', this.dataContent)
}
});
}
},
swipeClick(e, item, index) {
if (e.content.text == "详情") {
this.detail(item.package)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
this.remove(item, index)
}
},
edit(item) {
this.editItem = item;
this.$refs.recommendQtyEdit.openRecordEditPopup(item.qty);
// this.$refs.recommendQtyEdit.openEditPopup(item.qty);
},
detail(packageInfo) {
this.showItem = packageInfo;
this.$refs.packageDetailPopup.openPopup(packageInfo)
},
remove(item, index) {
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
this.dataContent.subList.splice(index, 1)
this.$emit('removePack')
}
});
},
confirm(qty) {
this.editItem.qty = qty;
this.$emit('updateData')
}
}
}
</script>
<style>
</style>

8
pages/productionReturn/record/returnToHold.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<comReturn businessTypeCode="returnToHold" :fromType ="fromType"> </comReturn> <comReturn businessTypeCode="ReturnToHold" > </comReturn>
</view> </view>
</template> </template>
@ -14,16 +14,10 @@
data() { data() {
return { return {
settingParam: {
},
fromType:""
} }
}, },
onLoad(option) { onLoad(option) {
this.fromType=option.fromType
console.log("申请类型",this.fromType)
}, },
methods: { methods: {

8
pages/productionReturn/record/returnToStore.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<comReturn businessTypeCode="returnToStore" :fromType ="fromType"> </comReturn> <comReturn businessTypeCode="ReturnToStore" > </comReturn>
</view> </view>
</template> </template>
@ -14,16 +14,10 @@
data() { data() {
return { return {
settingParam: {
},
fromType:""
} }
}, },
onLoad(option) { onLoad(option) {
this.fromType=option.fromType
console.log("申请类型",this.fromType)
}, },
methods: { methods: {

1
pages/transfer/coms/comTransferRecord.vue

@ -155,6 +155,7 @@
if (item == undefined) { if (item == undefined) {
var itemp = createItemInfo(balance, pack); var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); // let newDetail = createDetailInfo(balance, pack); //
newDetail.inventoryStatus ="OK"
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
this.detailSource.push(itemp) this.detailSource.push(itemp)
} else { } else {

Loading…
Cancel
Save