Browse Source

修改生产退料申请

wms3.0_pda
lijuncheng 12 months ago
parent
commit
d8405d2690
  1. 2
      api/request2.js
  2. 9
      pages.json
  3. 3
      pages/issue/request/issueRequestCreate.vue
  4. 199
      pages/productionReturn/coms/comReturnRequestCreator.vue
  5. 4
      pages/productionReturn/coms/comReturnRequestInfo.vue
  6. 14
      pages/productionReturn/request/requestDetail.vue
  7. 49
      pages/productionReturn/request/returnRequestCreate.vue
  8. 4
      pages/purchaseReturn/record/returnRecord.vue
  9. 2
      pages/purchaseReturn/request/returnRequest.vue
  10. 356
      pages/purchaseReturn/request/returnRequestCreate.vue

2
api/request2.js

@ -683,7 +683,7 @@ export function purchaseReturnRequestHandle(id) {
* 采购退货申请 提交
* @param {*} params
*/
export function purchaseReturnRequestSubmit(params) {
export function purchaseReturnRequestCreate(params) {
return request({
url: baseApi + "/wms/purchasereturn-request-main/create",
method: "post",

9
pages.json

@ -111,6 +111,13 @@
"enablePullDownRefresh": false
}
},
{
"path": "pages/purchaseReturn/request/returnRequestCreate",
"style": {
"navigationBarTitleText": "采购退货申请创建",
"enablePullDownRefresh": true
}
},
{
"path": "pages/purchaseReturn/job/returnJob",
@ -149,6 +156,8 @@
// }
}
},
{
"path": "pages/purchaseReceipt/job/receiptJob",
"style": {

3
pages/issue/request/issueRequestCreate.vue

@ -36,7 +36,7 @@
goHome,
updateTitle,
getRemoveOption,
getISODateTime
getCurrDateOneMonthsTimes
} from '@/common/basic.js';
import {
@ -150,6 +150,7 @@
setParams() {
this.detailSource.dueTime = getCurrDateOneMonthsTimes();
return this.detailSource
},
submit() {

199
pages/productionReturn/coms/comReturnRequestCreator.vue

@ -1,88 +1,159 @@
<template>
<view class="">
<uni-collapse ref="collapse">
<uni-collapse-item :open="true">
<com-issue-request-info :workShopCode="dataContent.workshopCode" :dataContent="dataContent">
</com-issue-request-info>
<u-line />
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in dataContent.subList" :key="index">
<uni-swipe-action-item>
<view class="" style="font-size: 32rpx;margin: 10rpx;">
<view class="">
生产线 : {{item.productionLineName}}({{item.productionLineCode}})
</view>
<view class="">
工位 : {{item.workStationName}} ({{item.workStationCode}})
</view>
<view class="">
物品代码 : {{item.itemCode}}
</view>
<view class="">
物品名称 : {{item.itemName}}
</view>
<view class="uni-flex uni-row uni-center">
<view class="">
数量 : {{item.qty}} 单位 :
</view>
<view class="">
<uom :uom="item.uom"></uom>
</view>
</view>
</view>
</uni-swipe-action-item>
<view class="" style="background-color: #fff;">
<view class="uni-flex uni-column">
<comReturnRequestInfo :workShopCode="dataContent.workshopCode" :dataContent="dataContent">
</comReturnRequestInfo>
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in dataContent.subList" :key="index">
<uni-swipe-action-item @click="swipeClick($event,item)" :right-options="detailOptions">
<item-qty :dataContent="item" :isShowStdPack="false">
</item-qty>
<view v-if="item.batch!=''" style="margin-left: 10rpx;">
<batch :batch="item.batch" ></batch>
</view>
<u-line />
</view>
</uni-swipe-action>
</uni-collapse-item>
</uni-collapse>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
</view>
<request-detail-info-popup ref="jobDetailPopup"></request-detail-info-popup>
<com-message ref="message"></com-message>
</view>
</template>
<script>
import uom from '@/mycomponents/qty/uom.vue'
import comIssueRequestInfo from '@/pages/issue/coms/comIssueRequestInfo.vue'
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import itemQty from '@/mycomponents/item/itemQty.vue'
import comReturnRequestInfo from '@/pages/productionReturn/coms/comReturnRequestInfo.vue'
import requestDetailInfoPopup from '@/pages/issue/coms/requestDetailInfoPopup.vue'
import batch from '@/mycomponents/balance/batch.vue'
import {
getDetailOption,
getDetailEditRemoveOption,
getDetailRemoveOption
} from '@/common/array.js';
export default {
emits: ['openDetail'],
components: {
uom
},
data() {
return {
}
itemCompareQty,
recommend,
balanceQtyEdit,
comMessage,
itemQty,
comReturnRequestInfo,
requestDetailInfoPopup,
batch
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowLocation: {
type: Boolean,
default: true
},
isSwipe: {
type: Boolean,
default: true
},
},
methods: {
update(){
this.$nextTick(r => {
this.$refs.collapse.resize()
});
watch: {
dataContent(newVal) {
this.requestItem = newVal.subList[0];
},
getType(value){
var type =""
if(value=="ReturnToStore"){
type ="合格退料"
}else if (value=='ReturnToHold'){
type ="隔离退料"
}
return type;
}
},
data() {
return {
option: [],
showItem: {},
editItem: {
record: {
}
},
requestItem: {},
detailOptions: [],
scanOptions: []
}
},
mounted() {
if (this.detailOptions.length == 0) {
this.detailOptions = getDetailOption();
}
if (this.scanOptions.length == 0) {
this.scanOptions = getDetailEditRemoveOption();
// if (this.dataContent.allowModifyQty == 1) {
// this.scanOptions = getDetailEditRemoveOption();
// } else {
// this.scanOptions = getDetailRemoveOption();
// }
}
if(!this.isSwipe){
this.detailOptions=[]
}
},
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.remove(item)
}
},
edit(item) {
this.editItem = item;
this.$refs.qtyEdit.openEditPopup(item.balance, item.record.qty);
},
detail(item) {
this.$refs.jobDetailPopup.openPopup(item)
// this.$emit('openDetail', item);
// // this.showItem = item;
// // this.$refs.jobDetailPopup.openPopup(item)
},
remove(item) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false
item.record = {}
item.balance = {}
item.inventoryStatus = item.RecommendInventoryStatus
// item.record.qty = 0;
this.$forceUpdate()
this.$emit('remove', item)
}
});
},
confirm(qty) {
this.editItem.record.qty = qty;
this.$emit('updateData')
}
}
}
</script>

4
pages/productionReturn/coms/comReturnRequestInfo.vue

@ -14,8 +14,8 @@
<view>{{ dataContent.workStationCode }}</view>
</view>
<view class="cell_info">
<view class="text_lightblue">原材料库</view>
<view>{{ dataContent.toLocationCode}}</view>
<view class="text_lightblue">来源库位</view>
<view>{{ dataContent.fromLocationCode}}</view>
</view>
</view>
<u-line />

14
pages/productionReturn/request/requestDetail.vue

@ -1,5 +1,9 @@
<template>
<view class="page-wraper">
<view class="page-header">
<comReturnRequestInfo :workShopCode="requestContent.workshopCode" :dataContent="requestContent">
</comReturnRequestInfo>
</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">
@ -33,12 +37,15 @@
import comRequestDetailCard from "@/mycomponents/detail/comRequestDetailCard.vue"
import requestDetailInfoPopup from '@/pages/productionReturn/coms/requestDetailInfoPopup.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import comReturnRequestInfo from '@/pages/productionReturn/coms/comReturnRequestInfo.vue'
export default {
components: {
comRequestDetailCard,
requestDetailInfoPopup,
comMessage,
comReturnRequestInfo
},
data() {
return {
@ -84,7 +91,10 @@
that.requestContent = res.data;
that.subList = res.data.subList;
that.detailSource = getDataSource(that.subList);
that.detailSource[0].workshopCode = that.requestContent.workshopCode
that.requestContent.fromLocationCode = that.subList[0].fromLocationCode
that.requestContent.productionLineCode = that.subList[0].productionLineCode
that.requestContent.workStationCode = that.subList[0].workStationCode
} else {
that.showMessage('列表数据为0');
}

49
pages/productionReturn/request/returnRequestCreate.vue

@ -5,8 +5,9 @@
</view>
<view v-else class="page-wraper">
<view class="page-main">
<comReturnRequestInfo ref="issueRequest" :dataContent="detailSource" :isSwipe ="false">
</comReturnRequestInfo>
<comReturnRequestCreator ref="issueRequest" :dataContent="detailSource" :isSwipe ="false">
</comReturnRequestCreator>
<button class="btn_add" @click="goScan(false)">+去添加</button>
</view>
@ -36,6 +37,7 @@
updateTitle,
navigateBack,
getRemoveOption,
getCurrDateOneMonthsTimes
} from '@/common/basic.js';
import comBlankView from '@/mycomponents/common/comBlankView.vue'
@ -44,7 +46,6 @@
import comScanReturnPack from '@/pages/productionReturn/coms/comScanReturnPack.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import comReturnRequestCreator from '@/pages/productionReturn/coms/comReturnRequestCreator.vue'
import comIssueRequestInfo from '@/pages/issue/coms/comIssueRequestInfo.vue'
export default {
name: '',
components: {
@ -53,7 +54,7 @@
jobDetailPopup,
comScanReturnPack,
comMessage,
comReturnRequestCreator
comReturnRequestCreator,
},
data() {
return {
@ -95,7 +96,12 @@
if (this.detailSource.subList.length == 0) {
this.detailSource = {
workshopCode: item.workshopCode,
businessType:this.fromType,
workShopName: item.workShopName,
productionLineCode: item.productionLineCode,
productionLineName: item.productionLineName,
workStationCode: item.workStationCode,
workStationName: item.workStationName, //
fromLocationCode:item.rawLocationCode,
status: "1",
totalQty: 0,
subList: []
@ -126,6 +132,9 @@
workStationCode: item.workStationCode,
itemCode: item.itemCode,
itemName: item.itemName,
inventoryStatus:"OK",
packingNumber:"",
fromLocationCode:item.rawLocationCode,
qty: item.qty,
uom: item.uom
}
@ -139,9 +148,6 @@
}
}
this.caclcQty();
if (this.$refs.issueRequest != undefined) {
this.$refs.issueRequest.update()
}
},
caclcQty() {
@ -153,14 +159,17 @@
},
setParams() {
//退
if(this.fromType=="ReturnToStore"){
this.detailSource.isOK = true
this.detailSource.dueTime = getCurrDateOneMonthsTimes()
this.detailSource.subList.forEach(res => {
res.batch ="000000"
})
//退
}else if(this.fromType=="ReturnToHold"){
this.detailSource.isOK = false
this.detailSource.dueTime = getCurrDateOneMonthsTimes()
this.detailSource.subList.forEach(res => {
res.batch = ""
})
@ -174,17 +183,17 @@
});
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
productionReturnRequestCreate(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)
})
// productionReturnRequestCreate(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)
// })
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {

4
pages/purchaseReturn/record/returnRecord.vue

@ -40,7 +40,7 @@
<script>
import {
purchaseReturnRecordSubmit,
purchaseReturnRequestSubmit
purchaseReturnRequestCreate
} from '@/api/request2.js';
import {
goHome,
@ -226,7 +226,7 @@
if (this.fromType == "requestType") {
var params = this.setRequestParams();
console.log("提交" + JSON.stringify(params))
purchaseReturnRequestSubmit(params).then(res => {
purchaseReturnRequestCreate(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成采购退货申请" + res.data, )

2
pages/purchaseReturn/request/returnRequest.vue

@ -201,7 +201,7 @@
openScanDetailPopup(item) {
uni.navigateTo({
url: "../record/returnRecord?fromType=" + this.fromType
url: "./returnRequestCreate"
})
},

356
pages/purchaseReturn/request/returnRequestCreate.vue

@ -0,0 +1,356 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view>
</view>
<view class="page-wraper" v-if="detailSource.length>0">
<u-line></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="">
<record-com-detail-card :dataContent="item" @removeItem="removeItem(index,item)"
@updateData="updateData" @removePack="removePack">
</record-com-detail-card>
</view>
</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>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'>
</win-scan-pack-and-location>
<win-scan-location ref="scanFromLocationCode" title="来源库位" @getLocation='getFromLocation'
:locationTypeList="fromlocationTypeList"></win-scan-location>
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import {
purchaseReturnRequestCreate
} from '@/api/request2.js';
import {
goHome,
updateTitle,
navigateBack,
getCurrDateOneMonthsTimes
} from '@/common/basic.js';
import {
getBusinessType,
createItemInfo,
createDetailInfo,
calcHandleQty
} from '@/common/record.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import comMessage from '@/mycomponents/common/comMessage.vue'
export default {
components: {
winScanButton,
comBlankView,
winScanLocation,
winScanPackAndLocation,
comMessage,
recordComDetailCard
},
data() {
return {
id: '',
submitMainContent: {}, //
subList: [], //subList
detailSource: [], //
fromLocationCode: "",
fromlocationTypeList: [],
tolocationTypeList: [],
businessType: {}, //
poNumber: '',
dataContent : {}
};
},
onLoad(option) {
var typeCode = "PurchaseReturn"
getBusinessType(typeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.fromlocationTypeList = res.fromlocationTypeList;
this.tolocationTypeList = res.tolocationTypeList;
this.showFromLocationPopup();
} else {
this.$refs.comMessage.showBreakMessage(res.message);
}
});
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
//
onBackPress(e) {},
onPullDownRefresh() {},
mounted() {
},
methods: {
showFromLocationPopup() {
this.$nextTick(() => {
this.$refs.scanFromLocationCode.openScanPopup();
})
},
openScanPopup() {
if (this.fromLocationCode == "") {
this.showFromLocationPopup();
return
}
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType);
},
getScanResult(result) {
if (this.poNumber == '') {
this.poNumber = result.label.order;
} else {
if (this.poNumber != result.label.order) {
this.showErrorMessage('扫描的采购订单号[' + result.label.order + ']与默认采购订单号[' + this.poNumber + ']不一致')
return;
}
}
this.getDataSource(result)
},
getDataSource(result) {
let balance = result.balance;
let label = result.label;
let pack = result.package;
var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) {
return res
}
})
if (item == undefined) {
var itemInfo = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack);
itemInfo.subList.push(newDetail);
this.detailSource.push(itemInfo)
} else {
var detail = item.subList.find(r => {
if (r.packingNumber == balance.packingNumber &&
r.batch == balance.batch &&
r.locationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus &&
r.scaned == true) {
return r;
}
})
if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack);
item.subList.push(newDetail);
} else {
this.showErrorMessage('箱码[' + balance.packingNumber + "]已经在列表中")
}
}
calcHandleQty(this.detailSource);
},
updateData() {
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() {
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();
},
removeItem(index, item) {
this.detailSource.splice(index, 1)
},
commit() {
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
console.log("提交参数", JSON.stringify(params));
uni.showLoading({
title: "提交中....",
mask: true
});
var params = this.setRequestParams();
console.log("提交" + JSON.stringify(params))
purchaseReturnRequestCreate(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("没有要提交的数据")
}
},
setRequestParams(){
var subList = []
var supplierCode=""
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
if(supplierCode==""){
supplierCode = detail.package.supplierCode
}
detail.fromLocationCode = detail.locationCode
subList.push(detail)
}
})
})
this.dataContent.subList = subList
this.dataContent.purchaseReceiptRecordNumber="";
this.transferMode ="";
this.dataContent.supplierCode = supplierCode
this.dataContent.dueTime =getCurrDateOneMonthsTimes()
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;
},
showMessage(message) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.scanPopupGetFocus();
}
});
})
},
showErrorMessage(message) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.scanPopupGetFocus();
}
});
})
},
closeScanPopup() {
this.$refs.scanPopup.closeScanPopup();
},
scanPopupGetFocus() {
this.$refs.scanPopup.packGetFocus();
},
scanPopupLoseFocus() {
this.$refs.scanPopup.packLoseFocus();
},
getFromLocation(location, code) {
this.getFromLocationCode(location, code)
},
getFromLocationCode(location, code) {
this.fromLocationCode = code;
this.openScanPopup();
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
navigateBack(1)
})
}
}
}
</script>
<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>
Loading…
Cancel
Save