Browse Source

客户退货确认,隔离退料确认。物料隔离确认

intex
lijuncheng 5 days ago
parent
commit
7b2843fcca
  1. 170
      src/api/request2.js
  2. 18
      src/common/directory.js
  3. 24
      src/common/style/new_style.css
  4. 7
      src/mycomponents/detail/comDetailCard.vue
  5. 49
      src/mycomponents/receive/receiveBottom.vue
  6. 36
      src/mycomponents/receive/receiveNumber.vue
  7. 46
      src/mycomponents/receive/receiveStatus.vue
  8. 41
      src/mycomponents/receive/receiveTop.vue
  9. 91
      src/mycomponents/receive/recordComDetailCard.vue
  10. 41
      src/mycomponents/receive/recordComMainCard.vue
  11. 104
      src/pages.json
  12. 34
      src/pages/customerReturn/coms/comReturnRecordCard.vue
  13. 355
      src/pages/customerReturn/record/recordList.vue
  14. 419
      src/pages/customerReturn/record/recordListDetail.vue
  15. 2
      src/pages/index/index.vue
  16. 182
      src/pages/itemHold/coms/comDetailCard.vue
  17. 206
      src/pages/itemHold/coms/comMoveRecordCard.vue
  18. 354
      src/pages/itemHold/record/recordList.vue
  19. 425
      src/pages/itemHold/record/recordListDetail.vue
  20. 353
      src/pages/productionReturn/record/returnToHoldRecordList.vue
  21. 424
      src/pages/productionReturn/record/returnToHoldRecordListDetail.vue

170
src/api/request2.js

@ -3029,6 +3029,57 @@ export function customerReturnRecordSubmit(params) {
});
}
/**
* 客户退货 记录列表
* @param {*} params
*/
export function getCustomerReturnRecordList(params) {
return request({
url: baseApi + "/wms/customerreturn-record-detail/senior",
method: "post",
data: params,
});
}
/**
* 客户退货 记录详情
* @param {*} params
*/
export function getCustomerReturnRecordDetail(id) {
return request({
url: baseApi + "/wms/customerreturn-record-detail/page?masterId=" + id,
method: "get",
data: {},
});
}
/**
* 客户退货 拒收
* @param {*} params
*/
export function customerReturnRecordRefuse(id) {
return request({
url: baseApi + "/wms/customerreturn-record-main/refuse?id=" + id,
method: "put",
data: {},
});
}
/**
* 客户退货 接收
* @param {*} params
*/
export function customerReturnRecordReceive(id) {
return request({
url: baseApi + "/wms/customerreturn-record-main/receive?id=" + id,
method: "put",
data: {},
});
}
/**
* 调拨入库 任务
* status 任务状态
@ -3694,6 +3745,59 @@ export function productionReturnRecordSubmit(params) {
});
}
/**
* 生产隔离退料 记录列表
* @param {*} params
*/
export function getProductionReturnRecordList(params) {
return request({
url: baseApi + "/wms/productionreturn-record-detail-hold/senior",
method: "post",
data: params,
});
}
/**
* 生产隔离退料 记录详情
* @param {*} params
*/
export function getProductionReturnRecordDetail(id) {
return request({
url: baseApi + "/wms/productionreturn-record-detail/page?masterId=" + id,
method: "get",
data: {},
});
}
/**
* 生产隔离退料 拒收
* @param {*} params
*/
export function productionReturnRecordRefuse(id) {
return request({
url: baseApi + "/wms/productionreturn-record-main/refuse?id=" + id,
method: "put",
data: {},
});
}
/**
* 生产隔离退料 接收
* @param {*} params
*/
export function productionReturnRecordReceive(id) {
return request({
url: baseApi + "/wms/productionreturn-record-main/receive?id=" + id,
method: "put",
data: {},
});
}
/**
* 计划外出库申请
@ -4495,6 +4599,21 @@ export function planReceiptSubmit(params) {
});
}
/**
* 按计划完工提交 李达明
* @param {*}
*/
export function createByPlanSubmit(params) {
return request({
url: baseApi + "/wms/productreceipt-record-main/createByPlanToSenior",
method: "post",
data: params
});
}
/**
* @param {Object} params 创建计划完工后调用上架申请 number
*/
@ -4612,6 +4731,57 @@ export function getBalanceByBusinessType(params) {
});
}
/**
* 物料隔离 记录列表
* @param {*} params
*/
export function getInventoryMoveRecordList(params) {
return request({
url: baseApi + "/wms/inventorymove-record-detail/senior",
method: "post",
data: params,
});
}
/**
* 物料隔离 记录详情
* @param {*} params
*/
export function getInventoryMoveRecordDetail(id) {
return request({
url: baseApi + "/wms/inventorymove-record-detail/page?masterId=" + id,
method: "get",
data: {},
});
}
/**
* 物料隔离 拒收
* @param {*} params
*/
export function inventoryMoveRecordRefuse(id) {
return request({
url: baseApi + "/wms/inventorymove-record-main/refuse?id=" + id,
method: "put",
data: {},
});
}
/**
* 物料隔离 接收
* @param {*} params
*/
export function inventoryMoveRecordReceive(id) {
return request({
url: baseApi + "/wms/inventorymove-record-main/receive?id=" + id,
method: "put",
data: {},
});
}

18
src/common/directory.js

@ -1,4 +1,5 @@
let jobStatusList = [];
let receiveStatusList = [];
let itemStatusList = [];
let itemTypeList = [];
let locationTypeList = [];
@ -42,6 +43,7 @@ export function getBusinessTypeDesc(type) {
//获取字典信息
export function clearCacheData() {
jobStatusList = [];
receiveStatusList=[];
itemStatusList = [];
itemTypeList = [];
locationTypeList = [];
@ -138,6 +140,22 @@ export function getJobStateInfo(value) {
return resultInfo
}
export function getReceiveStateInfo(value) {
var resultInfo = "";
if (receiveStatusList.length == 0) {
receiveStatusList = getDirectoryInfo("receive_status")
}
if (receiveStatusList.length > 0) {
for (let item of receiveStatusList) {
if (item.value == value) {
resultInfo = item
break;
}
}
}
return resultInfo
}
//获取任务状态样式
export function getJobStateStyle(value) {
let item = getJobStateInfo(value);

24
src/common/style/new_style.css

@ -2308,6 +2308,30 @@ button::after {
border-radius: 10rpx;
}
.receive_state_no_ok {
font-size: 28rpx;
background: rgba(236, 156, 0, 0.2);
color: #EC9C00;
padding: 10rpx 20rpx 10rpx 20rpx;
border-radius: 10rpx;
}
.receive_state_ok {
font-size: 28rpx;
background: rgba(95, 203, 148, 0.2);
color: #22AF68;
padding: 10rpx 20rpx 10rpx 20rpx;
border-radius: 10rpx;
}
.receive_state_reject {
font-size: 28rpx;
background: rgba(95, 203, 148, 0.2);
color: #22AF68;
padding: 10rpx 20rpx 10rpx 20rpx;
border-radius: 10rpx;
}
.pop_detail {
background-color: #fff;
width: 100%;

7
src/mycomponents/detail/comDetailCard.vue

@ -13,7 +13,7 @@
<uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions"
style='padding:0px 0px 5px 0px;align-items: center;'>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false">
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="isShowToLocation">
</recommend>
</uni-swipe-action-item>
@ -67,6 +67,11 @@
type: Boolean,
default: true
},
isShowToLocation: {
type: Boolean,
default: false
},
locationAreaTypeList: {
type: Array,
default: null

49
src/mycomponents/receive/receiveBottom.vue

@ -0,0 +1,49 @@
<template>
<!-- style="margin-top: 10rpx;margin-bottom: 10rpx;" class="uni-flex uni-row space-between u-col-center" -->
<view class="task_item">
<view class="uni-flex space-between u-col-center">
<view class="uni-flex uni-row u-col-center">
<image class="card_icon_normal" src="/static/icons/icon_customer.svg" alt="" />
<text style="font-size: 32rpx;" >{{dataContent.creator}}</text>
</view>
<view class="uni-flex uni-row u-col-center">
<image class="card_icon_normal" src="/static/icons/icon_date.svg" alt="" />
<text style="font-size: 32rpx;" class="center">{{formatDate(dataContent.createTime)}}</text>
</view>
</view>
</view>
</template>
<script>
import {
dateFormat
} from '@/common/basic.js';
export default {
components: {
},
data() {
return {
};
},
watch: {},
props: {
dataContent: {
type: Object,
default: {}
}
},
methods: {
formatDate: function(val) {
return dateFormat(val)
}
}
}
</script>
<style lang="scss">
</style>

36
src/mycomponents/receive/receiveNumber.vue

@ -0,0 +1,36 @@
<template>
<view class="task_number">
<!-- <text>任务编号 : {{number}}</text> -->
<text> {{number}}</text>
</view>
</template>
<script>
export default {
components: {},
data() {
return {
};
},
watch: {
},
props: {
number: {
type: String,
default: ''
},
},
methods: {}
}
</script>
<style lang="scss">
</style>
<style>
</style>

46
src/mycomponents/receive/receiveStatus.vue

@ -0,0 +1,46 @@
<template>
<view >
<text :class="statusStyle(receiveStatus)">
{{ receiveStatusInfo.label}}
</text>
</view>
</template>
<script>
import {
getReceiveStateInfo,
getJobStateInfo
} from '@/common/directory.js';
export default {
components: {
},
data() {
return {
receiveStatusInfo: {}
};
},
watch: {},
props: {
receiveStatus: {
type: String,
default: ""
}
},
mounted() {},
methods: {
statusStyle(value) {
this.receiveStatusInfo = getReceiveStateInfo(value);
return getReceiveStateInfo(value).remark
}
}
}
</script>
<style>
</style>

41
src/mycomponents/receive/receiveTop.vue

@ -0,0 +1,41 @@
<template>
<view class="task_top">
<view class="uni-flex space-between u-col-center align-center" style="margin-bottom: 10rpx;">
<receive-number :number="dataContent.number"></receive-number>
<receive-status :receiveStatus="dataContent.receiveStatus"></receive-status>
</view>
</view>
</template>
<script>
import receiveNumber from '@/mycomponents/receive/receiveNumber.vue'
import receiveStatus from '@/mycomponents/receive/receiveStatus.vue'
export default {
components: {
receiveNumber,
receiveStatus
},
data() {
return {
};
},
watch: {},
props: {
dataContent: {
type: Object,
default: {}
},
},
methods: {
openDetail(item) {
this.$emit("openDetail", this.dataContent);
},
}
}
</script>
<style lang="scss">
</style>

91
src/mycomponents/receive/recordComDetailCard.vue

@ -0,0 +1,91 @@
<template>
<view class="task_item">
<view class="task_text" style="border-top: 1px solid #dedede;padding-top: 20rpx;margin-top: 20rpx;">
<!-- 主子表拆分没有数量了 -->
<itemCompareQty :dataContent="dataContent"
:isShowPackCount="isShowPackCount"
:handleQty="dataContent.handleQty" :isShowPackUnit="false"
></itemCompareQty>
<!-- :objTextStyle="{'fontWeight':'bold','fontSize':'40rpx'}" -->
<div class="u-p-l-10">
<pack v-if="isShowPack && dataContent.packingNumber!=null" :packingCode="dataContent.packingNumber">
</pack>
<batch v-if="isShowBatch && dataContent.batch!=null" :batch="dataContent.batch"></batch>
<view class="u-flex u-row-between">
<location v-if="isShowFromLocation&&dataContent.fromLocationCode" title="来源库位" :locationCode="dataContent.fromLocationCode">
</location>
</view>
<to-location v-if="isShowToLocation" title="目标库位" :locationCode="dataContent.toLocationCode||dataContent.locationCode">
</to-location>
</div>
</view>
</view>
</template>
<script>
import pack from '@/mycomponents/balance/pack.vue'
import location from '@/mycomponents/balance/location.vue'
import toLocation from '@/mycomponents/balance/toLocation.vue'
import batch from '@/mycomponents/balance/batch.vue'
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import level from '@/mycomponents/balance/level.vue'
export default {
components: {
pack,
location,
toLocation,
batch,
itemCompareQty,
level
},
data() {
return {};
},
props: {
dataContent: {
type: Object,
default: {}
},
isShowContainer: {
type: Boolean,
default: true
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowFromLocation: {
type: Boolean,
default: true
},
isShowToLocation: {
type: Boolean,
default: true
},
isShowDeliverType: {
type: Boolean,
default: false
},
isShowPackCount: {
type: Boolean,
default: false
}
},
methods: {
}
}
</script>
<style lang="scss">
</style>

41
src/mycomponents/receive/recordComMainCard.vue

@ -0,0 +1,41 @@
<template>
<view>
<view class="task_card">
<receiveTop :dataContent="dataContent"></receiveTop>
<!-- <view class="split_line"></view> -->
<slot></slot>
<view class="split_line"></view>
<receiveBottom :dataContent="dataContent"></receiveBottom>
</view>
</view>
</template>
<script>
import receiveTop from '@/mycomponents/receive/receiveTop.vue'
import receiveBottom from '@/mycomponents/receive/receiveBottom.vue'
export default {
components: {
receiveTop,
receiveBottom,
},
data() {
return {};
},
props: {
dataContent: {
type: Object,
default: {}
},
},
methods: {
}
}
</script>
<style lang="scss">
</style>

104
src/pages.json

@ -1010,6 +1010,42 @@
}
},
{
"path": "pages/productionReturn/record/returnToHoldRecordList",
"style": {
"navigationBarTitleText": "隔离退料接收确认",
"enablePullDownRefresh": true,
"titleNView": {
// "autoBackButton": "true",
"buttons": [
//
{
"float": "right",
"fontSize": "58rpx", //
"text": "\ue696",
"fontSrc": "/static/ali_icon/iconfont.ttf"
},
{
"float": "right",
"fontSize": "52rpx", //
"text": "\ue6e2",
"fontSrc": "/static/ali_icon/iconfont.ttf"
}
]
}
}
},
{
"path": "pages/productionReturn/record/returnToHoldRecordListDetail",
"style": {
"navigationBarTitleText": "隔离退料接收确认详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/productionReturn/request/returnToStoreRequest",
"style": {
@ -1051,6 +1087,7 @@
"enablePullDownRefresh": false
}
},
{
"path": "pages/deliver/job/deliverJob",
"style": {
@ -1592,6 +1629,39 @@
"enablePullDownRefresh": false
}
},
{
"path": "pages/customerReturn/record/recordList",
"style": {
"navigationBarTitleText": "客户退货接收确认",
"enablePullDownRefresh": true,
"titleNView": {
// "autoBackButton": "true",
"buttons": [
//
{
"float": "right",
"fontSize": "58rpx", //
"text": "\ue696",
"fontSrc": "/static/ali_icon/iconfont.ttf"
},
{
"float": "right",
"fontSize": "52rpx", //
"text": "\ue6e2",
"fontSrc": "/static/ali_icon/iconfont.ttf"
}
]
}
}
},
{
"path": "pages/customerReturn/record/recordListDetail",
"style": {
"navigationBarTitleText": "客户退货接收确认详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/customerReturn/request/customerReturnRequest",
@ -1633,6 +1703,7 @@
"enablePullDownRefresh": false
}
},
{
"path": "pages/productReceipt/job/completeReceiveJob",
"style": {
@ -2487,6 +2558,39 @@
"navigationBarTitleText": "无计划报工",
"enablePullDownRefresh": false
}
},
{
"path": "pages/itemHold/record/recordList",
"style": {
"navigationBarTitleText": "物料隔离接收确认",
"enablePullDownRefresh": true,
"titleNView": {
// "autoBackButton": "true",
"buttons": [
//
{
"float": "right",
"fontSize": "58rpx", //
"text": "\ue696",
"fontSrc": "/static/ali_icon/iconfont.ttf"
},
{
"float": "right",
"fontSize": "52rpx", //
"text": "\ue6e2",
"fontSrc": "/static/ali_icon/iconfont.ttf"
}
]
}
}
},
{
"path": "pages/itemHold/record/recordListDetail",
"style": {
"navigationBarTitleText": "物料隔离接收确认详情",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {

34
src/pages/customerReturn/coms/comReturnRecordCard.vue

@ -0,0 +1,34 @@
<template>
<recordComMainCard :dataContent="dataContent">
<recordComDetailCard :dataContent="dataContent"></recordComDetailCard>
</recordComMainCard>
</template>
<script>
import recordComMainCard from '@/mycomponents/receive/recordComMainCard.vue'
import recordComDetailCard from '@/mycomponents/receive/recordComDetailCard.vue'
export default {
components: {
recordComMainCard,
recordComDetailCard
},
data() {
return {};
},
props: {
dataContent: {
type: Object,
default: {}
},
},
methods: {
}
}
</script>
<style lang="scss">
</style>

355
src/pages/customerReturn/record/recordList.vue

@ -0,0 +1,355 @@
<template>
<view class="uni-flex" style="flex-direction: column;;">
<job-filter ref="filter" otherTitle="ASN" :isShowProductionLineCode="false" :isShowItemCode="false"
:isShowQurery='true' @onQuery="getListByFilter">
</job-filter>
<com-empty-view v-if="recordList.length==0"></com-empty-view>
<view v-if="recordList.length>0">
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in recordList" :key="index">
<uni-swipe-action-item
>
<comReturnRecordCard :dataContent="item" @click='openJobDetail(item)'>
</comReturnRecordCard>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
<job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></job-list-popup>
<job-info-popup ref='jobInfoPopup'></job-info-popup>
<uni-load-more :status="loadingType" />
</view>
<win-scan-button @goScan='openScanPopup' v-if="recordList.length>0"></win-scan-button>
<winScanPackJob ref="scanPopup" @getResult='getScanResult'></winScanPackJob>
<jobList ref="recordList" @selectItem="selectItem"></jobList>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getCustomerReturnRecordList,
cancleTakeProductionReceiptJob,
} from '@/api/request2.js';
import {
goHome,
updateTitle
} from '@/common/basic.js';
import {
planRefreshTime,
productionReceiptJobFilter
} from '@/common/config.js';
import {
getDetailOption,
getDetailGiveupOption
} from '@/common/array.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comReturnRecordCard from '@/pages/customerReturn/coms/comReturnRecordCard.vue'
import jobListPopup from '@/pages/productionReceipt/coms/jobListPopup.vue'
import jobInfoPopup from '@/pages/productionReceipt/coms/jobInfoPopup.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue"
import jobList from '@/mycomponents/jobList/jobList.vue'
export default {
name: 'productionReceipt',
components: {
comEmptyView,
jobFilter,
comReturnRecordCard,
jobListPopup,
jobInfoPopup,
winScanPackJob,
winScanButton,
jobList
},
data() {
return {
recordList: [],
pageNo: 1,
pageSize: 10,
totalCount: 0,
loadingType: "nomore",
checkedToday: false,
checkedWaitTask: false,
todayTime: "",
detailOptions: [],
detailGiveupOptions: [],
title: '',
scanMessage: "",
filterItemCode: "",
queryParams:{
creationTime:"",
receiveStatus:"",
itemCode:""
}
};
},
onLoad(option) {
this.title = option.title
},
onShow() {
this.getList('refresh')
},
onReady() {
this.detailOptions = getDetailOption();
this.detailGiveupOptions = getDetailGiveupOption();
},
onReachBottom() {
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList('more')
},
onPullDownRefresh() {
this.getList('refresh')
},
//退
onBackPress(options) {
if (options.from === 'navigateBack') {
uni.navigateBack({
delta: 1
})
return false;
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
this.$refs.filter.openFilter();
}
},
methods: {
setQueryParam() {
var filterParams = []
//
if (this.queryParams.creationTime) {
filterParams.push({
column: "create_time",
action: "betweeen",
value: this.queryParams.creationTime
})
}
//
if (this.queryParams.receiveStatus) {
filterParams.push({
column: "receiveStatus",
action: "in",
value: this.queryParams.receiveStatus
})
} else {
filterParams.push({
column: "receiveStatus",
action: "in",
value: "0"
})
}
//
if (this.queryParams.itemCode) {
filterParams.push({
column: "itemCode",
action: "like",
value: this.queryParams.itemCode
})
this.filterItemCode = this.queryParams.itemCode
}else {
if(this.filterItemCode){
filterParams.push({
column: "itemCode",
action: "like",
value: this.filterItemCode
})
}
}
return filterParams;
},
getList(type) {
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.recordList = [];
}
var queryFiltersParams = this.setQueryParam()
var params = {
filters: queryFiltersParams,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
console.log("查询条件",JSON.stringify(params))
getCustomerReturnRecordList(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
this.totalCount = res.data.total
updateTitle(this.title + "(" + this.totalCount + ")");
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
list.forEach(item=>{
item.packingNumber =item.toPackingNumber
})
this.recordList = type === "refresh" ? list : this.recordList.concat(list);
this.pageNo++;
}).catch(error => {
if (type === "refresh") {
uni.stopPullDownRefresh();
}
this.loadingType = "";
updateTitle(this.title);
uni.hideLoading();
that.showMessage(error)
})
},
openJobDetail(item, scanMessage = '') {
uni.navigateTo({
url: './recordListDetail?id=' + item.masterId + '&receiveStatus=' + item.receiveStatus +
'&scanMessage=' + scanMessage + '&title=' + this.title
});
this.scanMessage = ""
},
showItemList(itemList) {
this.$refs.jobListPopup.openPopup(itemList);
},
selectedItem(item) {
this.openJobDetail(item);
},
openjobInfoPopup(item) {
this.$refs.jobInfoPopup.openPopup(item)
},
showMessage(message) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.packLoseFocus()
}
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.packGetFocus()
}
}
});
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
selectItem(item) {
this.$refs.scanPopup.closeScanPopup();
this.openJobDetail(item, this.scanMessage);
},
getScanResult(result) {
try {
this.scanMessage = ""
var filters = [{
column: "toPackingNumber",
action: "in",
value: result.package.number + "," + result.package.parentNumber
},
{
column: "receiveStatus",
action: "in",
value: '0'
},
{
column: "toBatch",
action: "==",
value: result.label.batch
},
{
column: "itemCode",
action: "==",
value: result.label.itemCode
},
]
getCustomerReturnRecordList({
filters: filters,
pageNo: 1,
pageSize: 100,
}).then(res => {
this.scanMessage = result.scanMessage
let resultList = res.data.list;
if (resultList.length > 0) {
resultList.forEach(item => {
item.title = item.number;
item.selected = false
})
let list = []
resultList.forEach(item => {
if (!list.find(subItem => subItem.title == item.title)) {
list.push(item)
}
})
if (list.length > 1) {
this.$refs.recordList.openList(list)
} else {
this.selectItem(list[0])
}
} else {
this.showMessage("未查找到任务\n" + "扫描[" + result.scanMessage + "]")
}
}).catch(error => {
this.showMessage(error + "\n扫描[" + result.scanMessage + "]")
})
} catch (e) {
this.showMessage(e.message)
}
},
getListByFilter(params) {
this.queryParams.creationTime=params.creationTime
this.queryParams.receiveStatus=params.receiveStatus
this.queryParams.itemCode=params.itemCode
this.getList('refresh')
},
}
}
</script>
<style scoped lang="scss">
</style>

419
src/pages/customerReturn/record/recordListDetail.vue

@ -0,0 +1,419 @@
<template>
<view class="page-wraper">
<view class="page-main">
<view class="page-header">
<view class="header-view">
<view class="header_job_top">
<receive-top :dataContent="recordContent"></receive-top>
</view>
</view>
</view>
<view v-if="detailSource.length>0" class="uni-flex uni-row "
style=";margin-top: 15rpx; margin-bottom: 15rpx; margin-left: 20rpx; text-align: right;">
<view class="font_default" style="display: block; font-weight: bold;">
整单接收
</view>
<view class="uni-flex" style="margin-left: 20rpx; align-items: center; text-align: center;">
<u-switch v-model="isAllReceived" active-color="#5FCB94" inactive-color="#eee" size="35"
@change="switchChange"></u-switch>
</view>
</view>
<scroll-view scroll-y="true">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<com-detail-card :dataContent="item" :index="index" :settingParam="recordContent"
@remove="updateData" :isShowToLocation="true" @updateData="updateData"
@openDetail="openDetail">
</com-detail-card>
<view class='split_line'></view>
</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=" uni-flex uni-row">
<button class="btn_single_commit" style="width: 280rpx;" hover-class="btn_commit_after"
@click="reject">拒绝</button>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" style="width: 280rpx;" hover-class="btn_commit_after"
@click="receive" :disabled="receiveDisable">接收</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-pack ref="scanPopup" @getResult='getScanResult' headerType="HPQ,HMQ">></win-scan-pack>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getCustomerReturnRecordDetail,
customerReturnRecordRefuse,
customerReturnRecordReceive,
} from '@/api/request2.js';
import {
goHome,
navigateBack,
getCurrDateTime,
getInventoryStatusName,
getSwitchInfoByCode
} from '@/common/basic.js';
import {
getDataSource,
calcHandleQty,
getScanCount
} from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue"
import detailInfoPopup from '@/pages/productionReceipt/coms/detailInfoPopup.vue'
import receiveTop from '@/mycomponents/receive/receiveTop.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
export default {
components: {
winScanButton,
winScanPack,
comDetailCard,
detailInfoPopup,
receiveTop
},
data() {
return {
id: '',
scanCount: 0,
recordContent: {}, //
subList: [], //subList
detailSource: [], //
fromLocationCode: "",
toLocationCode: "",
isAllReceived: false,
receiveDisable: true //
};
},
onLoad(option) {
uni.setNavigationBarTitle({
title: option.title + '详情'
})
this.id = option.id;
if (this.id != undefined) {
//
if (option.receiveStatus == "0") {
this.getDetail();
}
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
//
onBackPress(e) {
//
if (e.from == 'backbutton') {
uni.navigateBack();
return true;
}
},
mounted() {
},
methods: {
//
getDetail() {
var that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getCustomerReturnRecordDetail(that.id).then(res => {
uni.hideLoading();
this.isAllReceived= false
this.receiveDisable = true
if (res.data == null) {
that.showMessage('未获取到详情');
} else {
if (res.data.list.length > 0) {
that.recordContent = res.data.list[0];
that.subList = res.data.list;
that.subList.forEach(item => {
item.batch = item.toBatch;
item.packingNumber = item.toPackingNumber;
})
that.detailSource = getDataSource(that.subList)
} else {
that.showMessage('列表数据为0');
}
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
calcHandleQty() {
calcHandleQty(this.detailSource);
this.updateBtn()
this.continueScan()
this.$forceUpdate();
},
updateBtn() {
this.scanCount = getScanCount(this.subList);
//
if (this.scanCount == this.subList.length) {
this.receiveDisable = false;
}
},
//
continueScan() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == this.subList.length) {
this.closeScanPopup();
} else {
this.scanPopupGetFocus();
}
},
updateData() {
this.calcHandleQty();
},
openDetail(item) {
this.$refs.detailInfoPopup.openPopup(item)
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
closeScanPopup() {
this.$refs.scanPopup.closeScanPopup();
},
getScanResult(result) {
try {
var itemCode = result.label.itemCode;
var packingNumber = result.package.number;
var batch = result.label.batch;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else {
var itemDetail = detail.subList.find(r => {
return r.packingNumber == packingNumber &&
r.batch == batch
})
if (itemDetail == undefined) {
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]不在列表中")
} else {
if (itemDetail.scaned) {
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]已经扫描")
} else {
itemDetail.scaned = true;
itemDetail.handleQty = Number(itemDetail.qty)
this.calcHandleQty();
}
}
}
} catch (e) {
this.showMessage(e.message)
}
},
reject() {
this.showQuestionMessage("是否拒绝接收?", res => {
if (res) {
uni.showLoading({
title: "提交中....",
mask: true
});
customerReturnRecordRefuse(this.id).then(res=>{
uni.hideLoading()
if(res.data){
this.showCommitSuccessMessage("拒绝成功")
}else {
this.showErrorMessage("拒绝失败[" + res.msg + "]")
}
}).catch(error=>{
uni.hideLoading()
this.showErrorMessage(error)
})
}
})
},
receive() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
if (this.scanCount < this.subList.length) {
this.showErrorMessage("还有未扫描的数据,请先扫描")
return;
}
//
if (this.scanCount == this.subList.length) {
this.receiveSubmit();
}
},
showMessageHint(hint, callback) {
this.$refs.comMessage.showErrorMessage(hint, res => {
if (res) {
callback()
}
});
},
receiveSubmit() {
uni.showLoading({
title: "提交中....",
mask: true
});
customerReturnRecordReceive(this.id).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("接收成功")
} else {
this.showErrorMessage("接收失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
showMessage(message) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
})
},
showErrorMessage(message) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
})
},
showQuestionMessage(message, callback) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showQuestionMessage(message, res => {
if (res) {
callback(res);
}
});
})
},
scanPopupGetFocus() {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.getfocus();
}
},
scanPopupLoseFocus() {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.losefocus();
}
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
navigateBack(1)
})
},
switchChange(isOn) {
this.isAllReceived = isOn
if(this.isAllReceived){
this.detailSource.forEach(item=>{
item.subList.forEach(info=>{
info.scaned=true;
info.handleQty=Number(info.qty)
})
})
this.calcHandleQty();
}else {
this.$refs.comMessage.showQuestionMessage("是否要关闭整单收货?", res => {
if (res) {
this.getDetail()
}
});
}
}
}
}
</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>

2
src/pages/index/index.vue

@ -363,7 +363,7 @@
"inventory_status", "container_type", "pack_unit", "unplanned_receipt_reason",
"unplanned_issue_reason", "scrap_reason", "inspect_failed_reason",
"request_status", "inspect_type", "next_action", "sample_method", "transfer_mode",
"count_stage", "inspect_result", "area_type","count_scope_type","priority"
"count_stage", "inspect_result", "area_type","count_scope_type","priority","receive_status",
]
}
getDictionaryItem(params).then(res => {

182
src/pages/itemHold/coms/comDetailCard.vue

@ -0,0 +1,182 @@
<template>
<view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowStdPack="false">
</item-compare-qty>
</template>
<view class="" v-for="(item,index) in dataContent.subList" :key="index">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions"
style='padding:0px 0px 5px 0px;align-items: center;'>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="isShowToLocation">
</recommend>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</uni-collapse-item>
</uni-collapse>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance" @confirm="confirm"></balance-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
:locationAreaTypeList="locationAreaTypeList"></win-scan-location>
<comMessage ref="message"></comMessage>
</view>
</template>
<script>
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import {
getDetailOption,
getPurchaseReceiptOption
} from '@/common/array.js';
export default {
emits: ['openDetail', "updateData"],
components: {
itemCompareQty,
recommend,
balanceQtyEdit,
winScanLocation
},
props: {
dataContent: {
type: Object,
default: null
},
settingParam: {
type: Object,
default: null
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowLocation: {
type: Boolean,
default: true
},
isShowToLocation: {
type: Boolean,
default: false
},
locationAreaTypeList: {
type: Array,
default: null
},
queryBalance: {
type: Boolean,
default: true
},
isShowStatus: {
type: Boolean,
default: true
},
},
watch: {
dataContent: {
handler(newName, oldName) {
if (this.dataContent.subList.length > 0) {
this.$nextTick(res => {
setTimeout(() => {
if (this.$refs.collapse1) {
this.$refs.collapse1.resize();
}
}, 500)
})
}
},
immediate: true,
deep: true
}
},
data() {
return {
option: [],
showItem: {},
locatonItem: {},
editItem: {},
detailOptions: [],
scanOptions: []
}
},
mounted() {
if (this.detailOptions.length == 0) {
this.detailOptions = getDetailOption();
}
if (this.scanOptions.length == 0) {
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, false)
}
// this.showLocation();
},
methods: {
swipeClick(e, item) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "库位") {
this.showLocation(item)
} else if (e.content.text == "移除") {
this.remove(item)
}
},
edit(item) {
this.editItem = item;
this.$refs.qtyEdit.openEditPopup(item.balance, item.handleQty);
},
detail(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.balance = {}
item.handleQty = null;
this.$forceUpdate()
this.$emit('remove', item)
}
});
},
confirm(qty) {
this.editItem.handleQty = qty;
this.$emit('updateData')
},
showLocation(item) {
this.locatonItem = item;
this.$refs.scanLocationCode.openScanPopup();
},
//
getLocation(location, code) {
this.locatonItem.toLocationCode = code;
this.$emit('updateData')
},
}
}
</script>
<style>
</style>

206
src/pages/itemHold/coms/comMoveRecordCard.vue

@ -0,0 +1,206 @@
<template>
<view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" >
<uni-collapse-item :open="true">
<template v-slot:title>
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="removeData($event,dataContent)" :right-options="removeOptions">
<item-qty :dataContent="dataContent"
:isShowBalanceQty="false"
:isShowBalance="true"></item-qty>
</uni-swipe-action-item>
</uni-swipe-action>
</template>
<view class="" v-for="(item,index) in dataContent.subList">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item,index)"
:right-options="item.scaned?scanOptions:detailOptions">
<comMovebalance :dataContent="item" :isShowStdPack="false" :isShowPack="true"
:fromInventoryStatus="item.inventoryStatus" :toInventoryStatus="item.toInventoryStatus"
:isShowLocation="true" :allowEditStatus='allowEditStatus'></comMovebalance>
</uni-swipe-action-item>
</uni-swipe-action>
<view class='split_line'></view>
</view>
</uni-collapse-item>
</uni-collapse>
<balanceQtyEdit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="isShowStatus"
:allowEditStatus="allowEditStatus"
:allowEditQty="allowEditQty"
>
</balanceQtyEdit>
<job-detail-popup ref="winHint" :dataContent="showItem"></job-detail-popup>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import balance from '@/mycomponents/balance/balance.vue'
import balanceMove from '@/mycomponents/balance/balanceMove.vue'
import comMovebalance from '@/pages/inventoryMove/coms/comMovebalance.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import {
getDetailOption,
getDetailRemoveOption,
getRemoveOption
} from '@/common/array.js';
export default {
components: {
itemQty,
recommend,
jobDetailPopup,
balance,
balanceQtyEdit,
balanceMove,
comMovebalance,
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
fromInventoryStatus: {
type: String,
default: ""
},
toInventoryStatus: {
type: String,
default: ""
},
isShowStatus: {
type: Boolean,
default: true
},
allowEditStatus: {
type: Boolean,
default: false
},
allowEditQty: {
type: Boolean,
default: false
},
},
watch: {
dataContent: {
handler(newName, oldName) {
if (this.dataContent.subList.length > 0) {
this.$nextTick(res => {
setTimeout(() => {
if (this.$refs.collapse1) {
this.$refs.collapse1.resize();
}
}, 500)
})
}
},
immediate: true,
deep: true
}
},
data() {
return {
option: [],
title: "推荐详情",
showItem: {},
editItem: {},
detailOptions: [],
scanOptions: [],
removeOptions: [],
dataList: []
}
},
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getDetailRemoveOption();
this.removeOptions = getRemoveOption();
},
methods: {
removeData(e, dataContent) {
if (e.content.text == "移除") {
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
this.$emit('removeData', dataContent)
}
});
}
},
swipeClick(e, item, index) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
this.remove(item, index)
}
},
edit(item) {
this.editItem = item;
this.$refs.balanceQtyEdit.openEditPopup(item, item.qty);
},
detail(item) {
this.showItem = item;
this.dataList = [
{
title: "箱码",
content: item.packingNumber
},
{
title: "批次",
content: item.batch
},
{
title: "库位",
content: item.locationCode
},
{
title: "数量",
content: item.qty
},
{
title: "单位",
content: item.uom
}
]
this.$refs.winHint.openScanPopup(this.showItem)
},
remove(item, index) {
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false
item.balance = {}
item.handleQty = null;
this.$emit('removePack', item)
this.$forceUpdate()
}
});
},
confirm(qty) {
this.editItem.handleQty = qty;
this.$emit('updateData')
}
}
}
</script>
<style>
</style>

354
src/pages/itemHold/record/recordList.vue

@ -0,0 +1,354 @@
<template>
<view class="uni-flex" style="flex-direction: column;;">
<job-filter ref="filter" otherTitle="ASN" :isShowProductionLineCode="false" :isShowItemCode="false"
:isShowQurery='true' @onQuery="getListByFilter">
</job-filter>
<com-empty-view v-if="recordList.length==0"></com-empty-view>
<view v-if="recordList.length>0">
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in recordList" :key="index">
<uni-swipe-action-item
>
<comReturnRecordCard :dataContent="item" @click='openJobDetail(item)'>
</comReturnRecordCard>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
<job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></job-list-popup>
<job-info-popup ref='jobInfoPopup'></job-info-popup>
<uni-load-more :status="loadingType" />
</view>
<win-scan-button @goScan='openScanPopup' v-if="recordList.length>0"></win-scan-button>
<winScanPackJob ref="scanPopup" @getResult='getScanResult'></winScanPackJob>
<jobList ref="recordList" @selectItem="selectItem"></jobList>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getInventoryMoveRecordList,
} from '@/api/request2.js';
import {
goHome,
updateTitle
} from '@/common/basic.js';
import {
planRefreshTime,
productionReceiptJobFilter
} from '@/common/config.js';
import {
getDetailOption,
getDetailGiveupOption
} from '@/common/array.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comReturnRecordCard from '@/pages/customerReturn/coms/comReturnRecordCard.vue'
import jobListPopup from '@/pages/productionReceipt/coms/jobListPopup.vue'
import jobInfoPopup from '@/pages/productionReceipt/coms/jobInfoPopup.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue"
import jobList from '@/mycomponents/jobList/jobList.vue'
export default {
name: 'productionReceipt',
components: {
comEmptyView,
jobFilter,
comReturnRecordCard,
jobListPopup,
jobInfoPopup,
winScanPackJob,
winScanButton,
jobList
},
data() {
return {
recordList: [],
pageNo: 1,
pageSize: 10,
totalCount: 0,
loadingType: "nomore",
checkedToday: false,
checkedWaitTask: false,
todayTime: "",
detailOptions: [],
detailGiveupOptions: [],
title: '',
scanMessage: "",
filterItemCode: "",
queryParams:{
creationTime:"",
receiveStatus:"",
itemCode:""
}
};
},
onLoad(option) {
this.title = option.title
},
onShow() {
this.getList('refresh')
},
onReady() {
this.detailOptions = getDetailOption();
this.detailGiveupOptions = getDetailGiveupOption();
},
onReachBottom() {
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList('more')
},
onPullDownRefresh() {
this.getList('refresh')
},
//退
onBackPress(options) {
if (options.from === 'navigateBack') {
uni.navigateBack({
delta: 1
})
return false;
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
this.$refs.filter.openFilter();
}
},
methods: {
setQueryParam() {
var filterParams = []
//
if (this.queryParams.creationTime) {
filterParams.push({
column: "create_time",
action: "betweeen",
value: this.queryParams.creationTime
})
}
//
if (this.queryParams.receiveStatus) {
filterParams.push({
column: "receiveStatus",
action: "in",
value: this.queryParams.receiveStatus
})
} else {
filterParams.push({
column: "receiveStatus",
action: "in",
value: "0"
})
}
//
if (this.queryParams.itemCode) {
filterParams.push({
column: "itemCode",
action: "like",
value: this.queryParams.itemCode
})
this.filterItemCode = this.queryParams.itemCode
}else {
if(this.filterItemCode){
filterParams.push({
column: "itemCode",
action: "like",
value: this.filterItemCode
})
}
}
return filterParams;
},
getList(type) {
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.recordList = [];
}
var queryFiltersParams = this.setQueryParam()
var params = {
filters: queryFiltersParams,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
console.log("查询条件",JSON.stringify(params))
getInventoryMoveRecordList(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
this.totalCount = res.data.total
updateTitle(this.title + "(" + this.totalCount + ")");
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
list.forEach(item=>{
item.packingNumber =item.toPackingNumber
})
this.recordList = type === "refresh" ? list : this.recordList.concat(list);
this.pageNo++;
}).catch(error => {
if (type === "refresh") {
uni.stopPullDownRefresh();
}
this.loadingType = "";
updateTitle(this.title);
uni.hideLoading();
that.showMessage(error)
})
},
openJobDetail(item, scanMessage = '') {
uni.navigateTo({
url: './recordListDetail?id=' + item.masterId + '&receiveStatus=' + item.receiveStatus +
'&scanMessage=' + scanMessage + '&title=' + this.title
});
this.scanMessage = ""
},
showItemList(itemList) {
this.$refs.jobListPopup.openPopup(itemList);
},
selectedItem(item) {
this.openJobDetail(item);
},
openjobInfoPopup(item) {
this.$refs.jobInfoPopup.openPopup(item)
},
showMessage(message) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.packLoseFocus()
}
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.packGetFocus()
}
}
});
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
selectItem(item) {
this.$refs.scanPopup.closeScanPopup();
this.openJobDetail(item, this.scanMessage);
},
getScanResult(result) {
try {
this.scanMessage = ""
var filters = [{
column: "toPackingNumber",
action: "in",
value: result.package.number + "," + result.package.parentNumber
},
{
column: "receiveStatus",
action: "in",
value: '0'
},
{
column: "toBatch",
action: "==",
value: result.label.batch
},
{
column: "itemCode",
action: "==",
value: result.label.itemCode
},
]
getInventoryMoveRecordList({
filters: filters,
pageNo: 1,
pageSize: 100,
}).then(res => {
this.scanMessage = result.scanMessage
let resultList = res.data.list;
if (resultList.length > 0) {
resultList.forEach(item => {
item.title = item.number;
item.selected = false
})
let list = []
resultList.forEach(item => {
if (!list.find(subItem => subItem.title == item.title)) {
list.push(item)
}
})
if (list.length > 1) {
this.$refs.recordList.openList(list)
} else {
this.selectItem(list[0])
}
} else {
this.showMessage("未查找到任务\n" + "扫描[" + result.scanMessage + "]")
}
}).catch(error => {
this.showMessage(error + "\n扫描[" + result.scanMessage + "]")
})
} catch (e) {
this.showMessage(e.message)
}
},
getListByFilter(params) {
this.queryParams.creationTime=params.creationTime
this.queryParams.receiveStatus=params.receiveStatus
this.queryParams.itemCode=params.itemCode
this.getList('refresh')
},
}
}
</script>
<style scoped lang="scss">
</style>

425
src/pages/itemHold/record/recordListDetail.vue

@ -0,0 +1,425 @@
<template>
<view class="page-wraper">
<view class="page-main">
<view class="page-header">
<view class="header-view">
<view class="header_job_top">
<receive-top :dataContent="recordContent"></receive-top>
</view>
</view>
</view>
<view v-if="detailSource.length>0" class="uni-flex uni-row "
style=";margin-top: 15rpx; margin-bottom: 15rpx; margin-left: 20rpx; text-align: right;">
<view class="font_default" style="display: block; font-weight: bold;">
整单接收
</view>
<view class="uni-flex" style="margin-left: 20rpx; align-items: center; text-align: center;">
<u-switch v-model="isAllReceived" active-color="#5FCB94" inactive-color="#eee" size="35"
@change="switchChange"></u-switch>
</view>
</view>
<scroll-view scroll-y="true">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<com-detail-card :dataContent="item" :index="index" :settingParam="recordContent"
@remove="updateData" :isShowToLocation="true" @updateData="updateData"
@openDetail="openDetail">
</com-detail-card>
<view class='split_line'></view>
</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=" uni-flex uni-row">
<button class="btn_single_commit" style="width: 280rpx;" hover-class="btn_commit_after"
@click="reject">拒绝</button>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" style="width: 280rpx;" hover-class="btn_commit_after"
@click="receive" :disabled="receiveDisable">接收</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-pack ref="scanPopup" @getResult='getScanResult' headerType="HPQ,HMQ"></win-scan-pack>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getInventoryMoveRecordDetail,
inventoryMoveRecordRefuse,
inventoryMoveRecordReceive,
} from '@/api/request2.js';
import {
goHome,
navigateBack,
getCurrDateTime,
getInventoryStatusName,
getSwitchInfoByCode
} from '@/common/basic.js';
import {
getDataSource,
calcHandleQty,
getScanCount
} from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue"
import detailInfoPopup from '@/pages/productionReceipt/coms/detailInfoPopup.vue'
import receiveTop from '@/mycomponents/receive/receiveTop.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import comMoveRecordCard from '@/pages/itemHold/coms/comMoveRecordCard.vue'
export default {
components: {
winScanButton,
winScanPack,
comDetailCard,
detailInfoPopup,
receiveTop,
comMoveRecordCard
},
data() {
return {
id: '',
scanCount: 0,
recordContent: {}, //
subList: [], //subList
detailSource: [], //
fromLocationCode: "",
toLocationCode: "",
isAllReceived: false,
receiveDisable: true //
};
},
onLoad(option) {
uni.setNavigationBarTitle({
title: option.title + '详情'
})
this.id = option.id;
if (this.id != undefined) {
//
if (option.receiveStatus == "0") {
this.getDetail();
}
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
//
onBackPress(e) {
//
if (e.from == 'backbutton') {
uni.navigateBack();
return true;
}
},
mounted() {
},
methods: {
//
getDetail() {
var that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getInventoryMoveRecordDetail(that.id).then(res => {
uni.hideLoading();
this.isAllReceived= false
this.receiveDisable = true
if (res.data == null) {
that.showMessage('未获取到详情');
} else {
if (res.data.list.length > 0) {
that.recordContent = res.data.list[0];
that.subList = res.data.list;
that.subList.forEach(item => {
item.batch = item.toBatch;
item.packingNumber = item.toPackingNumber;
item.inventoryStatus= item.fromInventoryStatus
item.toInventoryStatus =item.toInventoryStatus
})
that.detailSource = getDataSource(that.subList)
} else {
that.showMessage('列表数据为0');
}
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
calcHandleQty() {
calcHandleQty(this.detailSource);
this.updateBtn()
this.continueScan()
this.$forceUpdate();
},
updateBtn() {
this.scanCount = getScanCount(this.subList);
//
if (this.scanCount == this.subList.length) {
this.receiveDisable = false;
}
},
//
continueScan() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == this.subList.length) {
this.closeScanPopup();
} else {
this.scanPopupGetFocus();
}
},
updateData() {
this.calcHandleQty();
},
openDetail(item) {
this.$refs.detailInfoPopup.openPopup(item)
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
closeScanPopup() {
this.$refs.scanPopup.closeScanPopup();
},
getScanResult(result) {
try {
var itemCode = result.label.itemCode;
var packingNumber = result.package.number;
var batch = result.label.batch;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else {
var itemDetail = detail.subList.find(r => {
return r.packingNumber == packingNumber &&
r.batch == batch
})
if (itemDetail == undefined) {
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]不在列表中")
} else {
if (itemDetail.scaned) {
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]已经扫描")
} else {
itemDetail.scaned = true;
itemDetail.handleQty = Number(itemDetail.qty)
this.calcHandleQty();
}
}
}
} catch (e) {
this.showMessage(e.message)
}
},
reject() {
this.showQuestionMessage("是否拒绝接收?", res => {
if (res) {
uni.showLoading({
title: "提交中....",
mask: true
});
inventoryMoveRecordRefuse(this.id).then(res=>{
uni.hideLoading()
if(res.data){
this.showCommitSuccessMessage("拒绝成功")
}else {
this.showErrorMessage("拒绝失败[" + res.msg + "]")
}
}).catch(error=>{
uni.hideLoading()
this.showErrorMessage(error)
})
}
})
},
receive() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
if (this.scanCount < this.subList.length) {
this.showErrorMessage("还有未扫描的数据,请先扫描")
return;
}
//
if (this.scanCount == this.subList.length) {
this.receiveSubmit();
}
},
showMessageHint(hint, callback) {
this.$refs.comMessage.showErrorMessage(hint, res => {
if (res) {
callback()
}
});
},
receiveSubmit() {
uni.showLoading({
title: "提交中....",
mask: true
});
inventoryMoveRecordReceive(this.id).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("接收成功")
} else {
this.showErrorMessage("接收失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
showMessage(message) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
})
},
showErrorMessage(message) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
})
},
showQuestionMessage(message, callback) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showQuestionMessage(message, res => {
if (res) {
callback(res);
}
});
})
},
scanPopupGetFocus() {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.getfocus();
}
},
scanPopupLoseFocus() {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.losefocus();
}
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
navigateBack(1)
})
},
switchChange(isOn) {
this.isAllReceived = isOn
if(this.isAllReceived){
this.detailSource.forEach(item=>{
item.subList.forEach(info=>{
info.scaned=true;
info.handleQty=Number(info.qty)
})
})
this.calcHandleQty();
}else {
this.$refs.comMessage.showQuestionMessage("是否要关闭整单收货?", res => {
if (res) {
this.getDetail()
}
});
}
}
}
}
</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>

353
src/pages/productionReturn/record/returnToHoldRecordList.vue

@ -0,0 +1,353 @@
<template>
<view class="uni-flex" style="flex-direction: column;;">
<job-filter ref="filter" otherTitle="ASN" :isShowProductionLineCode="false" :isShowItemCode="false"
:isShowQurery='true' @onQuery="getListByFilter">
</job-filter>
<com-empty-view v-if="recordList.length==0"></com-empty-view>
<view v-if="recordList.length>0">
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in recordList" :key="index">
<uni-swipe-action-item
>
<comReturnRecordCard :dataContent="item" @click='openJobDetail(item)'>
</comReturnRecordCard>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
<job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></job-list-popup>
<job-info-popup ref='jobInfoPopup'></job-info-popup>
<uni-load-more :status="loadingType" />
</view>
<win-scan-button @goScan='openScanPopup' v-if="recordList.length>0"></win-scan-button>
<winScanPackJob ref="scanPopup" @getResult='getScanResult'></winScanPackJob>
<jobList ref="recordList" @selectItem="selectItem"></jobList>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getProductionReturnRecordList,
} from '@/api/request2.js';
import {
goHome,
updateTitle
} from '@/common/basic.js';
import {
planRefreshTime,
productionReceiptJobFilter
} from '@/common/config.js';
import {
getDetailOption,
getDetailGiveupOption
} from '@/common/array.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comReturnRecordCard from '@/pages/customerReturn/coms/comReturnRecordCard.vue'
import jobListPopup from '@/pages/productionReceipt/coms/jobListPopup.vue'
import jobInfoPopup from '@/pages/productionReceipt/coms/jobInfoPopup.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue"
import jobList from '@/mycomponents/jobList/jobList.vue'
export default {
name: 'productionReceipt',
components: {
comEmptyView,
jobFilter,
comReturnRecordCard,
jobListPopup,
jobInfoPopup,
winScanPackJob,
winScanButton,
jobList
},
data() {
return {
recordList: [],
pageNo: 1,
pageSize: 10,
totalCount: 0,
loadingType: "nomore",
checkedToday: false,
checkedWaitTask: false,
todayTime: "",
detailOptions: [],
detailGiveupOptions: [],
title: '',
scanMessage: "",
filterItemCode: "",
queryParams:{
creationTime:"",
receiveStatus:"",
itemCode:""
}
};
},
onLoad(option) {
this.title = option.title
},
onShow() {
this.getList('refresh')
},
onReady() {
this.detailOptions = getDetailOption();
this.detailGiveupOptions = getDetailGiveupOption();
},
onReachBottom() {
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList('more')
},
onPullDownRefresh() {
this.getList('refresh')
},
//退
onBackPress(options) {
if (options.from === 'navigateBack') {
uni.navigateBack({
delta: 1
})
return false;
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
this.$refs.filter.openFilter();
}
},
methods: {
setQueryParam() {
var filterParams = []
//
if (this.queryParams.creationTime) {
filterParams.push({
column: "create_time",
action: "betweeen",
value: this.queryParams.creationTime
})
}
//
if (this.queryParams.receiveStatus) {
filterParams.push({
column: "receiveStatus",
action: "in",
value: this.queryParams.receiveStatus
})
} else {
filterParams.push({
column: "receiveStatus",
action: "in",
value: "0"
})
}
//
if (this.queryParams.itemCode) {
filterParams.push({
column: "itemCode",
action: "like",
value: this.queryParams.itemCode
})
this.filterItemCode = this.queryParams.itemCode
}else {
if(this.filterItemCode){
filterParams.push({
column: "itemCode",
action: "like",
value: this.filterItemCode
})
}
}
return filterParams;
},
getList(type) {
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.recordList = [];
}
var queryFiltersParams = this.setQueryParam()
var params = {
filters: queryFiltersParams,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
console.log("查询条件",JSON.stringify(params))
getProductionReturnRecordList(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
this.totalCount = res.data.total
updateTitle(this.title + "(" + this.totalCount + ")");
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
list.forEach(item=>{
item.packingNumber =item.toPackingNumber
})
this.recordList = type === "refresh" ? list : this.recordList.concat(list);
this.pageNo++;
}).catch(error => {
if (type === "refresh") {
uni.stopPullDownRefresh();
}
this.loadingType = "";
updateTitle(this.title);
uni.hideLoading();
that.showMessage(error)
})
},
openJobDetail(item, scanMessage = '') {
uni.navigateTo({
url: './returnToHoldRecordListDetail?id=' + item.masterId + '&receiveStatus=' + item.receiveStatus +
'&scanMessage=' + scanMessage + '&title=' + this.title
});
this.scanMessage = ""
},
showItemList(itemList) {
this.$refs.jobListPopup.openPopup(itemList);
},
selectedItem(item) {
this.openJobDetail(item);
},
openjobInfoPopup(item) {
this.$refs.jobInfoPopup.openPopup(item)
},
showMessage(message) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.packLoseFocus()
}
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.packGetFocus()
}
}
});
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
selectItem(item) {
this.$refs.scanPopup.closeScanPopup();
this.openJobDetail(item, this.scanMessage);
},
getScanResult(result) {
try {
this.scanMessage = ""
var filters = [{
column: "toPackingNumber",
action: "in",
value: result.package.number + "," + result.package.parentNumber
},
{
column: "receiveStatus",
action: "in",
value: '0'
},
{
column: "toBatch",
action: "==",
value: result.label.batch
},
{
column: "itemCode",
action: "==",
value: result.label.itemCode
},
]
getProductionReturnRecordList({
filters: filters,
pageNo: 1,
pageSize: 100,
}).then(res => {
this.scanMessage = result.scanMessage
let resultList = res.data.list;
if (resultList.length > 0) {
resultList.forEach(item => {
item.title = item.number;
item.selected = false
})
let list = []
resultList.forEach(item => {
if (!list.find(subItem => subItem.title == item.title)) {
list.push(item)
}
})
if (list.length > 1) {
this.$refs.recordList.openList(list)
} else {
this.selectItem(list[0])
}
} else {
this.showMessage("未查找到任务\n" + "扫描[" + result.scanMessage + "]")
}
}).catch(error => {
this.showMessage(error + "\n扫描[" + result.scanMessage + "]")
})
} catch (e) {
this.showMessage(e.message)
}
},
getListByFilter(params) {
this.queryParams.creationTime=params.creationTime
this.queryParams.receiveStatus=params.receiveStatus
this.queryParams.itemCode=params.itemCode
this.getList('refresh')
},
}
}
</script>
<style scoped lang="scss">
</style>

424
src/pages/productionReturn/record/returnToHoldRecordListDetail.vue

@ -0,0 +1,424 @@
<template>
<view class="page-wraper">
<view class="page-main">
<view class="page-header">
<view class="header-view">
<view class="header_job_top">
<receive-top :dataContent="recordContent"></receive-top>
</view>
</view>
</view>
<view v-if="detailSource.length>0" class="uni-flex uni-row "
style=";margin-top: 15rpx; margin-bottom: 15rpx; margin-left: 20rpx; text-align: right;">
<view class="font_default" style="display: block; font-weight: bold;">
整单接收
</view>
<view class="uni-flex" style="margin-left: 20rpx; align-items: center; text-align: center;">
<u-switch v-model="isAllReceived" active-color="#5FCB94" inactive-color="#eee" size="35"
@change="switchChange"></u-switch>
</view>
</view>
<scroll-view scroll-y="true">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<com-detail-card :dataContent="item" :index="index" :settingParam="recordContent"
@remove="updateData" :isShowToLocation="true" @updateData="updateData"
@openDetail="openDetail">
</com-detail-card>
<view class='split_line'></view>
</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=" uni-flex uni-row">
<button class="btn_single_commit" style="width: 280rpx;" hover-class="btn_commit_after"
@click="reject">拒绝</button>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" style="width: 280rpx;" hover-class="btn_commit_after"
@click="receive" :disabled="receiveDisable">接收</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-pack ref="scanPopup" @getResult='getScanResult' headerType="HPQ,HMQ">></win-scan-pack>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getProductionReturnRecordDetail,
productionReturnRecordRefuse,
productionReturnRecordReceive,
} from '@/api/request2.js';
import {
goHome,
navigateBack,
getCurrDateTime,
getInventoryStatusName,
getSwitchInfoByCode
} from '@/common/basic.js';
import {
getDataSource,
calcHandleQty,
getScanCount
} from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue"
import detailInfoPopup from '@/pages/productionReceipt/coms/detailInfoPopup.vue'
import receiveTop from '@/mycomponents/receive/receiveTop.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import comMoveRecordCard from '@/pages/itemHold/coms/comMoveRecordCard.vue'
export default {
components: {
winScanButton,
winScanPack,
comDetailCard,
detailInfoPopup,
receiveTop,
comMoveRecordCard
},
data() {
return {
id: '',
scanCount: 0,
recordContent: {}, //
subList: [], //subList
detailSource: [], //
fromLocationCode: "",
toLocationCode: "",
isAllReceived: false,
receiveDisable: true //
};
},
onLoad(option) {
uni.setNavigationBarTitle({
title: option.title + '详情'
})
this.id = option.id;
if (this.id != undefined) {
//
if (option.receiveStatus == "0") {
this.getDetail();
}
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
//
onBackPress(e) {
//
if (e.from == 'backbutton') {
uni.navigateBack();
return true;
}
},
mounted() {
},
methods: {
//
getDetail() {
var that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getProductionReturnRecordDetail(that.id).then(res => {
uni.hideLoading();
this.isAllReceived= false
this.receiveDisable = true
if (res.data == null) {
that.showMessage('未获取到详情');
} else {
if (res.data.list.length > 0) {
that.recordContent = res.data.list[0];
that.subList = res.data.list;
that.subList.forEach(item => {
item.batch = item.toBatch;
item.packingNumber = item.toPackingNumber;
})
that.detailSource = getDataSource(that.subList)
} else {
that.showMessage('列表数据为0');
}
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
calcHandleQty() {
calcHandleQty(this.detailSource);
this.updateBtn()
this.continueScan()
this.$forceUpdate();
},
updateBtn() {
this.scanCount = getScanCount(this.subList);
//
if (this.scanCount == this.subList.length) {
this.receiveDisable = false;
}
},
//
continueScan() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == this.subList.length) {
this.closeScanPopup();
} else {
this.scanPopupGetFocus();
}
},
updateData() {
this.calcHandleQty();
},
openDetail(item) {
this.$refs.detailInfoPopup.openPopup(item)
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
closeScanPopup() {
this.$refs.scanPopup.closeScanPopup();
},
getScanResult(result) {
try {
var itemCode = result.label.itemCode;
var packingNumber = result.package.number;
var batch = result.label.batch;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else {
var itemDetail = detail.subList.find(r => {
return r.packingNumber == packingNumber &&
r.batch == batch
})
if (itemDetail == undefined) {
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]不在列表中")
} else {
if (itemDetail.scaned) {
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]已经扫描")
} else {
itemDetail.scaned = true;
itemDetail.handleQty = Number(itemDetail.qty)
this.calcHandleQty();
}
}
}
} catch (e) {
this.showMessage(e.message)
}
},
reject() {
this.showQuestionMessage("是否拒绝接收?", res => {
if (res) {
uni.showLoading({
title: "提交中....",
mask: true
});
productionReturnRecordRefuse(this.id).then(res=>{
uni.hideLoading()
if(res.data){
this.showCommitSuccessMessage("拒绝成功")
}else {
this.showErrorMessage("拒绝失败[" + res.msg + "]")
}
}).catch(error=>{
uni.hideLoading()
this.showErrorMessage(error)
})
}
})
},
receive() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
if (this.scanCount < this.subList.length) {
this.showErrorMessage("还有未扫描的数据,请先扫描")
return;
}
//
if (this.scanCount == this.subList.length) {
this.receiveSubmit();
}
},
showMessageHint(hint, callback) {
this.$refs.comMessage.showErrorMessage(hint, res => {
if (res) {
callback()
}
});
},
receiveSubmit() {
uni.showLoading({
title: "提交中....",
mask: true
});
productionReturnRecordReceive(this.id).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("接收成功")
} else {
this.showErrorMessage("接收失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
showMessage(message) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
})
},
showErrorMessage(message) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
})
},
showQuestionMessage(message, callback) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showQuestionMessage(message, res => {
if (res) {
callback(res);
}
});
})
},
scanPopupGetFocus() {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.getfocus();
}
},
scanPopupLoseFocus() {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.losefocus();
}
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
navigateBack(1)
})
},
switchChange(isOn) {
this.isAllReceived = isOn
if(this.isAllReceived){
this.detailSource.forEach(item=>{
item.subList.forEach(info=>{
info.scaned=true;
info.handleQty=Number(info.qty)
})
})
this.calcHandleQty();
}else {
this.$refs.comMessage.showQuestionMessage("是否要关闭整单收货?", res => {
if (res) {
this.getDetail()
}
});
}
}
}
}
</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