Browse Source

fix: detail文件

master
张立 2 months ago
parent
commit
c7adcfc5e1
  1. 35
      src/common/record.js
  2. 16
      src/mycomponents/balance/pack.vue
  3. 119
      src/mycomponents/detail/comRecommendDetailCard.vue

35
src/common/record.js

@ -26,6 +26,22 @@ export function createItemInfo(balance, pack) {
return item;
}
export function createItemInfoForLabel(balance, label) {
let item = {
itemCode: label.itemCode,
itemName: label.itemName,
packQty: '',
packUnit: '',
qty: new Decimal(balance.qty).toNumber(),
handleQty: new Decimal(0).toNumber(),
uom: balance.uom,
subList: [],
// packingNumber: pack.number,
// parentPackingNumber: pack.parentNumber,
}
item.containerNumber = balance.parentNumber ? balance.parentNumber : balance.number;
return item;
}
export function createDetailInfo(balance, pack) {
balance.scaned = true;
// data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus;
@ -59,6 +75,25 @@ export function createDetailInfoForLabel(balance, pack,label) {
return detail;
}
export function createDetailInfoForLabel(balance, pack,label) {
balance.scaned = true;
// data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus;
// data.inventoryStatus = data.inventoryStatus;
let detail = deepCopyData(balance);
detail.balanceQty = new Decimal(detail.qty).toNumber()
detail.qty = new Decimal(balance.qty).toNumber();
detail.packQty =''
detail.packUnit =''
console.log(988,label.qty)
detail.handleQty = new Decimal(label.qty).toNumber();
// detail.package = pack;
// detail.productionlineCode = pack.productionLineCode; // 制品回收记录需要加的
// detail.toInventoryStatus = balance.inventoryStatus; // 制品回收记录需要加的
return detail;
}
export function createDetailByPackInfo(pack) {
// data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus;

16
src/mycomponents/balance/pack.vue

@ -1,14 +1,14 @@
<template>
<view class="card_view" v-if="ShowPackingNumber">
<view class="card_view" v-if="ShowPackingNumber || isShowPackingNumberProp">
<text class="card_packing_code">{{ title }}</text>
<text class="card_content">{{ packingCode }}</text>
</view>
</template>
<script setup lang="ts">
import {getSwitchInfoByCode} from '@/common/basic.js';
import {onMounted} from "vue";
import {ref} from "vue";
import { onMounted, ref } from 'vue'
import { getSwitchInfoByCode } from '@/common/basic.js'
const props = defineProps({
packingCode: {
type: String,
@ -17,17 +17,21 @@ const props = defineProps({
title: {
type: String,
default: '包装'
},
//
isShowPackingNumberProps: {
type: Boolean,
default: false
}
})
const ShowPackingNumber = ref(true)
onMounted(()=>{
onMounted(() => {
ShowPackingNumber.value = getSwitchInfoByCode('ShowPackingNumber')
})
</script>
<style lang="scss" scoped>
.card_packing_code {
padding: 0;
}
</style>

119
src/mycomponents/detail/comRecommendDetailCard.vue

@ -1,53 +1,44 @@
<template>
<view class="" style="background-color: #fff;">
<u-collapse ref="collapse1" >
<u-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">
<u-swipe-action ref="swipeAction"
:options="item.scaned?scanOptions:detailOptions"
style='padding:0px 0px 5px 0px;align-items: center;'
@click="(...event)=>swipeClick(event,item)">
<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 class="" style="background-color: #fff">
<u-collapse ref="collapse1">
<u-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">
<u-swipe-action ref="swipeAction" :options="item.scaned ? scanOptions : detailOptions" style="padding: 0px 0px 5px 0px; align-items: center" @click="(...event) => swipeClick(event, item)">
<view v-if="item.isRecommend" class="uni-flex" style="flex-direction: row; align-items: center">
<view class="" style="font-size: 32rpx; color: #3c9cff; font-weight: bold; text-align: center; padding: 10px">
<br />
</view>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowFromLocation="isShowFromLocation" :isShowToLocation="isShowToLocation" style="flex:1" :isShowBatch='item.batch ? true:false' :isShowPack='isShowPack'>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowFromLocation="isShowFromLocation" :isShowToLocation="isShowToLocation" style="flex: 1" :isShowBatch="item.batch ? true : false" :isShowPack="isShowPack"> </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 v-else class="uni-flex" style="flex-direction: row; align-items: center; margin-top: 5rpx" :class="item.scaned ? 'scan_view' : ''">
<view class="" style="font-size: 32rpx; color: rgb(107, 196, 78); font-weight: bold; text-align: center; padding: 10px">
<br />
</view>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowFromLocation="isShowFromLocation" :isShowToLocation="isShowToLocation" style="flex:1" :isShowBatch='item.batch? true:false' :isShowPack='isShowPack'></recommend>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowFromLocation="isShowFromLocation" :isShowToLocation="isShowToLocation" style="flex: 1" :isShowBatch="item.batch ? true : false" :isShowPack="isShowPack"> </recommend>
</view>
</u-swipe-action>
</view>
</u-collapse-item>
</u-collapse>
<<recommend-qty-edit ref="recommendQtyEditRef" :dataContent="editItem" :handleQty="editItem.qty" @confirm="confirm" :settingParam='settingParam'
:isShowStatus="isShowStatus"></recommend-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
:locationAreaTypeList="locationAreaTypeList"></win-scan-location>
<comMessage ref="message"></comMessage>
</view>
</u-swipe-action>
</view>
</u-collapse-item>
</u-collapse>
<recommend-qty-edit ref="recommendQtyEditRef" :dataContent="editItem" :handleQty="editItem.qty" @confirm="confirm" :settingParam="settingParam" :isShowStatus="isShowStatus"></recommend-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation="getLocation" :locationAreaTypeList="locationAreaTypeList"></win-scan-location>
<comMessage ref="message"></comMessage>
</view>
</template>
<script setup>
import {ref, watch, onMounted, nextTick} from 'vue'
import { ref, watch, onMounted, nextTick } from 'vue'
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
import winScanLocation from '@/mycomponents/scan/winScanLocation.vue'
import {
getDetailOption,
getPurchaseReceiptOption
} from '@/common/array.js'
import { getDetailOption, getPurchaseReceiptOption } from '@/common/array.js'
const props = defineProps({
dataContent: {
@ -81,6 +72,14 @@ const props = defineProps({
isShowStatus: {
type: Boolean,
default: true
},
isShowFromLocation: {
type: Boolean,
default: true
},
isShowToLocation: {
type: Boolean,
default: true
}
})
const emit = defineEmits(['openDetail', 'remove', 'updateData'])
@ -99,30 +98,34 @@ const scanOptions = ref([])
const recommendQtyEditRef = ref()
watch(() => props.dataContent, (newDataContent, oldDataContent) => {
if (newDataContent?.subList.length > 0) {
nextTick(() => {
setTimeout(() => {
if (collapse1.value) {
collapse1.value.init()
}
}, 500)
})
}
}, { immediate: true, deep: true })
watch(
() => props.dataContent,
(newDataContent, oldDataContent) => {
if (newDataContent?.subList.length > 0) {
nextTick(() => {
setTimeout(() => {
if (collapse1.value) {
collapse1.value.init()
}
}, 500)
})
}
},
{ immediate: true, deep: true }
)
onMounted(() => {
if (scanOptions.value.length === 0) {
scanOptions.value = getPurchaseReceiptOption(props.settingParam.allowModifyQty, false)
}
// showLocation();
if(import.meta.env.VITE_MANAGE_MODEL=='BY_PACKAGING'){
if (detailOptions.value.length == 0) {
detailOptions.value = getDetailOption()
}
}else {
scanOptions.value.splice(0,1)
}
if (import.meta.env.VITE_MANAGE_MODEL == 'BY_PACKAGING') {
if (detailOptions.value.length == 0) {
detailOptions.value = getDetailOption()
}
} else {
scanOptions.value.splice(0, 1)
}
})
const swipeClick = (e, item) => {
@ -144,7 +147,7 @@ const swipeClick = (e, item) => {
const edit = (item) => {
editItem.value = item
qtyEdit.value.openEditPopup(item.balance, item.handleQty)
recommendQtyEditRef.value.openTaskEditPopup(item.qty,item.handleQty,item.labelQty)
recommendQtyEditRef.value.openTaskEditPopup(item.qty, item.handleQty, item.labelQty)
}
const detail = (item) => {
@ -178,8 +181,6 @@ const getLocation = (location, code) => {
locatonItem.value.toLocationCode = code
emit('updateData')
}
</script>
<style>
</style>
<style></style>

Loading…
Cancel
Save