niexiting 12 months ago
parent
commit
37ef707933
  1. 12
      api/request2.js
  2. 9
      pages.json
  3. 10
      pages/issue/coms/comIssueRequestCreator.vue
  4. 3
      pages/issue/request/issueRequestCreate.vue
  5. 71
      pages/productReceipt/coms/comProductDetailCard.vue
  6. 4
      pages/productReceipt/coms/comProductJobCard.vue
  7. 96
      pages/productReceipt/coms/productDetailInfoPopup.vue
  8. 89
      pages/productReceipt/job/productReceiptDetail.vue
  9. 2
      pages/productReceipt/job/productReceiptJob.vue
  10. 197
      pages/productionReturn/coms/comReturnRequestCreator.vue
  11. 4
      pages/productionReturn/coms/comReturnRequestInfo.vue
  12. 12
      pages/productionReturn/request/requestDetail.vue
  13. 26
      pages/productionReturn/request/returnRequestCreate.vue
  14. 4
      pages/purchaseReturn/record/returnRecord.vue
  15. 2
      pages/purchaseReturn/request/returnRequest.vue
  16. 356
      pages/purchaseReturn/request/returnRequestCreate.vue
  17. 5
      pages/scrap/coms/comScrapDetailCard.vue
  18. 4
      pages/scrap/job/scrapJobDetail.vue

12
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",
@ -1537,26 +1537,26 @@ export function getProductReceiptJobDetail(id) {
}
/**
* 制品收货 承接
* 制品收货任务 承接
* @param {*} id
*
*/
export function takeProductReceiptJob(id) {
return request({
url: baseApi + "/wms/purchasereceipt-job-main/abandon?id=" + id,
url: baseApi + "/wms/productreceipt-job-main/accept?id=" + id,
method: "put",
data: {},
});
}
/**
* 制品收货 放弃承接
* 制品收货任务 放弃承接
* @param {*} id
*
*/
export function cancleTakeProductReceiptJob(id) {
return request({
url: baseApi + "/wms/purchasereceipt-job-main/abandon?id=" + id,
url: baseApi + "/wms/productreceipt-job-main/abandon?id=" + id,
method: "put",
data: {},
});
@ -1568,7 +1568,7 @@ export function cancleTakeProductReceiptJob(id) {
*/
export function productReceiptJobsubmit(params) {
return request({
url: baseApi + "/magic-api/pda/job/purchasereturn/jobSubmit",
url: baseApi + "/wms/productreceipt-job-main/execute",
method: "put",
data: params,
});

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": {

10
pages/issue/coms/comIssueRequestCreator.vue

@ -71,9 +71,13 @@
},
},
watch: {
dataContent(newVal) {
this.requestItem = newVal.subList[0];
},
dataContent: {
handler(newval, oldval) {
this.requestItem = this.dataContent.subList[0];
},
immediate: true,
deep: true
}
},
data() {

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() {

71
pages/productReceipt/coms/comProductDetailCard.vue

@ -3,47 +3,54 @@
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"></item-qty>
<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" :record="item.record"
:isShowLocation="false"></recommend>
<recommend :detail="item" :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="qtyEdit" :dataContent="editItem" :settingParam="settingParam"
:handleQty="editItem.record.qty" @confirm="confirm">
<recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam"
@confirm="confirm">
</recommend-qty-edit>
<job-detail-popup ref="receiptHint" :dataContent="showItem"></job-detail-popup>
<comMessage ref="message"></comMessage>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
:locationTypeList="locationTypeList"></win-scan-location>
<productDetailInfoPopup ref="jobDetailPopup" :dataContent="showItem"></productDetailInfoPopup>
<com-message ref="message"></com-message>
</view>
</template>
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
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/job/jobDetailPopup.vue'
import jobDetailPopup from '@/mycomponents/detail/jobDetailPopup.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import productDetailInfoPopup from '@/pages/productReceipt/coms/productDetailInfoPopup.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import {
getDetailOption,
getDetailEditRemoveOption
getPurchaseReceiptOption
} from '@/common/array.js';
export default {
components: {
itemQty,
itemCompareQty,
recommend,
recommendQtyEdit,
jobDetailPopup,
comMessage
productDetailInfoPopup,
comMessage,
winScanLocation
},
props: {
dataContent: {
@ -54,6 +61,12 @@
type: Object,
default: {}
},
locationTypeList: {
type: Array,
default: []
},
},
watch: {
@ -61,22 +74,25 @@
data() {
return {
option: [],
title: "推荐详情",
showItem: {},
editItem: {
record: {
}
},
locatonItem:{},
detailOptions: [],
scanOptions: []
}
},
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getDetailEditRemoveOption();
if (this.detailOptions.length == 0) {
this.detailOptions = getDetailOption();
}
if (this.scanOptions.length == 0) {
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty,this.settingParam.allowModifyLocation)
}
},
methods: {
@ -85,34 +101,43 @@
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.qtyEdit.openTaskEditPopup(item.qty,item.record.label.qty);
// this.$refs.receiptEdit.openEditPopup();
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.receiptHint.openScanPopup()
this.$refs.jobDetailPopup.openPopup(item)
},
remove(item) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.isScaned = false
item.record = {}
// item.record.qty = 0;
item.scaned = false
item.handleQty = null
this.$forceUpdate()
this.$emit('remove', item)
}
});
},
confirm(qty) {
this.editItem.record.qty = qty;
this.editItem.handleQty = qty;
this.$emit('updateData')
}
}

4
pages/productReceipt/coms/comProductJobCard.vue

@ -9,13 +9,13 @@
<view class="task_text">
<view class="">
物品代码 : {{dataContent.itemCode}}
车间代码 : {{dataContent.workShopCode}}
</view>
</view>
<view class="task_text">
<view class="">
目标库位 : {{dataContent.toLocationCode}}
班组 : {{dataContent.team}}
</view>
</view>
</view>

96
pages/productReceipt/coms/productDetailInfoPopup.vue

@ -0,0 +1,96 @@
<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>
<view class="">
<view class="uni-flex uni-column">
<view class="item">
<text class="item_title">订单号 : </text>
<text class="text_wrap">{{dataContent.poNumber}} </text>
</view>
<view class="item">
<text class="item_title">订单行 : </text>
<text class="text_wrap">{{dataContent.poLine}} </text>
</view>
<view class="item">
<text class="item_title">项目代码 : </text>
<text class="text_wrap">{{dataContent.projectCode}} </text>
</view>
<view class="item">
<text class="item_title">到货日期 : </text>
<text class="text_wrap">{{dateFormat(dataContent.arriveDate)}} </text>
</view>
<view class="item">
<text class="item_title">生产日期 : </text>
<text class="text_wrap">{{dateFormat(dataContent.produceDate)}} </text>
</view>
<view class="item">
<text class="item_title">过期日期 : </text>
<text class="text_wrap">{{dateFormat(dataContent.expireDate)}} </text>
</view>
</view>
</view>
</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>

89
pages/productReceipt/job/productReceiptDetail.vue

@ -13,10 +13,10 @@
<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" :settingParam="jobContent" :isShowLocation="true"
<comProductDetailCard :dataContent="item" :settingParam="jobContent" :isShowLocation="false"
@remove="updateData" @updateData="updateData" @openDetail="openDetail"
:locationTypeList='tolocationTypeList'>
</com-detail-card>
</comProductDetailCard>
</view>
<u-line />
</view>
@ -37,8 +37,7 @@
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-pack ref="scanPopup" @getResult='getScanResult' title="制品标签"></win-scan-pack>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<win-scan-pack ref="scanPopup" @getResult='getScanResult' :title="'制品便签'"></win-scan-pack>
<com-message ref="comMessage"></com-message>
</view>
</template>
@ -56,7 +55,6 @@
} from '@/api/request2.js';
import {
goHome,
getCurrDateTime,
navigateBack,
getPackingNumberAndBatch,
} from '@/common/basic.js';
@ -79,8 +77,9 @@
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanPack from "@/mycomponents/scan/winScanPack.vue"
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue"
import detailInfoPopup from '@/pages/productReceipt/coms/detailInfoPopup.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
import comProductDetailCard from "@/pages/productReceipt/coms/comProductDetailCard.vue"
export default {
name: 'receipt_detail',
@ -90,8 +89,8 @@
requiredLocation,
winScanPack,
comMessage,
detailInfoPopup,
jobTop
jobTop,
comProductDetailCard
},
data() {
return {
@ -104,10 +103,8 @@
jobContent: {}, //
subList: [], //subList
detailSource: [], //
fromLocationTypeList: [],
toLocationTypeList: [],
toLocationInfo: {},
businessTypeInfo: {},
managementList: []
};
@ -116,16 +113,15 @@
this.id = option.id;
if (this.id != undefined) {
//
// if (option.status == "JOB_PENDING") {
// this.receive((callback => {
// this.received = true;
// this.getDetail();
// }));
// } else {
// this.getDetail();
// }
this.getDetail();
if (option.status == "1") {
this.receive((callback => {
this.received = true;
this.getDetail();
}));
} else {
this.getDetail();
}
}
},
//
@ -189,7 +185,6 @@
that.jobContent = res.data;
that.subList = res.data.subList;
that.toLocationCode = that.subList[0].toLocationCode
that.fromLocationTypeList = getDirectoryItemArray(that.jobContent.fromLocationTypes);
that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes)
that.detailSource = getDataSource(that.subList)
} else {
@ -226,19 +221,15 @@
itemDetail.handleQty = Number(result.label.qty);
itemDetail.toLocationCode = this.toLocationCode;
itemDetail.labelQty = Number(result.label.qty);
this.calcHandleQty();
calcHandleQty(this.detailSource);
this.continueScan()
this.$forceUpdate()
}
}
}
},
calcHandleQty() {
calcHandleQty(this.detailSource)
this.continueScan();
this.$forceUpdate();
},
//
continueScan() {
this.scanCount = getScanCount(this.subList);
@ -251,12 +242,9 @@
updateData() {
this.calcHandleQty();
calcHandleQty(this.detailSource);
},
openDetail(item) {
this.$refs.detailInfoPopup.openPopup(item)
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
@ -342,17 +330,17 @@
this.managementList = res.list;
var params = this.setParams();
console.log("提交参数",JSON.stringify(params));
// productReceiptJobsubmit(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)
// })
productReceiptJobsubmit(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);
@ -369,8 +357,11 @@
if (detail.scaned) {
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
detail.packingNumber, detail.batch);
detail.toPackingNumber =info.packingNumber;
detail.toBatch =info.batch;
detail.toPackingNumber = info.packingNumber;
detail.toBatch = info.batch;
detail.toContainerNumber = '';
detail.toInventoryStatus =detail.inventoryStatus
detail.toLocationCode = this.toLocationCode
subList.push(detail)
}
})
@ -382,19 +373,19 @@
scanPopupGetFocus() {
this.$refs.scanPopup.packGetFocus();
this.$refs.scanPopup.getfocus();
},
scanPopupLoseFocus() {
this.$refs.scanPopup.packLoseFocus();
this.$refs.scanPopup.losefocus();
},
showMessage(message) {
setTimeout(r => {
// this.scanPopupLoseFocus();
this.scanPopupLoseFocus();
this.$refs.comMessage.showMessage(message, res => {
if (res) {
// this.scanPopupGetFocus();
this.scanPopupGetFocus();
}
});
})

2
pages/productReceipt/job/productReceiptJob.vue

@ -128,7 +128,7 @@
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.receiptList = [];
this.jobList = [];
}
var filters = []
if (this.checkedToday) {

197
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="" 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>
<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>
<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 />

12
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');
}

26
pages/productionReturn/request/returnRequestCreate.vue

@ -5,8 +5,8 @@
</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 +36,7 @@
updateTitle,
navigateBack,
getRemoveOption,
getCurrDateOneMonthsTimes
} from '@/common/basic.js';
import comBlankView from '@/mycomponents/common/comBlankView.vue'
@ -44,7 +45,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 +53,7 @@
jobDetailPopup,
comScanReturnPack,
comMessage,
comReturnRequestCreator
comReturnRequestCreator,
},
data() {
return {
@ -95,7 +95,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 +131,9 @@
workStationCode: item.workStationCode,
itemCode: item.itemCode,
itemName: item.itemName,
inventoryStatus:"OK",
packingNumber:"",
fromLocationCode:item.rawLocationCode,
qty: item.qty,
uom: item.uom
}
@ -139,9 +147,6 @@
}
}
this.caclcQty();
if (this.$refs.issueRequest != undefined) {
this.$refs.issueRequest.update()
}
},
caclcQty() {
@ -153,14 +158,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 = ""
})

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>

5
pages/scrap/coms/comScrapDetailCard.vue

@ -104,6 +104,7 @@
detail(item) {
this.showItem = item;
console.log("提交参数", JSON.stringify(item));
this.$refs.jobDetailPopup.openPopup(item)
},
remove(item) {
@ -111,15 +112,13 @@
res => {
if (res) {
item.scaned = false
item.record = {}
// item.record.qty = 0;
this.$forceUpdate()
this.$emit('remove', item)
}
});
},
confirm(qty) {
this.editItem.record.qty = qty;
this.editItem.handleQty = qty;
this.$emit('updateData')
}
}

4
pages/scrap/job/scrapJobDetail.vue

@ -385,11 +385,11 @@
},
scanPopupGetFocus() {
this.$refs.scanPopup.getfocus();
this.$refs.scanPopup.packGetFocus();
},
scanPopupLoseFocus() {
this.$refs.scanPopup.losefocus();
this.$refs.scanPopup.packLoseFocus();
},
showCommitSuccessMessage(hint) {

Loading…
Cancel
Save