Browse Source

目标库位 2024/6/27 17:03:11

hella_vue3
zhang_li 3 months ago
parent
commit
584377da42
  1. 6
      src/hybrid/html/point.html
  2. 2
      src/mycomponents/job/jobComMainDetailCard.vue
  3. 165
      src/mycomponents/qty/compareQty.vue
  4. 57
      src/mycomponents/scan/winComScanFg.vue
  5. 16
      src/pages/index/index.vue
  6. 13
      src/pages/point/index.vue
  7. 4
      src/pages/productReceipt/coms/comFgCard.vue
  8. 75
      src/pages/productReceipt/job/fgProductReceiptDetail.vue

6
src/hybrid/html/point.html

@ -29,7 +29,10 @@
.left-item {
display: flex;
}
.bold-font{
font-weight: bold;
font-size: 28rpx;
}
.label {
border-bottom: 1px solid #b1b1b1;
border-right: 1px solid #b1b1b1;
@ -63,6 +66,7 @@
border-top: 1px solid #b1b1b1;
border-right: 1px solid #b1b1b1;
}
.image img {
width: 172px;

2
src/mycomponents/job/jobComMainDetailCard.vue

@ -7,7 +7,7 @@
<batch v-if="isShowBatch && dataContent.batch != null" :batch="dataContent.batch"></batch>
<div class="u-flex justify-between u-p-b-16">
<location v-if="isShowFromLocation && dataContent.fromLocationCode" title="来源库位" :locationCode="dataContent.fromLocationCode"> </location>
<to-location v-if="isShowToLocation" title="目标库位" :locationCode="dataContent.locationCode"> </to-location>
<to-location v-if="isShowToLocation" title="目标库位" :locationCode="dataContent.toLocationCode || dataContent.locationCode"> </to-location>
</div>
<view class="card_view" v-if="isShowDeliverType">
<text class="card_packing_code card_content">发货类型</text>

165
src/mycomponents/qty/compareQty.vue

@ -1,92 +1,91 @@
<template>
<view>
<status v-show="isShowStatus" :status='dataContent.inventoryStatus'></status>
<view class="u-flex u-row center">
<view class="u-flex u-row ">
<view v-if="Number(handleQty)!=0">
<view v-if="isShowRecommendQty" style='font-weight:bold'>
<view v-if="Number(recommendQty)>Number(handleQty)" class="text_greater">
{{Number(handleQty)}}
</view>
<view v-else-if="Number(recommendQty)<Number(handleQty)" class="text_less">
{{Number(handleQty)}}
</view>
<view v-else-if="Number(recommendQty) ==Number(handleQty)" class="text_equal">
{{Number(handleQty)}}
</view>
</view>
<view v-else>
<view class="text_balance">
{{Number(handleQty)}}
</view>
</view>
</view>
<view class="center" v-if="isShowRecommendQty">
<view v-if="Number(handleQty)!=0" class="std_split">/</view>
<view class="text_recommend ">
{{Number(recommendQty)}}
</view>
</view>
</view>
<uom :uom="dataContent.uom">
</uom>
</view>
<view>
<pack-unit v-show="isShowPackUnit" :dataContent="dataContent"></pack-unit>
</view>
</view>
<view>
<status v-show="isShowStatus" :status="dataContent.inventoryStatus"></status>
<view class="u-flex u-row center">
<view class="u-flex u-row">
<view v-if="Number(handleQty) != 0">
<view v-if="isShowRecommendQty" style="font-weight: bold">
<view v-if="Number(recommendQty) > Number(handleQty)" class="text_greater">
{{ Number(handleQty) }}
</view>
<view v-else-if="Number(recommendQty) < Number(handleQty)" class="text_less">
{{ Number(handleQty) }}
</view>
<view v-else-if="Number(recommendQty) == Number(handleQty)" class="text_equal">
{{ Number(handleQty) }}
</view>
</view>
<view v-else>
<view class="text_balance">
{{ Number(handleQty) }}
</view>
</view>
</view>
<view class="center" v-if="isShowRecommendQty">
<view v-if="Number(handleQty) != 0" class="std_split">/</view>
<view class="text_recommend">
{{ Number(recommendQty) }}
</view>
</view>
</view>
<!-- <uom :uom="dataContent.uom">
</uom> -->
<uom v-show="Number(handleQty) != 0 || (isShowRecommendQty && Number(recommendQty) > 0)" :uom="dataContent.uom"> </uom>
</view>
<view>
<pack-unit v-show="isShowPackUnit" :dataContent="dataContent"></pack-unit>
</view>
</view>
</template>
<script setup lang="ts">
import {
watch
} from 'vue'
// import packQty from '@/mycomponents/qty/packQty.vue'
import packUnit from '@/mycomponents/qty/packUnit.vue'
import uom from '@/mycomponents/qty/uom.vue'
import status from '@/mycomponents/status/status.vue'
const props = defineProps({
type: {
type: String,
default: 'default' //recommend: compare:
},
import { watch } from 'vue'
// import packQty from '@/mycomponents/qty/packQty.vue'
import packUnit from '@/mycomponents/qty/packUnit.vue'
import uom from '@/mycomponents/qty/uom.vue'
import status from '@/mycomponents/status/status.vue'
dataContent: {
type: Object,
default: null
},
recommendQty: {
type: Number,
default: 0
},
const props = defineProps({
type: {
type: String,
default: 'default' // recommend: compare:
},
handleQty: {
type: Number,
default: 0
},
dataContent: {
type: Object,
default: null
},
recommendQty: {
type: Number,
default: 0
},
isShowStatus: {
type: Boolean,
default: true
},
isShowPackUnit: {
type: Boolean,
default: true
},
isShowRecommendQty: {
type: Boolean,
default: true
}
})
watch(
() => props.handleQty,
(val : boolean) => {},
{
immediate: true,
deep: true
}
)
handleQty: {
type: Number,
default: 0
},
isShowStatus: {
type: Boolean,
default: true
},
isShowPackUnit: {
type: Boolean,
default: true
},
isShowRecommendQty: {
type: Boolean,
default: true
}
})
watch(
() => props.handleQty,
(val: boolean) => {},
{
immediate: true,
deep: true
}
)
</script>
<style lang="scss">
</style>
<style lang="scss"></style>

57
src/mycomponents/scan/winComScanFg.vue

@ -169,33 +169,48 @@ const handelScanMsg = () => {
.then((res) => {
try {
if (res.data.list.length == 0) {
throw new Error(`没有查找到物料号【${itemCode.value}】对应的mes物料号`)
throw new Error(`没有查找到物料号【${itemCode.value}】对应的生产条码配置`)
}
const result = res.data.list[0]
const { partNumber } = result
const result = res.data.list[0] // Mes
const { partNumber } = result //
const { lengthMat } = result
const { lengthBc } = result
// Q5,,TypeQ5
if (result.Type == 'P') {
const scanPartNumber = content.substr(0, lengthMat) //
// const productDate = content.substr(lengthMat, 8)
// const batch = content.substr(lengthMat + 8, 3)
const order = content.substr(-8)
if (scanPartNumber != partNumber) {
clear()
throw new Error(`解析错误:扫描的客户物料号【${scanPartNumber}】与生成条码配置表中的客户物料号【${partNumber}】不一致`)
}
let itemCode = content.substr(0, lengthMat)
const productDate = content.substr(lengthMat, 8)
const batch = content.substr(lengthMat + 8, 3)
const order = content.substr(-8)
if (itemCode != partNumber) {
const scanResult = {
itemCode: scanPartNumber,
// productDate,
// batch,
order,
qty: 1,
content,
success: true
}
clear()
throw new Error(`解析错误:扫描物料号【${itemCode}】与查询物料号【${partNumber}】不一致`)
}
const scanResult = {
itemCode,
productDate,
batch,
order,
qty: 1,
content,
success: true
emit('getResult', scanResult)
} else {
// ,
const scanResult = {
itemCode: itemCode.value,
// productDate: new Date(),
// batch: new Date(),
order: 0,
qty: 1,
content,
success: true
}
clear()
emit('getResult', scanResult)
}
clear()
emit('getResult', scanResult)
} catch (error) {
comMessageRef.value.showErrorMessage(error.message, (res) => {
if (res) {

16
src/pages/index/index.vue

@ -132,8 +132,20 @@ onHide(() => {
})
onShow(() => {
if (uni.getStorageSync('hasLogin') == null || uni.getStorageSync('hasLogin') == false) {
uni.reLaunch({
url: '../login/index'
uni.showModal({
title: '未登录',
content: '您未登录 , 需要登录后才能继续', //
showCancel: !forcedLogin.value,
success: (res) => {
if (res.confirm) {
// 使reLanch
if (forcedLogin.value) {
uni.reLaunch({
url: '../login/index'
})
}
}
}
})
} else {
timerRefresh()

13
src/pages/point/index.vue

@ -5,7 +5,7 @@
<view class="left">
<view class="left-item">
<view class="label">物品代码</view>
<view class="value" id="name1">{{ item.itemCode }}</view>
<view class="value bold-font" id="name1">{{ item.itemCode }}</view>
</view>
<view class="left-item">
<view class="label">物品名称</view>
@ -29,7 +29,7 @@
</view>
<view class="left-item">
<view class="label">数量</view>
<view class="value">{{item.qty}}</view>
<view class="value bold-font">{{item.qty}}</view>
</view>
</view>
<view class="right">
@ -118,7 +118,7 @@
<div class="left">
<div class="left-item">
<div class="label">物品代码</div>
<div class="value" id="name1">${item.itemCode}</div>
<div class="value bold-font" id="name1">${item.itemCode}</div>
</div>
<div class="left-item">
<div class="label">物品名称</div>
@ -142,7 +142,7 @@
</div>
<div class="left-item">
<div class="label">数量</div>
<div class="value">${item.qty}</div>
<div class="value bold-font">${item.qty}</div>
</div>
</div>
<div class="right">
@ -258,7 +258,10 @@
.left-item {
display: flex;
}
.bold-font{
font-weight: bold;
font-size: 28rpx;
}
.label {
border-bottom: 1px solid #b1b1b1;
border-right: 1px solid #b1b1b1;

4
src/pages/productReceipt/coms/comFgCard.vue

@ -7,10 +7,10 @@
<text class="card_item_code">零件号</text>
<text class="card_content">{{ detail.itemCode }}</text>
</view>
<view>
<!-- <view>
<text class="card_product_date">生产日期</text>
<text class="card_content">{{ detail.productDate }}</text>
</view>
</view> -->
<!-- <view>
<text class="card_batch card_content ">批次</text>

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

@ -69,7 +69,7 @@ import { Decimal } from 'decimal.js' // 引入
import { getManagementPrecisions } from '@/common/balance.js'
import { getCurrDateTime, goHome, navigateBack, getPackingNumberAndBatch, getSwitchInfoByCode } from '@/common/basic.js'
import { getProductReceiptJobDetail, takeProductReceiptJob, cancleTakeProductReceiptJob, productReceiptJobsubmit, getPrintProductReceiptList, getBalanceToPackage, batchPrintingLable } from '@/api/request2.js'
import { getProductReceiptJobDetail, takeProductReceiptJob, cancleTakeProductReceiptJob, productReceiptJobsubmit, getPrintProductReceiptList, getBalanceToPackage, batchPrintingLable, isCheckMesCode } from '@/api/request2.js'
import { getDirectoryItemArray, getInventoryStatusName } from '@/common/directory.js'
@ -203,37 +203,46 @@ const getDetail = () => {
const getScanResult = (result) => {
// TODO
if (detailSource.value.length > 0) {
const item = detailSource.value[0] //
result.uom = item.uom
if (item.subList.length > 0) {
const subItem = item.subList[0]
subItem.scaned = true
if (subItem.fgList == undefined) {
subItem.fgList = []
}
// mes
isCheckMesCode(result.content)
.then((res) => {
if (res.data) {
if (detailSource.value.length > 0) {
const item = detailSource.value[0] //
result.uom = item.uom
if (item.subList.length > 0) {
const subItem = item.subList[0]
subItem.scaned = true
if (subItem.fgList == undefined) {
subItem.fgList = []
}
if (subItem.fgList.length == 0) {
subItem.fgList.push(result)
calcFgQty(detailSource.value)
} else {
const itemIndex = subItem.fgList.findIndex((r) => r.itemCode == result.itemCode && r.productDate == result.productDate && r.order == result.order)
if (itemIndex == -1) {
subItem.fgList.push(result)
calcFgQty(detailSource.value)
} else {
showQuestionMessage(`标签【${result.content}】已经扫描,是否移除`, (confirm) => {
subItem.fgList.splice(itemIndex, 1)
calcFgQty(detailSource.value)
})
if (subItem.fgList.length == 0) {
subItem.fgList.push(result)
calcFgQty(detailSource.value)
} else {
const itemIndex = subItem.fgList.findIndex((r) => r.itemCode == result.itemCode && r.order == result.order)
if (itemIndex == -1) {
subItem.fgList.push(result)
calcFgQty(detailSource.value)
} else {
showQuestionMessage(`标签【${result.content}】已经扫描,是否移除`, (confirm) => {
subItem.fgList.splice(itemIndex, 1)
calcFgQty(detailSource.value)
})
}
}
setTimeout((r) => {
scanPopupGetFocus()
}, 500)
}
}
}
setTimeout((r) => {
scanPopupGetFocus()
}, 500)
}
}
})
.catch((error) => {
showErrorMessage(error)
})
}
const calcFgQty = () => {
@ -391,7 +400,9 @@ const commit = () => {
submitJob()
}
} else {
subitem.handleQty = subitem.qty
if (!subitem.handleQty) {
subitem.handleQty = subitem.qty
}
subitem.scaned = true
submitJob()
}
@ -445,9 +456,9 @@ const setParams = () => {
if (detail.fgList) {
detail.fgList.forEach((res) => {
res.outsideItemCode = res.itemCode
res.outsideProduceDate = res.productDate
// res.outsideProduceDate = res.productDate
res.outsideProduceDate = null
res.outsideSerialNumber = res.order
res.lowerLim = res.content
})
}
subList.push(detail)

Loading…
Cancel
Save