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; 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) { export function createDetailInfo(balance, pack) {
balance.scaned = true; balance.scaned = true;
// data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus; // data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus;
@ -59,6 +75,25 @@ export function createDetailInfoForLabel(balance, pack,label) {
return detail; 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) { export function createDetailByPackInfo(pack) {
// data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus; // data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus;

16
src/mycomponents/balance/pack.vue

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

119
src/mycomponents/detail/comRecommendDetailCard.vue

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

Loading…
Cancel
Save