Browse Source

Merge branch 'hella_online_20240803' into master_hella

# Conflicts:
#	src/mycomponents/scan/winScanPackAndLocation.vue
hella_online_20240829
陈薪名 2 months ago
parent
commit
0e6419a81a
  1. 34
      src/api/request2.js
  2. 14
      src/common/array.js
  3. 32
      src/common/detail.js
  4. 4
      src/manifest.json
  5. 15
      src/mycomponents/detail/comDetailCard.vue
  6. 194
      src/mycomponents/detail/comRecommendDetailCard.vue
  7. 2
      src/mycomponents/qty/balanceQtyEdit.vue
  8. 17
      src/mycomponents/record/recordComDetailCard.vue
  9. 17
      src/mycomponents/scan/winComScanFg.vue
  10. 16
      src/mycomponents/scan/winScanButton.vue
  11. 7
      src/mycomponents/scan/winScanFgLabel.vue
  12. 26
      src/mycomponents/scan/winScanPackAndLocation.vue
  13. 79
      src/pages.json
  14. 1
      src/pages/check/checkFgLabel.vue
  15. 6
      src/pages/deliver/coms/comDeliverDetailCard.vue
  16. 3
      src/pages/deliver/coms/comScanDeliverPack.vue
  17. 106
      src/pages/deliver/job/deliverDetail.vue
  18. 4
      src/pages/fg/coms/comNoReceiptPopup.vue
  19. 125
      src/pages/fg/receiptByPlan.vue
  20. 22
      src/pages/inventoryMove/coms/comInventoryDetailCard.vue
  21. 8
      src/pages/inventoryMove/coms/comMoveRecordCard.vue
  22. 2
      src/pages/inventoryMove/job/inventoryMoveDetail.vue
  23. 3
      src/pages/issue/coms/comIssueDetailCard.vue
  24. 6
      src/pages/issue/job/issueDetail.vue
  25. 51
      src/pages/issue/record/directIssue.vue
  26. 12
      src/pages/issue/request/issueScanRequest.vue
  27. 2
      src/pages/package/coms/comOverPackJobDetailCard.vue
  28. 4
      src/pages/package/job/overPackageJobDetail.vue
  29. 5
      src/pages/productReceipt/coms/comProductDetailCard.vue
  30. 38
      src/pages/productReceipt/job/ccProductReceiptDetail.vue
  31. 79
      src/pages/productReceipt/job/fgProductReceiptDetail.vue
  32. 2
      src/pages/productionReceipt/coms/comProductionJobCard.vue
  33. 10
      src/pages/productionReceipt/job/productionReceiptDetail.vue
  34. 157
      src/pages/productionReceipt/job/productionReceiptJob.vue
  35. 522
      src/pages/productionReturn/job/holdToReturnDetail.vue
  36. 298
      src/pages/productionReturn/job/holdToReturnJob.vue
  37. 522
      src/pages/productionReturn/job/okToReturnDetail.vue
  38. 298
      src/pages/productionReturn/job/okToReturnJob.vue
  39. 12
      src/pages/purchaseReceipt/job/receiptDetail.vue
  40. 3
      src/pages/putaway/job/putawayDetail.vue
  41. 9
      src/pages/repleinsh/coms/comRepleishDetailCard.vue
  42. 2
      src/pages/stockUp/coms/comScanStockUpPack.vue
  43. 9
      src/pages/stockUp/coms/comStockUpDetailCard.vue
  44. 8
      src/pages/stockUp/job/stockUpJobDetail.vue
  45. 170
      src/pages/unPlanned/job/issueJobDetail.vue

34
src/api/request2.js

@ -3465,6 +3465,40 @@ export function getProductionreturnJobList(params) {
});
}
/**
* 生产隔离退料 任务获取任务列表
* 任务状态
* 开始日期
* 结束日期
* 获取日期任务列表
* @param {*}
*/
export function getProductionHoldReturnJobList(params) {
return request({
url: baseApi + "/wms/productionreturn-job-detail-hold/senior",
method: "post",
data: params,
});
}
/**
* 生产合格退料 任务获取任务列表
* 任务状态
* 开始日期
* 结束日期
* 获取日期任务列表
* @param {*}
*/
export function getProductionOkReturnJobList(params) {
return request({
url: baseApi + "/wms/productionreturn-job-detail-store/senior",
method: "post",
data: params,
});
}
/**
* 生产退料任务 获取任务明细
* @param {*} id 任务id

14
src/common/array.js

@ -110,6 +110,20 @@ export function getPurchaseReceiptOption(allowModifyQty, allowModifyLocation) {
return option;
}
export function getRecordOption(allowModifyQty, allowModifyLocation) {
var option = []
option.push(...getDetailOption())
if (allowModifyQty) {
option.push(...getEditOption())
}
if (allowModifyLocation) {
option.push(...getLocationOption())
}
option.push(...getRemoveOption())
return option;
}
//详情
export function getDetailOption() {
let option_detail = [{

32
src/common/detail.js

@ -116,21 +116,45 @@ export function calcHandleQty(detailSource) {
}
}
//计算推荐和扫描的不是用一个的数量
export function calcHandleNewQty(detailSource) {
for (let item of detailSource) {
item.handleQty = new Decimal(0).toNumber();
// item.qty = new Decimal(0).toNumber();
for (let detail of item.subList) {
if (detail ) {
if (!detail.isRecommend && detail.scaned) {
item.handleQty = calc.add(item.handleQty, detail.handleQty);
}
// if (!detail.isRecommend ) {
// item.qty = calc.add(item.qty, detail.qty);
// }
}
}
}
}
export function calcTreeHandleQty(detailSource) {
for (let item of detailSource) {
item.handleQty = new Decimal(0).toNumber();
for (let detail of item.subList) {
if (detail != undefined && detail.scaned) {
if (detail.packList.length > 0) {
if (detail) {
if (detail.packList&&detail.packList.length > 0) {
detail.handleQty = new Decimal(0).toNumber();
for (let pack of detail.packList) {
if (pack != undefined && pack.scaned) {
if (pack && pack.scaned) {
detail.handleQty = calc.add(detail.handleQty, pack.handleQty);
}
}
}
item.handleQty = calc.add(item.handleQty, detail.handleQty);
if(detail.handleQty){
item.handleQty = calc.add(item.handleQty, detail.handleQty);
}
}
}
}

4
src/manifest.json

@ -3,8 +3,8 @@
"package" : "uni.UNI43932FE",
"appid" : "__UNI__C9CF4BF",
"description" : "",
"versionName" : "1.0.67",
"versionCode" : 67,
"versionName" : "1.0.69",
"versionCode" : 69,
"transformPx" : false,
/* 5+App */
"app-plus" : {

15
src/mycomponents/detail/comDetailCard.vue

@ -15,6 +15,7 @@
style='padding:0px 0px 5px 0px;align-items: center;'>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false">
</recommend>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
@ -83,13 +84,17 @@
dataContent: {
handler(newName, oldName) {
if (this.dataContent.subList.length > 0) {
if (this.$refs.collapse1 != undefined && this.$refs.collapse1 != null) {
this.$nextTick(res => {
this.$refs.collapse1.resize()
})
}
this.$nextTick(res => {
setTimeout(() => {
if (this.$refs.collapse1) {
this.$refs.collapse1.resize();
}
}, 500)
})
}
},
immediate: true,
deep: true
}

194
src/mycomponents/detail/comRecommendDetailCard.vue

@ -0,0 +1,194 @@
<template>
<view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" >
<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;'>
<view v-if="item.isRecommend" class="uni-flex" style="flex-direction: row; align-items: center;background-color: antiquewhite;">
<view class="" style="font-size: 32rpx; color: black; font-weight: bold; text-align: center;">
</view>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false">
</recommend>
</view>
<view v-else class="uni-flex" style="flex-direction: row; align-items: center;background-color: antiquewhite; margin-top: 5rpx;">
<view class="" style="font-size: 32rpx; color: red; font-weight: bold; text-align: center;">
</view>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false">
</recommend>
</view>
</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
},
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>

2
src/mycomponents/qty/balanceQtyEdit.vue

@ -182,7 +182,7 @@
},
setValue() {
var balanceQty = Number(this.dataContent.balanceQty);
if(this.allQty<0){
if(this.allQty<=0){
this.$refs.comMessage.showConfirmWarningModal('数量必须大于等于0',
res => {
this.allQty = balanceQty;

17
src/mycomponents/record/recordComDetailCard.vue

@ -8,7 +8,7 @@
<item-qty :dataContent="dataContent" :isShowBalance="true"
:isShowBalanceQty="isShowBalanceQty"></item-qty>
<view style="margin-left: 10px; margin-top: 5px;">
<pack title='父包装' :packingCode='dataContent.containerNumber'></pack>
<pack title='父包装' v-if="dataContent.containerNumber" :packingCode='dataContent.containerNumber'></pack>
<location v-if="isShowParentToLocation" title='目标库位'
:locationCode='dataContent.toLocationCode'></location>
</view>
@ -30,7 +30,7 @@
</view>
</uni-collapse-item>
</uni-collapse>
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm"></balance-qty-edit>
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" ></balance-qty-edit>
<record-detail-popup ref="recordDetailPopup"></record-detail-popup>
<comMessage ref="comMessage"></comMessage>
</view>
@ -52,7 +52,8 @@
getDetailOption,
getDetailEditRemoveOption,
getClearOption,
getEditLocationRemoveOption
getEditLocationRemoveOption,
getRecordOption
} from '@/common/array.js';
export default {
components: {
@ -111,6 +112,14 @@
type: Boolean,
default: false
},
allowModifyQty: {
type: Boolean,
default: false
},
allowModifyLocation: {
type: Boolean,
default: false
}
},
watch: {
@ -148,7 +157,7 @@
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getDetailEditRemoveOption();
this.scanOptions = getRecordOption(this.allowModifyQty,this.allowModifyLocation);
this.removeOptions = this.isShowModifedLocation ?getEditLocationRemoveOption():getClearOption();
},

17
src/mycomponents/scan/winComScanFg.vue

@ -6,10 +6,8 @@
<view class="tab_info">
<view class="conbox">
<textarea inputmode="none" v-model="scanMsg" trim="all" maxlength="1000"
style="margin-left: 5px;width: 90%;"
:focus="boxfocus" :placeholder="placeholderValue"
@focus="handleFocus"
@input="handelScanMsg" :cursor="cursorIndex"></textarea>
style="margin-left: 5px;width: 90%;" :focus="boxfocus" :placeholder="placeholderValue"
@focus="handleFocus" @input="handelScanMsg" :cursor="cursorIndex"></textarea>
</view>
<view class="uni-flex uni-row space-between u-col-center">
<view class="uni-flex">
@ -125,6 +123,7 @@
this.placeholderValue = '请扫描' + this.placeholder;
},
methods: {
handleFocus() {},
setItemCodeSimulate(itemCode, scanMsg) {
this.itemCode = itemCode;
this.scanMsg = scanMsg;
@ -140,8 +139,8 @@
this.scanMsg = val
},
clearScanValue() {
this.cursorIndex=0,
this.scanMsg = ''
this.cursorIndex = 0,
this.scanMsg = ''
this.getfocus();
},
clickScanMsg() {
@ -181,18 +180,18 @@
var partNumber = result.partNumber; //
var lengthMat = result.lengthMat;
var lengthBc = result.lengthBc;
//Q5,,TypeQ5
if (result.type == 'P') {
let scanPartNumber = content.substr(0, lengthMat); //
// let productDate = content.substr(lengthMat, 8);
// let batch = content.substr(lengthMat + 8, 3);
let order = content.substr(-8);
if(content.length!=lengthBc){
if (content.length != lengthBc) {
that.clear();
throw new Error("解析错误:扫描标签长度与配置条码的长度不一致")
}
if (scanPartNumber != partNumber) {
that.clear();
throw new Error("解析错误:扫描的客户物料号【" + scanPartNumber +

16
src/mycomponents/scan/winScanButton.vue

@ -1,6 +1,6 @@
<template>
<view>
<view class="scan_float" @click="goScan('bottom')">
<view class="scan_float" ref="scanRef" @click="goScan('bottom')" @touchstart="handleTouchStart" @touchmove.prevent="handleTouchMove">
<image src="@/static/icons_ui/icon_scan_white.svg"></image>
<view>扫描</view>
</view>
@ -19,7 +19,9 @@
old: {
x: 0,
y: 0
}
},
btnX:20,
btnY:20,
}
},
props: {
@ -30,6 +32,16 @@
},
methods: {
handleTouchStart(e) {
this.btnX = e.changedTouches[0].clientX-e.currentTarget.offsetLeft
this.btnY = e.changedTouches[0].clientY-e.currentTarget.offsetTop
},
handleTouchMove(e) {
console.log("handleTouchMove",e);
this.$refs.scanRef.$el.style.left = e.changedTouches[0].clientX-this.btnX+'px'
this.$refs.scanRef.$el.style.top = e.changedTouches[0].clientY-this.btnY+'px'
},
goScan(content) {
this.$emit("goScan", '');
},

7
src/mycomponents/scan/winScanFgLabel.vue

@ -21,8 +21,6 @@
</view>
</view>
</uni-popup>
<!-- 模拟扫描功能 -->
<win-com-scan-fg v-show="false" ref="comscansimulate" @getResult="getScanResult" :isShowHistory="false" :clearResult="true"></win-com-scan-fg>
<comMessage ref="comMessage" @afterClose="getfocus"></comMessage>
</view>
</template>
@ -54,11 +52,6 @@
},
methods: {
//
simulateScan(item){
this.$refs.comscansimulate.setItemCodeSimulate(item.itemCode,item.copyContent)
this.$refs.comscansimulate.clickScanMsg();
},
openScanPopup(itemCode) {
this.$refs.popup.open('bottom')
setTimeout(res => {

26
src/mycomponents/scan/winScanPackAndLocation.vue

@ -140,7 +140,6 @@
managementPrecision: '',
fromInventoryStatuses: "",
isCheck: false,
chooseWhich:'1'
}
},
created() {
@ -318,14 +317,7 @@
uni.hideLoading();
if (res.success) {
this.managementPrecision = res.managementPrecision
this.chooseWhich = '2'
if(res.data&&res.data.list&&res.data.list.length>1){
this.showBalanceSelect(res.data.list);
}else{
this.afterQueryBalance(res.data.list);
}
//
this.afterQueryBalance(res.data.list);
} else {
this.showErrorMessage(res.message, res => {
this.packGetFocus();
@ -394,7 +386,6 @@
// }
} else {
this.showBalanceSelect(datas);
this.chooseWhich='1'
}
},
@ -403,12 +394,7 @@
},
selectBalanceItem(balance) {
if(this.chooseWhich == 1){
this.packCallBack(balance);
}else{
this.countCallBack(balance);
}
// this.packCallBack(balance);
this.packCallBack(balance);
// 20231228
// if (balance.qty > 0) {
// this.packCallBack(balance);
@ -472,7 +458,11 @@
getQueryCondition() {
let condition = '按照以下条件:\n';
let label = this.scanResult.label;
let status = getInventoryStatusDesc(this.inventoryStatus);
var isShowStatus = this.balanceFromInventoryStatuses ? this.fromInventoryStatuses : undefined
if(isShowStatus){
let status = getInventoryStatusDesc(isShowStatus);
}
switch (this.managementPrecision) {
case 'BY_PACKAGING':
condition = condition + '物料号=[' + label.itemCode + ']\n箱码=[' + label.packingNumber +
@ -493,7 +483,7 @@
condition = condition + '物料号=[' + label.itemCode + ']'
break;
}
if (this.inventoryStatus.length > 0) {
if (status) {
condition = condition + '\n库存状态=[' + status + ']'
}
return condition;

79
src/pages.json

@ -937,6 +937,79 @@
"enablePullDownRefresh": false
}
},
{
"path": "pages/productionReturn/job/okToReturnJob",
"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/job/okToReturnDetail",
"style": {
"navigationBarTitleText": "生产合格退料详细",
"enablePullDownRefresh": false
}
},
{
"path": "pages/productionReturn/job/holdToReturnJob",
"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/job/holdToReturnDetail",
"style": {
"navigationBarTitleText": "生产隔离退料详细",
"enablePullDownRefresh": false
}
},
{
"path": "pages/productionReturn/request/returnToStoreRequest",
"style": {
@ -981,7 +1054,7 @@
{
"path": "pages/deliver/job/deliverJob",
"style": {
"navigationBarTitleText": "品发货任务",
"navigationBarTitleText": "品发货任务",
"enablePullDownRefresh": false,
"titleNView": {
// "autoBackButton": "true",
@ -1007,14 +1080,14 @@
{
"path": "pages/deliver/job/deliverDetail",
"style": {
"navigationBarTitleText": "品发货详情",
"navigationBarTitleText": "品发货详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/deliver/record/deliverRecord",
"style": {
"navigationBarTitleText": "品发货记录",
"navigationBarTitleText": "品发货记录",
"enablePullDownRefresh": false
}
},

1
src/pages/check/checkFgLabel.vue

@ -69,7 +69,6 @@
getBusinessType,
createItemInfo,
createDetailInfo,
calcTreeHandleQty
} from '@/common/record.js';
import {

6
src/pages/deliver/coms/comDeliverDetailCard.vue

@ -22,10 +22,10 @@
:isShowLocation="false" :isShowPack="batch.packingNumber!=null && batch.packingNumber!=''">
</recommend-balance>
<view class="uni-flex uni-row" v-if='batch.Records.length>0'>
<view class="center " style=" width: 20px; color: #0CC2B6; margin-left: 40px;">
实际
<view class="center " style=" width: 20px;background-color: #0CC2B6; color: #fff; margin-left: 40px;padding: 0px 2px;">
扫描
</view>
<view class="uni-flex uni-column" style="width: 100%;">
<view class="uni-flex uni-column scan_view" style="width: 100%;">
<view v-for="(record,index) in batch.Records">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,batch,record,index)"

3
src/pages/deliver/coms/comScanDeliverPack.vue

@ -296,7 +296,7 @@
},
selectBalanceItem(balance) {
this.afterGetBalance(this.label, balance, this.packageInfo);
this.afterGetBalance(balance, balance, this.packageInfo);
},
@ -434,6 +434,7 @@
balance.packQty = packageInfo.packQty
balance.packUnit = packageInfo.packUnit
let record = {
scaned: true,
itemCode: label.itemCode,
packingNumber: label.packingNumber,
batch: label.batch,

106
src/pages/deliver/job/deliverDetail.vue

@ -27,21 +27,28 @@
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="">
<scroll-view scroll-y="true" class="page-main-scroll">
<view v-for="(toLocation, index) in detailSource">
<comDeliverDetailCard ref='comIssueDetailCard' :dataContent="toLocation" @updateData='updateData'>
<comDeliverDetailCard ref='comIssueDetailCard'
:dataContent="toLocation"
:settingParam="jobContent"
@updateData='updateData'>
</comDeliverDetailCard>
</view>
</scroll-view>
</view>
<div class="btn_bottom">
<view class="" style="display: flex;flex-direction: row;">
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<button class="btn_commit" hover-class="btn_commit_after" @click="submit()">提交</button>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="submit()">提交</button>
</view>
</view>
</div>
</view>
<win-scan-button @goScan='openScanDetailPopup'></win-scan-button>
<comScanDeliverPack ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'>
</comScanDeliverPack>
@ -175,20 +182,15 @@
});
getDeliverDetail(that.id).then(res => {
uni.hideLoading();
if (res.data == null) {
that.showMessage('未获取到详情');
if (res.data &&res.data.subList.length > 0) {
that.jobContent = res.data;
that.jobStatus = res.data.status;
that.subList = res.data.subList;
that.detailSource = getDataSource(that.detailSource, that.subList)
that.toLocationCode = that.subList[0].toLocationCode
that.resizeCollapse();
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.jobStatus = res.data.status;
that.subList = res.data.subList;
that.detailSource = getDataSource(that.detailSource, that.subList)
that.toLocationCode = that.subList[0].toLocationCode
that.resizeCollapse();
} else {
that.showMessage('列表数据为0');
}
that.showMessage('未获取到详情');
}
}).catch(error => {
uni.hideLoading()
@ -241,6 +243,61 @@
});
}
},
checkCount(){
let str=""
this.detailSource.forEach(detail => {
detail.Items.forEach(item => {
var taskQty =0;
item.taskQty =calc.add(taskQty,item.qty)
var totalQty =0;
item.Locations.forEach(lco => {
lco.Batchs.forEach(batch => {
batch.Records.forEach(record => {
// if (batch.qty != record.qty) {
// var tempHandleQty = 0
// if (record.qty) {
// tempHandleQty = record.qty
// } else {
// tempHandleQty = 0
// }
// if (batch.qty != 0) {
// str +=
// `${record.packingNumber}${tempHandleQty}${batch.qty}\n`
// }
// }
if(record){
var hanleQty =record.qty?record.qty:0
totalQty = calc.add(totalQty,hanleQty)
}
})
})
})
//
item.totalQty =totalQty
})
})
//
this.detailSource.forEach(detail=>{
detail.Items.forEach(item=>{
if(this.jobContent.allowPartialComplete=="FALSE"){
if(item.taskQty!=item.totalQty){
str += `物料号【${item.itemCode}】任务数量【${item.taskQty}】与实际提交数量【${item.totalQty}】不一致\n`
}
}
})
})
if(str){
str = '不允许提交\n' + str
this.showErrorMessage(str)
}
return str?false:true
},
submitJob() {
var params = this.setParams()
@ -251,6 +308,12 @@
this.$refs.comMessage.showConfirmMessageModal('请扫描箱码')
return
}
if(!this.checkCount()){
uni.hideLoading()
return ;
}
deliverJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
@ -414,9 +477,6 @@
this.scanPopupGetFocus();
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
closeScanMessage() {
this.scanPopupGetFocus();

4
src/pages/fg/coms/comNoReceiptPopup.vue

@ -225,6 +225,7 @@
this.fgLocationCode = ""
this.rawLocationCode = ""
this.workshop = ""
this.bomVersion =""
},
@ -287,7 +288,8 @@
workStationCode: this.workStationCode,
fgLocationCode: this.fgLocationCode,
rawLocationCode: this.rawLocationCode,
workshop: this.workshop
workshop: this.workshop,
bomVersion :this.bomVersion
};
this.closeRequestPopup();
this.$emit("confirm", item);

125
src/pages/fg/receiptByPlan.vue

@ -275,43 +275,30 @@
console.log(JSON.stringify(params))
let list = []
try {
var planData = await planReceiptSubmit(params)
console.log('planData', planData)
if (planData.data) {
planData.data.forEach(item => {
list.push({
itemCode: item.itemCode, //
itemName: item.itemName, //
packName: item.packName, //
packageCode: item.toPackingNumber, //
batch: item.toBatch, //
parentNumber: item.parentNumber, //
itemType: item.itemType, //
asnNumber: item.asnNumber, //ASN
supplierCode: item.supplierCode, //
qty: item.qty, //
printTimes: getCurrDateTime(), //
productionLineCode: item.productionLineCode, //线
barcodeString: item.barcodeString, //
barcodeBase64: '',
requestNumber: item.requestNumber
})
var planData = await planReceiptSubmit(params)
console.log('planData', planData)
if (planData.data && planData.data.length > 0) {
planData.data.forEach(item => {
list.push({
itemCode: item.itemCode, //
itemName: item.itemName, //
packName: item.packName, //
packageCode: item.toPackingNumber, //
batch: item.toBatch, //
parentNumber: item.parentNumber, //
itemType: item.itemType, //
asnNumber: item.asnNumber, //ASN
supplierCode: item.supplierCode, //
qty: item.qty, //
printTimes: getCurrDateTime(), //
productionLineCode: item.productionLineCode, //线
barcodeString: item.barcodeString, //
barcodeBase64: '',
requestNumber: item.requestNumber
})
} else {
throw new Error("提交失败")
}
} catch (error) {
console.log('异常', error)
if (error.indexOf('请返回开工阶段') > -1) {
uni.hideLoading()
this.showErrorMessage('计划已完成')
this.clearData()
this.openFg();
return
}
})
} else {
throw new Error("提交失败")
}
//
@ -324,15 +311,17 @@
// }
//
if (createProductputawaySwitch) {
createPutawayRequestByPlan(list[0].requestNumber).then(res => {
createInspectRequestByPlan(list[0].requestNumber)
})
if (list.length > 0 && list[0].requestNumber) {
createPutawayRequestByPlan(list[0].requestNumber).then(res => {
createInspectRequestByPlan(list[0].requestNumber)
})
}
} else { //
createInspectRequestByPlan(list[0].requestNumber)
if (list.length > 0 && list[0].requestNumber) {
createInspectRequestByPlan(list[0].requestNumber)
}
}
var queryParams = {
filters: [{
column: "number",
@ -375,15 +364,24 @@
this.index = 1;
this.dataContent.handleQty = 0;
}
var hintMsg ="提交成功\n生成装配收货记录\n";
if(list.length>0&&list[0].requestNumber){
hintMsg += list[0].requestNumber
}
nextTick(() => {
this.showCommitSuccessMessage("提交成功\n生成装配收货记录\n" + list[0].requestNumber, list)
this.showCommitSuccessMessage(hintMsg, list)
})
} catch (error) {
uni.hideLoading()
var hint = error.message ? error.message : error
this.showErrorMessage(hint)
if (hint.indexOf('请返回开工阶段') > -1) {
this.showErrorMessage('计划已完成')
this.clearData()
this.openFg();
} else {
this.showErrorMessage(hint)
}
}
},
@ -489,15 +487,21 @@
let _this = this
batchPrintingLable(number).then(resLable => {
console.log('batchPrintingLable', resLable)
const webUrl = `${import.meta.env.VITE_JMREPORT_BASE_URL}/jmreport/view/922734157577715712`
const webData = {
token: storage.getStorage(storage.constant.token),
asn_number: resLable.data
uni.hideLoading()
if (resLable.data) {
const webUrl = `${import.meta.env.VITE_JMREPORT_BASE_URL}/jmreport/view/922734157577715712`
const webData = {
token: storage.getStorage(storage.constant.token),
asn_number: resLable.data
}
uni.navigateTo({
url: `/pages/pointProductReceipt/webview?url=${webUrl}&webData=${JSON.stringify(webData)}`
});
} else {
_this.showErrorMessage(number + "批量打印标签 H5失败")
}
uni.navigateTo({
url: `/pages/pointProductReceipt/webview?url=${webUrl}&webData=${JSON.stringify(webData)}`
});
}).catch(error => {
uni.hideLoading()
_this.showErrorMessage(error)
})
},
@ -520,13 +524,28 @@
_this.showErrorMessage('包装号不能为空!')
return
}
uni.showLoading({
title: "正在获取打印信息",
mask: true
})
getBalanceToPackage({
packingNumber: packingNumber.join(',')
}).then(res => {
console.log('PC打印', res)
_this.getH5BatchPrintingLable(res.data.number)
if (res.data && res.data.number) {
_this.getH5BatchPrintingLable(res.data.number)
} else {
uni.hideLoading()
var hint = ""
packingNumber.forEach(item => {
hint += item
})
hint + "根据库存余额获取包装信息"
_this.showErrorMessage(hint)
}
}).catch(error => {
uni.hideLoading()
_this.showErrorMessage(error)
})
// #endif

22
src/pages/inventoryMove/coms/comInventoryDetailCard.vue

@ -10,16 +10,16 @@
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item :right-options="item.scaned?scanOptions:detailOptions"
@click="swipeClick($event,item)">
<recommend :detail="item" :isShowFromLocation="true" :isShowToLocation="true"></recommend>
<recommend :detail="item" :isShowFromLocation="true" :isShowToLocation="true"></recommend>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
<!-- <view class='split_line'></view> -->
</uni-collapse-item>
</uni-collapse>
<balance-qty-edit ref="qtyEdit" :allowEditQty="allowEditQty" :settingParam="settingParam" @confirm="confirm" :allowEditStatus="true"></balance-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
></win-scan-location>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :allowEditQty="allowEditQty" @confirm="confirm"
:allowEditStatus="true"></balance-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'></win-scan-location>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<comMessage ref="message"></comMessage>
</view>
@ -31,7 +31,7 @@
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import detailInfoPopup from '@/pages/inventoryMove/coms/detailInfoPopup.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import {
getDetailOption,
getPurchaseReceiptOption
@ -52,7 +52,7 @@
title: "推荐详情",
showItem: {},
editItem: {
},
detailOptions: [],
scanOptions: []
@ -69,8 +69,8 @@
},
allowEditQty: {
type: Boolean,
default: true
}
default: false
},
},
watch: {
// dataContent: {
@ -84,7 +84,7 @@
this.detailOptions = getDetailOption();
}
if (this.scanOptions.length == 0) {
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, this.settingParam
this.scanOptions = getPurchaseReceiptOption("TRUE", this.settingParam
.allowModifyLocation)
}
},
@ -135,7 +135,7 @@
},
//
getLocation(location, code) {
this.locatonItem.toLocationCode =code;
this.locatonItem.toLocationCode = code;
this.$emit('updateData')
},
}
@ -143,4 +143,4 @@
</script>
<style>
</style>
</style>

8
src/pages/inventoryMove/coms/comMoveRecordCard.vue

@ -26,7 +26,9 @@
</uni-collapse-item>
</uni-collapse>
<balanceQtyEdit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="isShowStatus"
:allowEditStatus="allowEditStatus">
:allowEditStatus="allowEditStatus"
:allowEditQty="allowEditQty"
>
</balanceQtyEdit>
<job-detail-popup ref="winHint" :dataContent="showItem"></job-detail-popup>
<comMessage ref="comMessage"></comMessage>
@ -82,6 +84,10 @@
type: Boolean,
default: false
},
allowEditQty: {
type: Boolean,
default: false
},
},
watch: {

2
src/pages/inventoryMove/job/inventoryMoveDetail.vue

@ -12,7 +12,7 @@
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<comInventoryDetailCard :allowEditQty="false" :dataContent="item" :settingParam="jobContent" @remove="updateData"
<comInventoryDetailCard :dataContent="item" :settingParam="jobContent" @remove="updateData"
@updateData='updateData' @openDetail="openDetail">
</comInventoryDetailCard>
</view>

3
src/pages/issue/coms/comIssueDetailCard.vue

@ -1,5 +1,6 @@
<template>
<view>
<!-- <requiredLocation title="需求库位" :locationCode="dataContent.toLocationCode"
:isShowEdit="dataContent.allowModifyLocation==1"></requiredLocation> -->
<view v-for="(item,index) in dataContent.Items">
@ -39,7 +40,7 @@
<view v-for="(record,index) in batch.Records">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,batch,record,index)"
:right-options="scanOptions">
:right-options="settingParam.allowModifyQty=='TRUE'?scanOptions:removeOptions">
<handle-balance :detail="record" :isShowLocation="false"
:isShowBatch="batch.packingNumber!=null">
</handle-balance>

6
src/pages/issue/job/issueDetail.vue

@ -19,7 +19,11 @@
:productionLineCode="toLocation.productionLineCode"
:workStationCode="toLocation.workStationCode" :rawLocationCode="toLocation.toLocationCode">
</work-station> -->
<com-issue-detail-card ref='comIssueDetailCard' :dataContent="toLocation" @updateData='updateData'>
<com-issue-detail-card
ref='comIssueDetailCard'
:dataContent="toLocation"
:settingParam="jobContent"
@updateData='updateData'>
</com-issue-detail-card>
<view class="split_line"></view>
</view>

51
src/pages/issue/record/directIssue.vue

@ -4,19 +4,13 @@
<com-blank-view @goScan='getBusinessType' v-if="detailSource.length==0"></com-blank-view>
</view>
<view class="page-wraper" v-if="detailSource.length>0">
<view class="page-header">
<view class="header-view">
<view class="header_item">
来源库位 : {{fromLocationCode}}
</view>
</view>
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowFromLocation="false" @removeItem="removeItem(index,item)"
:isShowFromLocation="true" @removeItem="removeItem(index,item)"
:isShowToLocation="false" :isShowParentToLocation="false" @updateData="updateData"
@removePack="removePack">
</record-com-detail-card>
@ -79,7 +73,6 @@
getBusinessType,
createItemInfo,
createDetailInfo,
calcTreeHandleQty,
calcHandleQty
} from '@/common/record.js';
@ -200,11 +193,11 @@
let pack = result.package;
if (this.fromLocationCode && this.fromLocationCode != balance.locationCode) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]在库位[" + this
.fromLocationCode + "]没有库存余额")
return;
}
// if (this.fromLocationCode && this.fromLocationCode != balance.locationCode) {
// this.showErrorMessage("[" + balance.packingNumber + "[" + balance.batch + "][" + this
// .fromLocationCode + "]")
// return;
// }
var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) {
@ -212,15 +205,14 @@
}
})
if (item == undefined) {
if (this.itemCode != "" && this.itemCode != balance.itemCode) {
this.showErrorMessage("请扫描物料为【" + this.itemCode + "】的箱码")
return;
}
if (this.fromWarehouseCode == '') {
this.fromWarehouseCode = balance.warehouseCode;
}
var itemp = createItemInfo(balance, pack);
itemp.containerNumber=""
let newDetail = createDetailInfo(balance, pack); //
newDetail.fromLocationCode=balance.locationCode
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
@ -237,7 +229,7 @@
var detail = item.subList.find(r => {
if (r.packingNumber == pack.number &&
r.batch == balance.batch &&
r.locationCode == balance.locationCode &&
r.fromLocationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) {
return r;
}
@ -249,7 +241,8 @@
if (pack.parentNumber) {
var checkData = item.subList.find(r => {
if (r.packingNumber == pack.parentNumber &&
r.batch == balance.batch) {
r.batch == balance.batch&&
r.fromLocationCode == balance.locationCode) {
return r;
}
})
@ -264,6 +257,7 @@
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
newDetail.fromLocationCode=balance.locationCode
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
@ -273,7 +267,8 @@
//
var checkData = item.subList.find(r => {
if (r.parentNumber == pack.number &&
r.batch == balance.batch) {
r.batch == balance.batch&&
r.fromLocationCode == balance.locationCode) {
return r;
}
})
@ -288,6 +283,7 @@
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
newDetail.fromLocationCode=balance.locationCode
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
@ -297,6 +293,7 @@
console.log("扫描的是父包装,是否移除子包装")
} else {
let newDetail = createDetailInfo(balance, pack);
newDetail.fromLocationCode=balance.locationCode
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
@ -326,18 +323,6 @@
});
},
calcTreeHandleQty() {
for (let item of this.detailSource) {
item.qty = 0;
for (let detail of item.subList) {
if (detail != undefined) {
item.qty = calc.add(item.qty, detail.qty)
}
}
}
this.$forceUpdate();
},
showSelect() {
// if (this.editPosition) {
this.show = true

12
src/pages/issue/request/issueScanRequest.vue

@ -35,7 +35,6 @@
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue'
import comIssueRequestCreator from '@/pages/issue/coms/comIssueRequestCreator.vue'
import winScanPackLevel from '@/mycomponents/scan/winScanPackLevel.vue'
@ -44,7 +43,6 @@
components: {
comBlankView,
jobDetailPopup,
comScanIssuePack,
comIssueRequestCreator,
winScanPackLevel
},
@ -86,12 +84,6 @@
methods: {
goScan() {
this.$refs.scanPopup.openScanPopup();
setTimeout(res => {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus();
}
}, 400)
},
getScanResult(result){
this.detailSource = {
@ -143,7 +135,9 @@
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.closeScanPopup();
this.goScan();
setTimeout(end=>{
this.goScan();
},500)
})
},

2
src/pages/package/coms/comOverPackJobDetailCard.vue

@ -37,7 +37,7 @@
<view v-for="(record,index) in batch.Records" :key="index">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,batch,record,index)"
:right-options="scanOptions">
:right-options="settingParam.allowModifyQty=='TRUE'?scanOptions:removeOptions">
<handle-balance :detail="record" :isShowLocation="false"
:isShowBatch="batch.packingNumber!=null">
</handle-balance>

4
src/pages/package/job/overPackageJobDetail.vue

@ -29,7 +29,9 @@
<scroll-view scroll-y="true" class="page-main-scroll">
<view v-for="(toLocation, index) in detailSource" :key="index">
<comOverPackJobDetailCard ref='comOverPackJobDetailCard' :dataContent="toLocation"
@updateData='updateData'>
@updateData='updateData'
:settingParam="jobContent"
>
</comOverPackJobDetailCard>
</view>
</scroll-view>

5
src/pages/productReceipt/coms/comProductDetailCard.vue

@ -14,9 +14,9 @@
</uni-swipe-action-item>
</uni-swipe-action>
<view v-if="item.fgList!=undefined && item.fgList.length>0" class="card_view"
<view v-if="item.fgList!=undefined && item.fgList.length>0" class="card_view "
style="margin-left: 20px;" v-for="(fg, index) in item.fgList" :key="index">
<com-fg-card :detail='fg'></com-fg-card>
<com-fg-card :detail='fg' class="scan_view"></com-fg-card>
</view>
</view>
</uni-collapse-item>
@ -147,6 +147,7 @@
if (res) {
item.scaned = false
item.handleQty = null
item.fgList=[]
this.$forceUpdate()
this.$emit('remove', item)
}

38
src/pages/productReceipt/job/ccProductReceiptDetail.vue

@ -56,7 +56,7 @@
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<locationCompare ref="comScanLocation" title="收货库位"
:isShowEdit="jobContent.allowModifyLocation=='TRUE'" :recommendLocationCode="jobToLocationCode"
:recommendLocationCode="jobToLocationCode"
:locationCode="toLocationCode" @getLocation='scanLocationCode'
:locationAreaTypeList="toLocationAreaTypeList"></locationCompare>
</view>
@ -228,9 +228,6 @@
that.subList = res.data.subList;
that.jobStatus = res.data.status
that.jobToLocationCode = that.subList[0].toLocationCode
if (that.jobContent.allowModifyLocation == 'FALSE') {
that.toLocationCode = that.subList[0].toLocationCode
}
that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes)
that.detailSource = getDataSource(that.subList)
if (that.scanMessage) {
@ -269,7 +266,7 @@
} else {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.label.qty);
itemDetail.toLocationCode = this.toLocationCode;
itemDetail.toLocationCode = this.toLocationCode?this.toLocationCode:this.jobToLocationCode;
itemDetail.labelQty = Number(result.label.qty);
calcHandleQty(this.detailSource);
this.continueScan()
@ -306,12 +303,27 @@
scanLocationCode(location, code) {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
if(this.jobContent.allowModifyLocation=="TRUE"){
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
})
}else {
//
if(code!=this.jobToLocationCode){
this.showMessageHint("任务中不允许修改库位\n扫描库位["+code+"]推荐库位是["+this.jobToLocationCode+"]",callBack=>{
})
}else {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
}
}
},
checkLocation() {
@ -347,9 +359,11 @@
return
}
}else{
this.toLocationCode = this.jobToLocationCode
this.toLocationCode = this.toLocationCode?this.toLocationCode:this.jobToLocationCode
}
if(!this.toLocationCode){
return;
}
//
if (this.scanCount == this.subList.length) {

79
src/pages/productReceipt/job/fgProductReceiptDetail.vue

@ -52,9 +52,9 @@
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<locationCompare title="收货库位" :isShowEdit="jobContent.allowModifyLocation=='TRUE'"
:recommendLocationCode="jobToLocationCode" :locationCode="toLocationCode"
@getLocation='scanLocationCode' :locationTypeList="toLocationTypeList"></locationCompare>
<locationCompare ref="comScanLocation" title="收货库位" :recommendLocationCode="jobToLocationCode"
:locationCode="toLocationCode" @getLocation='scanLocationCode'
:locationTypeList="toLocationTypeList"></locationCompare>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
@ -231,16 +231,9 @@
that.subList = res.data.subList;
that.jobStatus = res.data.status
that.jobToLocationCode = that.subList[0].toLocationCode
that.productionLineCode = that.subList[0].productionLineCode;
var valiDate = getSwitchInfoByCode("fgProductReceipCommitValidate")
if(valiDate){
that.jobContent.allowModifyLocation = 'TRUE'
}else{
that.jobContent.allowModifyLocation = 'FALSE'
}
// if (that.jobContent.allowModifyLocation == 'FALSE') {
// that.toLocationCode = that.subList[0].toLocationCode
that.productionLineCode = that.subList[0].productionLineCode;
// if (that.jobContent.allowModifyLocation == 'FALSE') {
// that.toLocationCode = that.subList[0].toLocationCode
// }
that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes)
that.detailSource = getDataSource(that.subList)
@ -317,6 +310,7 @@
})
//
if (pack.scaned && pack.qty == pack.fgList.length) {
this.closeScanPopup();
this.commit()
}
})
@ -340,20 +334,41 @@
},
scanLocationCode(location, code) {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
//
if (this.jobContent.allowModifyLocation == "TRUE") {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
})
} else {
//
if (code != this.jobToLocationCode) {
this.showMessageHint("任务中不允许修改库位\n扫描库位[" + code + "]推荐库位是[" + this.jobToLocationCode + "]",
callBack => {})
} else {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
}
}
},
checkLocation() {
var isPass = true;
if (this.toLocationCode == "" || this.toLocationCode == null) {
this.showMessageHint('请扫描收货库位', callback => {
this.$refs.comScanLocation.showLocation();
})
this.$refs.comScanLocation.showLocation();
// this.showMessageHint('', callback => {
// this.$refs.comScanLocation.showLocation();
// })
return isPass = false;
}
return isPass;
@ -442,21 +457,27 @@
});
})
},
commit() {
// this.scanCount = getScanCount(this.subList);
// if (this.scanCount == 0) {
// this.showErrorMessage("0,")
// return;
// }
var valiDate = getSwitchInfoByCode("fgProductReceipCommitValidate")
//
if(valiDate){
if (!this.checkLocation()) {
return
}
}else{
this.toLocationCode = this.jobToLocationCode
var valiDate = getSwitchInfoByCode("fgProductReceipCommitValidate")
//
if (valiDate) {
if (!this.checkLocation()) {
return
}
} else {
this.toLocationCode = this.toLocationCode ? this.toLocationCode : this.jobToLocationCode
}
if(!this.toLocationCode){
return;
}
this.detailSource.forEach(item => {
item.subList.forEach(subitem => {
if (valiDate) {

2
src/pages/productionReceipt/coms/comProductionJobCard.vue

@ -1,7 +1,7 @@
<template>
<job-com-main-card :dataContent="dataContent">
<jobComMainDetailCard :dataContent="dataContent"></jobComMainDetailCard>
<view class="task_item" style="margin-left: 15px;">
<view class="task_item" style="margin-left: 20rpx;">
<view class="task_text">
<view class="card_view">
<text class="card_packing_code ">生产线</text>

10
src/pages/productionReceipt/job/productionReceiptDetail.vue

@ -216,6 +216,7 @@
},
autoCommit(){
var that =this
//
let str=""
this.detailSource.forEach((item) => {
@ -236,11 +237,16 @@
str = '任务明细未全部完成,是否提交?\n'+str
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
this.$throttle(this.commit,2000,this)()
setTimeout(res=>{
that.$throttle(that.commit,2000,that)()
},100)
}
});
} else {
this.$throttle(this.commit,2000,this)()
setTimeout(res=>{
that.$throttle(that.commit,2000,that)()
},100)
}
},

157
src/pages/productionReceipt/job/productionReceiptJob.vue

@ -1,15 +1,28 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter ref="filter" otherTitle="ASN"
:isShowProductionLineCode="true"
:productionline="productionLineList"
:isShowItemCode="true"
:isShowQurery='true'
@onQuery="getListByFilter">
<view class="uni-flex" style="flex-direction: column;;">
<job-filter ref="filter" otherTitle="ASN" :isShowProductionLineCode="false" :isShowItemCode="false"
:isShowQurery='true' @onQuery="getListByFilter">
</job-filter>
<view style="background-color: #fff; padding-left: 20rpx; border-radius: 15rpx;">
<view class="uni-flex space-between u-col-center" style="width: 100%;padding-top: 20rpx;">
<view class="" style="font-size: 32rpx; font-weight: bold;">
收料生产线 :
</view>
<uni-data-select class="uni-data-select" style="margin-left: 10rpx;" placeholder="请输入生产线"
v-model="productionLineCode" :clear="false" :localdata="productionLineList"
@change="productionLineCodeConfirm"></uni-data-select>
</view>
<view class="uni-flex space-between u-col-center" style="width: 100%;margin-top: 30rpx;">
<view class="" style="font-size: 32rpx;font-weight: bold;">
物料代码 :
</view>
<u-input style="margin-left: 20rpx;" confirmType="search" v-model="filterItemCode" :border="true"
placeholder="请输入物料代码" @confirm="itemCodeConfirm" />
</view>
</view>
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<view v-if="jobList.length>0">
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in jobList" :key="index">
@ -44,7 +57,7 @@
goHome,
updateTitle
} from '@/common/basic.js';
import {
planRefreshTime,
productionReceiptJobFilter
@ -94,17 +107,22 @@
scanMessage: "",
productionLineList: [],
productionLine: "",
filterItemCode:"",
productionLineCode:""
filterItemCode: "",
productionLineCode: "",
};
},
onLoad(option) {
this.title = option.title
this.getProductionReceiptJobByProductionline()
},
onShow() {
this.getList('refresh')
if(this.productionLineList==0){
this.getProductionReceiptJobByProductionline()
}else {
this.getList('refresh')
}
},
onReady() {
@ -145,27 +163,36 @@
methods: {
getProductionReceiptJobByProductionline() {
uni.showLoading({
title: "获取生产线",
mask: true
})
getProductionReceiptJobByProductionline().then(res => {
if (res.code == 0) {
this.productionLineList = res.data.map(item => ({
value: item.value,
text: item.name
}))
this.productionLineList.unshift({
value: "",
text: "全部"
uni.hideLoading()
if (res.data && res.data.length > 0) {
this.productionLineList = res.data;
res.data.forEach(item => {
item.value = item.value,
item.text = item.value+"("+item.name+")"
})
this.productionLineList = res.data
this.productionLineCode = this.productionLineList[0].value
} else {
this.productionLineList = []
}
this.getList('refresh')
}).catch(error => {
uni.hideLoading()
this.showMessage(error)
this.getList('refresh')
})
},
setQueryParam(){
setQueryParam() {
var filterParams = []
var queryParams=uni.getStorageSync(productionReceiptJobFilter)
var queryParams = uni.getStorageSync(productionReceiptJobFilter)
//
if (queryParams.creationTime ) {
if (queryParams.creationTime) {
filterParams.push({
column: "create_time",
action: "betweeen",
@ -179,14 +206,14 @@
action: "in",
value: queryParams.status
})
}else {
} else {
filterParams.push({
column: "status",
action: "in",
value: "1,2"
})
}
//线
if (queryParams.productionLineCode) {
filterParams.push({
@ -194,6 +221,17 @@
action: "==",
value: queryParams.productionLineCode
})
this.productionLineCode=queryParams.productionLineCode
}else{
if(this.productionLineCode){
filterParams.push({
column: "productionLineCode",
action: "==",
value: this.productionLineCode
})
}
}
//
if (queryParams.itemCode) {
@ -202,10 +240,20 @@
action: "like",
value: queryParams.itemCode
})
this.filterItemCode = queryParams.itemCode
}else {
if(this.filterItemCode){
filterParams.push({
column: "itemCode",
action: "like",
value: this.filterItemCode
})
}
}
return filterParams;
},
getList(type) {
let that = this;
@ -219,12 +267,14 @@
this.pageNo = 1;
this.jobList = [];
}
var queryFiltersParams =this.setQueryParam()
var queryFiltersParams = this.setQueryParam()
var params = {
filters: queryFiltersParams,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
console.log("查询条件",JSON.stringify(params))
getProductionReceiptJobList(params).then(res => {
uni.hideLoading();
@ -243,7 +293,6 @@
this.jobList = type === "refresh" ? list : this.jobList.concat(list);
this.pageNo++;
}).catch(error => {
if (type === "refresh") {
uni.stopPullDownRefresh();
@ -304,12 +353,12 @@
},
showMessage(message) {
if(this.$refs.scanPopup){
if (this.$refs.scanPopup) {
this.$refs.scanPopup.packLoseFocus()
}
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
if(this.$refs.scanPopup){
if (this.$refs.scanPopup) {
this.$refs.scanPopup.packGetFocus()
}
}
@ -350,9 +399,9 @@
action: "==",
value: this.$store.state.user.id
},
]
if(this.productionLineCode){
filters.push({
column: "productionLineCode",
@ -394,12 +443,40 @@
this.showMessage(e.message)
}
},
getListByFilter(params) {
this.productionLineCode =params.productionLineCode
uni.setStorageSync(productionReceiptJobFilter,params)
params.productionLineCode=this.productionLineCode
params.itemCode=this.filterItemCode
uni.setStorageSync(productionReceiptJobFilter, params)
var test =uni.getStorageSync(productionReceiptJobFilter)
this.getList('refresh')
},
productionLineCodeConfirm(e) {
var params = uni.getStorageSync(productionReceiptJobFilter)
this.productionLineCode = e;
//
if(!params){
params={
productionLineCode:"",
itemCode:""
}
}
this.getListByFilter(params)
},
itemCodeConfirm(itemCode) {
var params = uni.getStorageSync(productionReceiptJobFilter)
this.filterItemCode = itemCode;
//
if(!params){
params = {
productionLineCode:"",
itemCode:""
}
}
this.getListByFilter(params)
}
}
}
</script>

522
src/pages/productionReturn/job/holdToReturnDetail.vue

@ -0,0 +1,522 @@
<template>
<view class="page-wraper">
<view class="page-header">
<view class="header-view">
<view class="header_job_top">
<job-top :dataContent="jobContent"></job-top>
</view>
<work-station :workshopCode="jobContent.workshopCode" :productionLineCode="titleInfo.productionLineCode"
:workStationCode="titleInfo.workStationCode" :rawLocationCode="titleInfo.fromLocationCode">
</work-station>
</view>
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<com-return-detail-card :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData"
:locationAreaTypeList='toLocationAreaTypeList'>
</com-return-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="">
<locationCompare ref="locationCompare" title="目标库位" :recommendLocationCode="jobToLocationCode"
:locationCode="toLocationCode" @getLocation='scanLocationCode'
:locationAreaTypeList="toLocationAreaTypeList"></locationCompare>
</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>
<!-- <win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location> -->
<win-scan-pack ref="scanPopup" @getResult='getScanResult' headerType="HMQ,HPQ"></win-scan-pack>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getProductionReturnJobDetail,
productionReturnJobSubmit,
takeProductionReturnJob,
cancleTakeProductionReturnJob
} from '@/api/request2.js';
import {
goHome,
navigateBack,
getPackingNumberAndBatch
} from '@/common/basic.js';
import {
getDirectoryItemArray,
getInventoryStatusName
} from '@/common/directory.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
import {
getDataSource,
createRecordInfo,
calcHandleQty,
getScanCount
} from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import locationCompare from '@/mycomponents/location/locationCompare.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import comReturnDetailCard from "@/pages/productionReturn/coms/comReturnDetailCard.vue"
import detailInfoPopup from '@/pages/productionReturn/coms/detailInfoPopup.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import workStation from '@/mycomponents/workStation/workStation.vue'
export default {
name: 'receipt_detail',
components: {
winScanButton,
locationCompare,
// winScanPackAndLocation,
winScanPack,
comReturnDetailCard,
detailInfoPopup,
jobTop,
workStation
},
data() {
return {
id: '',
jobContent: {},
toLocationCode: '',
scanCount: 0,
subList: [], //subList
detailSource: [], //
fromLocationCode: '',
toLocationAreaTypeList: [],
toLocationInfo: {},
businessTypeInfo: {},
titleInfo: "",
jobStatus: "",
jobToLocationCode: ""
};
},
onLoad(option) {
uni.setNavigationBarTitle({
title: option.title + '详情'
})
this.id = option.id;
if (this.id != undefined) {
// //
if (option.status == "1") {
this.receive((callback => {
this.getDetail();
}));
} else {
this.getDetail();
}
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
//
onBackPress(e) {
//
if (e.from == 'backbutton') {
if (this.jobStatus == "2") {
//
cancleTakeProductionReturnJob(this.id).then(res => {
uni.navigateBack();
}).catch(error => {
uni.navigateBack();
})
} else {
uni.navigateBack();
}
return true;
}
},
onPullDownRefresh() {
this.getDetail();
uni.stopPullDownRefresh();
},
mounted() {
},
methods: {
//
receive(callback) {
if (this.id != null) {
takeProductionReturnJob(this.id).then(res => {
callback();
}).catch(error => {
this.showErrorMessage(error)
})
}
},
getDetail() {
var that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getProductionReturnJobDetail(that.id).then(res => {
uni.hideLoading();
if (res.data == null) {
that.showMessage('未获取到详情');
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.jobStatus = res.data.status
that.subList = res.data.subList;
that.detailSource = getDataSource(that.subList)
that.fromLocationCode = that.subList[0].fromLocationCode
that.jobToLocationCode = that.subList[0].toLocationCode
that.titleInfo = that.subList[0];
that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes);
} else {
that.showMessage('列表数据为0');
}
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
calcHandleQty() {
calcHandleQty(this.detailSource)
this.continueScan();
this.$forceUpdate();
},
//
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();
// let fromlocationCode = '';
// let fromlocationList = [];
// for (var i = 0; i < this.detailSource.length; i++) {
// let item = this.detailSource[i];
// item.subList.forEach(l => {
// //
// var location = fromlocationList.find(res => res == l.fromLocationCode)
// if (location == undefined) {
// fromlocationList.push(l.fromLocationCode);
// }
// //
// if (fromlocationCode == '') {
// if (!l.scaned) {
// fromlocationCode = l.fromLocationCode;
// }
// }
// })
// }
// this.$refs.scanPopup.openScanPopupForJob(fromlocationCode, fromlocationList, this.jobContent);
},
getScanResult(result) {
try {
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var itemCode = result.label.itemCode;
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(result.package.qty)
itemDetail.inventoryStatus = "OK"
itemDetail.packQty = result.package.packQty
itemDetail.packUnit = result.package.packUnit
this.calcHandleQty();
//退,退000000 --nxt
// let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
// let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
// if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
// this.showQuestionMessage('[' + balanceStatus + '][' + itemStatus +
// '],?', res => {
// if (res) {
// itemDetail.scaned = true;
// itemDetail.handleQty = Number(result.balance.qty)
// itemDetail.balance = result.balance;
// itemDetail.balance.balanceQty = result.balance.qty;
// itemDetail.balance.packQty = result.package.packQty
// itemDetail.balance.packUnit = result.package.packUnit
// this.calcHandleQty();
// } else {
// this.scanPopupGetFocus();
// }
// });
// } else {
// itemDetail.scaned = true;
// itemDetail.handleQty = Number(result.balance.qty)
// itemDetail.balance = result.balance;
// itemDetail.balance.balanceQty = result.balance.qty;
// itemDetail.balance.packQty = result.package.packQty
// itemDetail.balance.packUnit = result.package.packUnit
// this.calcHandleQty();
// }
}
}
}
this.scanPopupGetFocus();
} catch (e) {
this.showErrorMessage(e.message);
}
},
scanLocationCode(location, code) {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
},
commit() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
if (!this.checkLocation()) {
return
}
//
if (this.scanCount == this.subList.length) {
this.submitJob();
} else if (this.scanCount < this.subList.length) {
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.$refs.comMessage.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
this.submitJob()
}
});
} else {
//
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
this.openScanPopup();
}
});
}
}
},
submitJob() {
uni.showLoading({
title: "提交中....",
mask: true
});
var itemCodes = []
this.detailSource.forEach(item => {
itemCodes.push(item.itemCode)
})
var param = {
itemCode: itemCodes,
locationCode: this.toLocationCode
}
getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
productionReturnJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功\n生成隔离退料记录\n" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
});
},
setParams() {
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
detail.packingNumber, detail.batch);
detail.toPackingNumber = detail.packingNumber;
detail.toContainerNumber = detail.containerNumber;
detail.toBatch = detail.batch;
detail.toLocationCode = detail.toLocationCode;
subList.push(detail)
}
})
})
this.jobContent.subList = subList
this.jobContent.creator = creator;
return this.jobContent;
},
checkLocation() {
var isPass = true;
if (this.toLocationCode == "" || this.toLocationCode == null) {
this.showMessageHint('请扫描收货库位', callback => {
this.$refs.locationCompare.showLocation();
})
return isPass = false;
}
return isPass;
},
showMessageHint(hint, callback) {
this.$refs.comMessage.showErrorMessage(hint, res => {
if (res) {
callback()
}
});
},
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()
}
});
})
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
closeScanPopup() {
this.$refs.scanPopup.closeScanPopup();
},
// scanPopupGetFocus() {
// this.$refs.scanPopup.getFocus();
// },
// scanPopupLoseFocus() {
// this.$refs.scanPopup.loseFocus();
// },
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus();
}
},
scanPopupLoseFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.losefocus();
}
},
showQuestionMessage(message, callback) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showQuestionMessage(message, res => {
if (res) {
callback(res);
}
});
})
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
navigateBack(1)
})
},
}
}
</script>
<style scoped lang="scss">
</style>

298
src/pages/productionReturn/job/holdToReturnJob.vue

@ -0,0 +1,298 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask">
</job-filter>
<view v-if="jobList.length>0">
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in jobList" :key="index">
<uni-swipe-action-item
:right-options="item.status=='2'?detailGiveupOptions:detailOptions"
@click="swipeClick($event,item)">
<com-return-job-card :dataContent="item" @click='openJobDetail(item)'></com-return-job-card>
</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" v-if="jobList.length>0" />
</view>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getProductionHoldReturnJobList,
cancleTakeProductionReturnJob
} from '@/api/request2.js';
import {
goHome,
updateTitle
} from '@/common/basic.js';
import {
getDetailOption,
getDetailGiveupOption
} from '@/common/array.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comReturnJobCard from '@/pages/productionReturn/coms/comReturnJobCard.vue'
import jobListPopup from '@/pages/productionReturn/coms/jobListPopup.vue'
import jobInfoPopup from '@/pages/productionReturn/coms/jobInfoPopup.vue'
export default {
components: {
comEmptyView,
jobFilter,
comReturnJobCard,
jobListPopup,
jobInfoPopup
},
data() {
return {
jobList: [],
pageNo: 1,
pageSize: 10,
totalCount: 0,
loadingType: "nomore",
checkedToday: false,
checkedWaitTask: false,
todayTime: "",
status: '1,2', //
detailOptions: [],
detailGiveupOptions: [],
title:''
};
},
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: {
getList(type) {
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.jobList = [];
}
var filters = []
if (this.checkedToday) {
filters.push({
column: "create_time",
action: "betweeen",
value: this.todayTime
})
}
filters.push({
column: "status",
action: "in",
value: this.status
})
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
getProductionHoldReturnJobList(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;
}
this.jobList = type === "refresh" ? list : this.jobList.concat(list);
this.pageNo++;
}).catch(error => {
if (type === "refresh") {
uni.stopPullDownRefresh();
}
updateTitle(this.title);
this.loadingType = "";
uni.hideLoading();
that.showMessage(error)
})
},
openJobDetail(item) {
uni.navigateTo({
url: './holdToReturnDetail?id=' + item.masterId + '&status=' + item.status+'&title='+this.title
});
},
showItemList(itemList) {
this.$refs.jobListPopup.openPopup(itemList);
},
selectedItem(item) {
this.openJobDetail(item);
},
swipeClick(e, dataContent) {
if (e.content.text == "详情") {
this.openjobInfoPopup(dataContent);
} else if (e.content.text == "放弃") {
this.$refs.comMessage.showQuestionMessage("确定要放弃当前任务?",
res => {
if (res) {
this.cancleJob(dataContent.masterId);
}
});
}
},
openjobInfoPopup(item) {
this.$refs.jobInfoPopup.openPopup(item)
},
cancleJob(id) {
cancleTakeProductionReturnJob(id).then(res => {
if(res.data){
this.getList("refresh")
uni.showToast({
title:"放弃任务成功"
})
}else {
this.showMessage("放弃任务失败")
}
}).catch(error => {
this.showMessage(error)
})
},
switchChangeToday(state, creationTime) {
this.checkedToday = state;
this.todayTime = creationTime;
this.getList("refresh");
},
switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state;
this.status = jobStatus;
this.getList("refresh");
},
getScanNumber(code) {
this.getDataListByType(code)
},
getDataListByType(code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
var filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "number",
action: "==",
value: code
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getProductionHoldReturnJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的收货任务');
} else if (res.data.list.length == 1) {
that.openJobDetail(res.data.list[0]);
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
showMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
}
}
</script>
<style scoped lang="scss">
</style>

522
src/pages/productionReturn/job/okToReturnDetail.vue

@ -0,0 +1,522 @@
<template>
<view class="page-wraper">
<view class="page-header">
<view class="header-view">
<view class="header_job_top">
<job-top :dataContent="jobContent"></job-top>
</view>
<work-station :workshopCode="jobContent.workshopCode" :productionLineCode="titleInfo.productionLineCode"
:workStationCode="titleInfo.workStationCode" :rawLocationCode="titleInfo.fromLocationCode">
</work-station>
</view>
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<com-return-detail-card :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData"
:locationAreaTypeList='toLocationAreaTypeList'>
</com-return-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="">
<locationCompare ref="locationCompare" title="目标库位" :recommendLocationCode="jobToLocationCode"
:locationCode="toLocationCode" @getLocation='scanLocationCode'
:locationAreaTypeList="toLocationAreaTypeList"></locationCompare>
</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>
<!-- <win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location> -->
<win-scan-pack ref="scanPopup" @getResult='getScanResult' headerType="HMQ,HPQ"></win-scan-pack>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getProductionReturnJobDetail,
productionReturnJobSubmit,
takeProductionReturnJob,
cancleTakeProductionReturnJob
} from '@/api/request2.js';
import {
goHome,
navigateBack,
getPackingNumberAndBatch
} from '@/common/basic.js';
import {
getDirectoryItemArray,
getInventoryStatusName
} from '@/common/directory.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
import {
getDataSource,
createRecordInfo,
calcHandleQty,
getScanCount
} from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import locationCompare from '@/mycomponents/location/locationCompare.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import comReturnDetailCard from "@/pages/productionReturn/coms/comReturnDetailCard.vue"
import detailInfoPopup from '@/pages/productionReturn/coms/detailInfoPopup.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import workStation from '@/mycomponents/workStation/workStation.vue'
export default {
name: 'receipt_detail',
components: {
winScanButton,
locationCompare,
// winScanPackAndLocation,
winScanPack,
comReturnDetailCard,
detailInfoPopup,
jobTop,
workStation
},
data() {
return {
id: '',
jobContent: {},
toLocationCode: '',
scanCount: 0,
subList: [], //subList
detailSource: [], //
fromLocationCode: '',
toLocationAreaTypeList: [],
toLocationInfo: {},
businessTypeInfo: {},
titleInfo: "",
jobStatus: "",
jobToLocationCode: ""
};
},
onLoad(option) {
uni.setNavigationBarTitle({
title: option.title + '详情'
})
this.id = option.id;
if (this.id != undefined) {
// //
if (option.status == "1") {
this.receive((callback => {
this.getDetail();
}));
} else {
this.getDetail();
}
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
//
onBackPress(e) {
//
if (e.from == 'backbutton') {
if (this.jobStatus == "2") {
//
cancleTakeProductionReturnJob(this.id).then(res => {
uni.navigateBack();
}).catch(error => {
uni.navigateBack();
})
} else {
uni.navigateBack();
}
return true;
}
},
onPullDownRefresh() {
this.getDetail();
uni.stopPullDownRefresh();
},
mounted() {
},
methods: {
//
receive(callback) {
if (this.id != null) {
takeProductionReturnJob(this.id).then(res => {
callback();
}).catch(error => {
this.showErrorMessage(error)
})
}
},
getDetail() {
var that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getProductionReturnJobDetail(that.id).then(res => {
uni.hideLoading();
if (res.data == null) {
that.showMessage('未获取到详情');
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.jobStatus = res.data.status
that.subList = res.data.subList;
that.detailSource = getDataSource(that.subList)
that.fromLocationCode = that.subList[0].fromLocationCode
that.jobToLocationCode = that.subList[0].toLocationCode
that.titleInfo = that.subList[0];
that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes);
} else {
that.showMessage('列表数据为0');
}
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
calcHandleQty() {
calcHandleQty(this.detailSource)
this.continueScan();
this.$forceUpdate();
},
//
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();
// let fromlocationCode = '';
// let fromlocationList = [];
// for (var i = 0; i < this.detailSource.length; i++) {
// let item = this.detailSource[i];
// item.subList.forEach(l => {
// //
// var location = fromlocationList.find(res => res == l.fromLocationCode)
// if (location == undefined) {
// fromlocationList.push(l.fromLocationCode);
// }
// //
// if (fromlocationCode == '') {
// if (!l.scaned) {
// fromlocationCode = l.fromLocationCode;
// }
// }
// })
// }
// this.$refs.scanPopup.openScanPopupForJob(fromlocationCode, fromlocationList, this.jobContent);
},
getScanResult(result) {
try {
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var itemCode = result.label.itemCode;
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(result.package.qty)
itemDetail.inventoryStatus = "OK"
itemDetail.packQty = result.package.packQty
itemDetail.packUnit = result.package.packUnit
this.calcHandleQty();
//退,退000000 --nxt
// let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
// let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
// if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
// this.showQuestionMessage('[' + balanceStatus + '][' + itemStatus +
// '],?', res => {
// if (res) {
// itemDetail.scaned = true;
// itemDetail.handleQty = Number(result.balance.qty)
// itemDetail.balance = result.balance;
// itemDetail.balance.balanceQty = result.balance.qty;
// itemDetail.balance.packQty = result.package.packQty
// itemDetail.balance.packUnit = result.package.packUnit
// this.calcHandleQty();
// } else {
// this.scanPopupGetFocus();
// }
// });
// } else {
// itemDetail.scaned = true;
// itemDetail.handleQty = Number(result.balance.qty)
// itemDetail.balance = result.balance;
// itemDetail.balance.balanceQty = result.balance.qty;
// itemDetail.balance.packQty = result.package.packQty
// itemDetail.balance.packUnit = result.package.packUnit
// this.calcHandleQty();
// }
}
}
}
this.scanPopupGetFocus();
} catch (e) {
this.showErrorMessage(e.message);
}
},
scanLocationCode(location, code) {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
},
commit() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
if (!this.checkLocation()) {
return
}
//
if (this.scanCount == this.subList.length) {
this.submitJob();
} else if (this.scanCount < this.subList.length) {
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.$refs.comMessage.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
this.submitJob()
}
});
} else {
//
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
this.openScanPopup();
}
});
}
}
},
submitJob() {
uni.showLoading({
title: "提交中....",
mask: true
});
var itemCodes = []
this.detailSource.forEach(item => {
itemCodes.push(item.itemCode)
})
var param = {
itemCode: itemCodes,
locationCode: this.toLocationCode
}
getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
productionReturnJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功\n生成合格退料记录\n" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
});
},
setParams() {
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
detail.packingNumber, detail.batch);
detail.toPackingNumber = detail.packingNumber;
detail.toContainerNumber = detail.containerNumber;
detail.toBatch = detail.batch;
detail.toLocationCode = detail.toLocationCode;
subList.push(detail)
}
})
})
this.jobContent.subList = subList
this.jobContent.creator = creator;
return this.jobContent;
},
checkLocation() {
var isPass = true;
if (this.toLocationCode == "" || this.toLocationCode == null) {
this.showMessageHint('请扫描收货库位', callback => {
this.$refs.locationCompare.showLocation();
})
return isPass = false;
}
return isPass;
},
showMessageHint(hint, callback) {
this.$refs.comMessage.showErrorMessage(hint, res => {
if (res) {
callback()
}
});
},
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()
}
});
})
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
closeScanPopup() {
this.$refs.scanPopup.closeScanPopup();
},
// scanPopupGetFocus() {
// this.$refs.scanPopup.getFocus();
// },
// scanPopupLoseFocus() {
// this.$refs.scanPopup.loseFocus();
// },
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus();
}
},
scanPopupLoseFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.losefocus();
}
},
showQuestionMessage(message, callback) {
setTimeout(r => {
this.scanPopupLoseFocus();
this.$refs.comMessage.showQuestionMessage(message, res => {
if (res) {
callback(res);
}
});
})
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
navigateBack(1)
})
},
}
}
</script>
<style scoped lang="scss">
</style>

298
src/pages/productionReturn/job/okToReturnJob.vue

@ -0,0 +1,298 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask">
</job-filter>
<view v-if="jobList.length>0">
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in jobList" :key="index">
<uni-swipe-action-item
:right-options="item.status=='2'?detailGiveupOptions:detailOptions"
@click="swipeClick($event,item)">
<com-return-job-card :dataContent="item" @click='openJobDetail(item)'></com-return-job-card>
</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" v-if="jobList.length>0" />
</view>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getProductionOkReturnJobList,
cancleTakeProductionReturnJob
} from '@/api/request2.js';
import {
goHome,
updateTitle
} from '@/common/basic.js';
import {
getDetailOption,
getDetailGiveupOption
} from '@/common/array.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comReturnJobCard from '@/pages/productionReturn/coms/comReturnJobCard.vue'
import jobListPopup from '@/pages/productionReturn/coms/jobListPopup.vue'
import jobInfoPopup from '@/pages/productionReturn/coms/jobInfoPopup.vue'
export default {
components: {
comEmptyView,
jobFilter,
comReturnJobCard,
jobListPopup,
jobInfoPopup
},
data() {
return {
jobList: [],
pageNo: 1,
pageSize: 10,
totalCount: 0,
loadingType: "nomore",
checkedToday: false,
checkedWaitTask: false,
todayTime: "",
status: '1,2', //
detailOptions: [],
detailGiveupOptions: [],
title:''
};
},
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: {
getList(type) {
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.jobList = [];
}
var filters = []
if (this.checkedToday) {
filters.push({
column: "create_time",
action: "betweeen",
value: this.todayTime
})
}
filters.push({
column: "status",
action: "in",
value: this.status
})
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
getProductionOkReturnJobList(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;
}
this.jobList = type === "refresh" ? list : this.jobList.concat(list);
this.pageNo++;
}).catch(error => {
if (type === "refresh") {
uni.stopPullDownRefresh();
}
updateTitle(this.title);
this.loadingType = "";
uni.hideLoading();
that.showMessage(error)
})
},
openJobDetail(item) {
uni.navigateTo({
url: './okToReturnDetail?id=' + item.masterId + '&status=' + item.status+'&title='+this.title
});
},
showItemList(itemList) {
this.$refs.jobListPopup.openPopup(itemList);
},
selectedItem(item) {
this.openJobDetail(item);
},
swipeClick(e, dataContent) {
if (e.content.text == "详情") {
this.openjobInfoPopup(dataContent);
} else if (e.content.text == "放弃") {
this.$refs.comMessage.showQuestionMessage("确定要放弃当前任务?",
res => {
if (res) {
this.cancleJob(dataContent.masterId);
}
});
}
},
openjobInfoPopup(item) {
this.$refs.jobInfoPopup.openPopup(item)
},
cancleJob(id) {
cancleTakeProductionReturnJob(id).then(res => {
if(res.data){
this.getList("refresh")
uni.showToast({
title:"放弃任务成功"
})
}else {
this.showMessage("放弃任务失败")
}
}).catch(error => {
this.showMessage(error)
})
},
switchChangeToday(state, creationTime) {
this.checkedToday = state;
this.todayTime = creationTime;
this.getList("refresh");
},
switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state;
this.status = jobStatus;
this.getList("refresh");
},
getScanNumber(code) {
this.getDataListByType(code)
},
getDataListByType(code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
var filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "number",
action: "==",
value: code
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getProductionOkReturnJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的收货任务');
} else if (res.data.list.length == 1) {
that.openJobDetail(res.data.list[0]);
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
showMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
}
}
</script>
<style scoped lang="scss">
</style>

12
src/pages/purchaseReceipt/job/receiptDetail.vue

@ -598,7 +598,11 @@
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
this.$refs.comMessage.showErrorMessage(error, res => {
if (res) {
navigateBack(1)
}
});
})
} else {
uni.hideLoading();
@ -615,9 +619,9 @@
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (!detail.scaned) {
detail.handleQty = 0
}
// if (!detail.scaned) {
// detail.handleQty = 0
// }
detail.packList.forEach(pack => {
if (!pack.scaned) {
pack.handleQty = 0

3
src/pages/putaway/job/putawayDetail.vue

@ -43,7 +43,8 @@
</winScanPackAndLocationNoBalance> -->
<winScanPackAndLocation :balanceFromInventoryStatuses="false" ref="scanPopup" @getResult='getScanResult'
:noShowBalanceMessage="true">
:noShowBalanceMessage="false">
</winScanPackAndLocation>
<comMessage ref="comMessage"></comMessage>

9
src/pages/repleinsh/coms/comRepleishDetailCard.vue

@ -29,7 +29,7 @@
<view v-for="(record,index) in batch.Records">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,batch,record,index)"
:right-options="scanOptions">
:right-options="settingParam.allowModifyQty=='TRUE'?scanOptions:removeOptions">
<!-- <view class="card_view" v-if="record.parentPackingNumber" >
<text class="card_packing_code card_content ">外包装</text>
<text class="card_content ">{{record.parentPackingNumber}}</text>
@ -70,7 +70,8 @@
import {
getDetailOption,
getEditRemoveOption
getEditRemoveOption,
getRemoveOption
} from '@/common/array.js';
export default {
@ -107,13 +108,15 @@
editItem: {},
batchItem: {},
detailOptions: [],
scanOptions: []
scanOptions: [],
removeOptions:[]
}
},
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getEditRemoveOption();
this.removeOptions = getRemoveOption()
},
methods: {

2
src/pages/stockUp/coms/comScanStockUpPack.vue

@ -293,7 +293,7 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
},
selectBalanceItem(balance) {
this.afterGetBalance(this.label, balance, this.packageInfo);
this.afterGetBalance(balance, balance, this.packageInfo);
},

9
src/pages/stockUp/coms/comStockUpDetailCard.vue

@ -30,7 +30,7 @@
<view v-for="(record,index) in batch.Records" :key="index">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,batch,record,index)"
:right-options="scanOptions">
:right-options="settingParam.allowModifyQty=='TRUE'?scanOptions:removeOptions">
<handle-balance :detail="record" :isShowLocation="false"
:isShowBatch="batch.packingNumber!=null">
</handle-balance>
@ -65,7 +65,8 @@
import {
getDetailOption,
getEditRemoveOption
getEditRemoveOption,
getRemoveOption
} from '@/common/array.js';
export default {
@ -102,13 +103,15 @@
editItem: {},
batchItem: {},
detailOptions: [],
scanOptions: []
scanOptions: [],
removeOptions: []
}
},
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getEditRemoveOption();
this.removeOptions = getRemoveOption()
},
methods: {

8
src/pages/stockUp/job/stockUpJobDetail.vue

@ -11,7 +11,12 @@
<view class="page-main">
<scroll-view scroll-y="true" class="">
<view v-for="(toLocation, index) in detailSource" :key="index">
<comStockUpDetailCard ref='comIssueDetailCard' :dataContent="toLocation" @updateData='updateData'>
<comStockUpDetailCard
ref='comIssueDetailCard'
:dataContent="toLocation"
@updateData='updateData'
:settingParam="jobContent"
>
</comStockUpDetailCard>
</view>
</scroll-view>
@ -183,7 +188,6 @@
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.jobStatus = res.data.status;
that.subList = res.data.subList;
that.detailSource = getDataSource(that.detailSource, that.subList)
// that.toLocationCode = that.subList[0].toLocationCode

170
src/pages/unPlanned/job/issueJobDetail.vue

@ -12,9 +12,9 @@
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<com-detail-card :dataContent="item" :index="index" :settingParam="jobContent"
<comRecommendDetailCard :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" @openDetail="openDetail">
</com-detail-card>
</comRecommendDetailCard>
</view>
</view>
</scroll-view>
@ -60,13 +60,21 @@
import {
getDataSource,
createRecordInfo,
calcHandleQty,
calcHandleNewQty,
getScanCount
} from '@/common/detail.js';
import {
calc
} from '@/common/calc'
import {
Decimal
} from 'decimal.js'; //
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue"
import comRecommendDetailCard from "@/mycomponents/detail/comRecommendDetailCard.vue"
import detailInfoPopup from '@/pages/unPlanned/coms/detailInfoPopup.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
@ -75,7 +83,7 @@
components: {
winScanButton,
winScanPackAndLocation,
comDetailCard,
comRecommendDetailCard,
detailInfoPopup,
jobTop
},
@ -166,6 +174,9 @@
that.jobContent = res.data;
that.jobStatus = res.data.status
that.subList = res.data.subList;
that.subList.forEach(item=>{
item.isRecommend = true
})
that.detailSource = getDataSource(that.subList)
} else {
that.showErrorMessage('列表数据为0');
@ -189,12 +200,22 @@
},
calcHandleQty() {
calcHandleQty(this.detailSource)
this.continueScan()
calcHandleNewQty(this.detailSource)
// this.continueScan()
this.$forceUpdate();
},
updateData() {
//
for (var i = 0; i < this.detailSource.length; i++) {
var item =this.detailSource[i]
for (var j = 0; j < item.subList.length; j++) {
var sub =item.subList[j]
if(!sub.isRecommend&&!sub.scaned){
item.subList.splice(j,1)
}
}
}
this.calcHandleQty();
},
@ -218,55 +239,34 @@
var itemDetail = detail.subList.find(r => {
return r.packingNumber == packingNumber &&
r.batch == batch &&
r.fromLocationCode == result.fromLocationCode
r.fromLocationCode == result.fromLocationCode&&
r.isRecommend==false
})
if (itemDetail == undefined) {
this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】库位【" + result
.fromLocationCode + "】不在列表中")
var newAdd = {
itemCode:itemCode,
packingNumber:packingNumber,
batch:batch,
handleQty:detail.qty<Number(result.balance.qty)?detail.qty:Number(result.balance.qty),
qty:detail.qty,
fromLocationCode:locationCode,
inventoryStatus:inventoryStatus,
toInventoryStatus:inventoryStatus,
balance:result.balance,
isRecommend:false,
isNewAdd:"newAdd"
}
newAdd.balance.balanceQty = Number(result.balance.qty);
newAdd.balance.packQty = Number(result.package.packQty)
newAdd.balance.packUnit = result.package.packUnit
newAdd.scaned = true;
detail.subList.push(newAdd)
this.calcHandleQty();
} else {
if (itemDetail.scaned) {
this.showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】库位【" + result
.fromLocationCode + "】已经扫描")
} else {
let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
if (this.jobContent.allowModifyInventoryStatus == "TRUE") {
this.showQuestionMessage('任务中允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,是否继续出库?', res => {
if (res) {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.balance.qty);
itemDetail.toInventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = Number(result.balance.qty);
itemDetail.balance.packQty = Number(result.package.packQty)
itemDetail.balance.packUnit = result.package.packUnit
this.calcHandleQty();
} else {
this.scanPopupGetFocus();
}
});
} else {
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,不允许转移!', res => {
this.scanPopupGetFocus();
});
}
} else {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.balance.qty);
itemDetail.toInventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = Number(result.balance.qty);
itemDetail.balance.packQty = Number(result.package.packQty)
itemDetail.balance.packUnit = result.package.packUnit
this.calcHandleQty();
}
}
}
}
}
} catch (e) {
@ -275,49 +275,55 @@
},
commit() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == 0) {
var scanCount=0;
this.detailSource.forEach((item) => {
item.subList.forEach(cur => {
if(cur.scaned){
scanCount++;
}
})
})
if(scanCount==0){
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
this.checkCount();
// this.scanCount = getScanCount(this.jobContent.subList);
// if (this.scanCount == 0) {
// this.showErrorMessage("0,")
// return;
// }
// //
if (this.scanCount == this.subList.length) {
this.checkCount();
} else if (this.scanCount < this.subList.length) {
//
if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.checkCount();
} else {
//
this.$refs.comMessage.showErrorMessage("任务明细未全部完成,不允许部分提交!", res => {
if (res) {
this.openScanPopup();
}
});
}
}
// // //
// if (this.scanCount == this.subList.length) {
// this.checkCount();
// } else if (this.scanCount < this.subList.length) {
// //
// if (this.jobContent.allowPartialComplete == "TRUE") {
// //
// this.checkCount();
// } else {
// //
// this.$refs.comMessage.showErrorMessage(",!", res => {
// if (res) {
// this.openScanPopup();
// }
// });
// }
// }
},
checkCount(){
//
let str = ''
this.detailSource.forEach((item) => {
item.subList.forEach(cur => {
if (cur.qty != cur.handleQty) {
var tempHandleQty =0
if(cur.handleQty){
tempHandleQty=cur.handleQty
}else {
tempHandleQty =0
}
str += `包装号【${cur.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致`
}
})
if(item.qty!=item.handleQty){
str += `物料号【${item.itemCode}】任务数量【${item.qty}】与实际提交数量【${item.handleQty}】不一致`
}
})
if (str) {
str = '任务明细未全部完成,是否提交?\n'+str
str = str+'\n是否提交?'
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
this.submitJob()
@ -357,7 +363,7 @@
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
if (detail.scaned&&!detail.isRecommend) {
detail.toPackingNumber = detail.packingNumber;
detail.toContainerNumber = '';
detail.toBatch = detail.batch;

Loading…
Cancel
Save