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

9
pages.json

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

10
pages/issue/coms/comIssueRequestCreator.vue

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

3
pages/issue/request/issueRequestCreate.vue

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

71
pages/productReceipt/coms/comProductDetailCard.vue

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

4
pages/productReceipt/coms/comProductJobCard.vue

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

2
pages/productReceipt/job/productReceiptJob.vue

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

197
pages/productionReturn/coms/comReturnRequestCreator.vue

@ -1,88 +1,159 @@
<template> <template>
<view class=""> <view class="" style="background-color: #fff;">
<uni-collapse ref="collapse"> <view class="uni-flex uni-column">
<uni-collapse-item :open="true"> <comReturnRequestInfo :workShopCode="dataContent.workshopCode" :dataContent="dataContent">
<com-issue-request-info :workShopCode="dataContent.workshopCode" :dataContent="dataContent"> </comReturnRequestInfo>
</com-issue-request-info> <uni-swipe-action ref="swipeAction">
<u-line /> <view v-for="(item, index) in dataContent.subList" :key="index">
<uni-swipe-action ref="swipeAction"> <uni-swipe-action-item @click="swipeClick($event,item)" :right-options="detailOptions">
<view v-for="(item, index) in dataContent.subList" :key="index"> <item-qty :dataContent="item" :isShowStdPack="false">
<uni-swipe-action-item> </item-qty>
<view class="" style="font-size: 32rpx;margin: 10rpx;"> <view v-if="item.batch!=''" style="margin-left: 10rpx;">
<view class=""> <batch :batch="item.batch" ></batch>
生产线 : {{item.productionLineName}}({{item.productionLineCode}}) </view>
</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>
<u-line /> <u-line />
</view> </uni-swipe-action-item>
</uni-swipe-action> </view>
</uni-swipe-action>
</uni-collapse-item> </view>
</uni-collapse> <request-detail-info-popup ref="jobDetailPopup"></request-detail-info-popup>
<com-message ref="message"></com-message>
</view> </view>
</template> </template>
<script> <script>
import uom from '@/mycomponents/qty/uom.vue' import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import comIssueRequestInfo from '@/pages/issue/coms/comIssueRequestInfo.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 { export default {
emits: ['openDetail'],
components: { components: {
uom itemCompareQty,
}, recommend,
data() { balanceQtyEdit,
return { comMessage,
itemQty,
} comReturnRequestInfo,
requestDetailInfoPopup,
batch
}, },
props: { props: {
dataContent: { dataContent: {
type: Object, type: Object,
default: {} 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: { watch: {
update(){ dataContent(newVal) {
this.$nextTick(r => { this.requestItem = newVal.subList[0];
this.$refs.collapse.resize()
});
}, },
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> </script>

4
pages/productionReturn/coms/comReturnRequestInfo.vue

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

12
pages/productionReturn/request/requestDetail.vue

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

26
pages/productionReturn/request/returnRequestCreate.vue

@ -5,8 +5,8 @@
</view> </view>
<view v-else class="page-wraper"> <view v-else class="page-wraper">
<view class="page-main"> <view class="page-main">
<comReturnRequestInfo ref="issueRequest" :dataContent="detailSource" :isSwipe ="false"> <comReturnRequestCreator ref="issueRequest" :dataContent="detailSource" :isSwipe ="false">
</comReturnRequestInfo> </comReturnRequestCreator>
<button class="btn_add" @click="goScan(false)">+去添加</button> <button class="btn_add" @click="goScan(false)">+去添加</button>
</view> </view>
@ -36,6 +36,7 @@
updateTitle, updateTitle,
navigateBack, navigateBack,
getRemoveOption, getRemoveOption,
getCurrDateOneMonthsTimes
} from '@/common/basic.js'; } from '@/common/basic.js';
import comBlankView from '@/mycomponents/common/comBlankView.vue' import comBlankView from '@/mycomponents/common/comBlankView.vue'
@ -44,7 +45,6 @@
import comScanReturnPack from '@/pages/productionReturn/coms/comScanReturnPack.vue' import comScanReturnPack from '@/pages/productionReturn/coms/comScanReturnPack.vue'
import comMessage from '@/mycomponents/common/comMessage.vue' import comMessage from '@/mycomponents/common/comMessage.vue'
import comReturnRequestCreator from '@/pages/productionReturn/coms/comReturnRequestCreator.vue' import comReturnRequestCreator from '@/pages/productionReturn/coms/comReturnRequestCreator.vue'
import comIssueRequestInfo from '@/pages/issue/coms/comIssueRequestInfo.vue'
export default { export default {
name: '', name: '',
components: { components: {
@ -53,7 +53,7 @@
jobDetailPopup, jobDetailPopup,
comScanReturnPack, comScanReturnPack,
comMessage, comMessage,
comReturnRequestCreator comReturnRequestCreator,
}, },
data() { data() {
return { return {
@ -95,7 +95,12 @@
if (this.detailSource.subList.length == 0) { if (this.detailSource.subList.length == 0) {
this.detailSource = { this.detailSource = {
workshopCode: item.workshopCode, 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", status: "1",
totalQty: 0, totalQty: 0,
subList: [] subList: []
@ -126,6 +131,9 @@
workStationCode: item.workStationCode, workStationCode: item.workStationCode,
itemCode: item.itemCode, itemCode: item.itemCode,
itemName: item.itemName, itemName: item.itemName,
inventoryStatus:"OK",
packingNumber:"",
fromLocationCode:item.rawLocationCode,
qty: item.qty, qty: item.qty,
uom: item.uom uom: item.uom
} }
@ -139,9 +147,6 @@
} }
} }
this.caclcQty(); this.caclcQty();
if (this.$refs.issueRequest != undefined) {
this.$refs.issueRequest.update()
}
}, },
caclcQty() { caclcQty() {
@ -153,14 +158,17 @@
}, },
setParams() { setParams() {
//退
if(this.fromType=="ReturnToStore"){ if(this.fromType=="ReturnToStore"){
this.detailSource.isOK = true this.detailSource.isOK = true
this.detailSource.dueTime = getCurrDateOneMonthsTimes()
this.detailSource.subList.forEach(res => { this.detailSource.subList.forEach(res => {
res.batch ="000000" res.batch ="000000"
}) })
//退
}else if(this.fromType=="ReturnToHold"){ }else if(this.fromType=="ReturnToHold"){
this.detailSource.isOK = false this.detailSource.isOK = false
this.detailSource.dueTime = getCurrDateOneMonthsTimes()
this.detailSource.subList.forEach(res => { this.detailSource.subList.forEach(res => {
res.batch = "" res.batch = ""
}) })

4
pages/purchaseReturn/record/returnRecord.vue

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

2
pages/purchaseReturn/request/returnRequest.vue

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

4
pages/scrap/job/scrapJobDetail.vue

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

Loading…
Cancel
Save