Browse Source

新文件修改 文件迁移Vue2升级Vue3 10/25-11/8

hella_vue3
王志国 2 weeks ago
parent
commit
d072b12309
  1. 6
      src/mycomponents/item/itemQty.vue
  2. 2
      src/pages/deliver/job/deliverJob.vue
  3. 73
      src/pages/deliver/record/deliverRecord.vue
  4. 2
      src/pages/purchaseReceipt/job/receiptJob.vue

6
src/mycomponents/item/itemQty.vue

@ -1,8 +1,6 @@
<template>
<view class="uni-flex uni-row space-between center u-p-t-20 u-p-b-20" style="padding-left:10px;: 100%; border-bottom: 1px solid rgba(230, 230, 2300.5)">
<view style="flex: 1">
<item :dataContent="dataContent"></item>
</view>
<view class="uni-flex uni-row space-between center u-p-t-20 u-p-b-20" style="flex: 1;padding-left:10px;: 100%; border-bottom: 1px solid rgba(230, 230, 2300.5)">
<item :dataContent="dataContent"></item>
<view>
<balance-qty v-if="isShowBalanceQty" :dataContent="dataContent"></balance-qty>
<compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)"

2
src/pages/deliver/job/deliverJob.vue

@ -103,7 +103,7 @@ const getList = (type) => {
if (checkedToday.value) {
filters.push({
column: 'create_time',
action: 'betweeen',
action: 'between',
value: todayTime.value
})
}

73
src/pages/deliver/record/deliverRecord.vue

@ -8,7 +8,11 @@
<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" :isShowLocation="true" @removeItem="removeItem(index, item)" @updateData="updateData" @removePack="removePack"> </record-com-detail-card>
<record-com-detail-card :dataContent="item" :index="index"
:settingParam="dataContent" :isShowLocation="true"
@removeItem="removeItem(index, item)" :isShowParentToLocation="false"
@updateData="updateData" @removePack="removePack">
</record-com-detail-card>
</view>
<view class="split_line"></view>
</view>
@ -54,7 +58,9 @@ import { goHome, getPackingNumberAndBatchByList, deepCopyData } from '@/common/b
import { getInventoryStatusDesc, getDirectoryItemArray } from '@/common/directory.js'
import { getPrecisionStrategyList } from '@/common/balance.js'
import {
calc
} from '@/common/calc.js';
import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty } from '@/common/record.js'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
@ -87,6 +93,7 @@ const scanLocationCodeRef = ref()
const comMessageRef = ref()
const showCustomer = ref(false)
const toWarehouseCode = ref('')
const managementType = ref('')
onLoad((option) => {
uni.setNavigationBarTitle({
title: option.title
@ -123,7 +130,15 @@ onNavigationBarButtonTap((e) => {
goHome()
}
})
const getScanResult = (result) => {
const getScanResult = (result,managementTypeParams)=> {
managementType.value = managementTypeParams
if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") {
setDataBatch(result)
} else {
setData(result)
}
}
const setData = (result) => {
const { balance } = result
const { label } = result
const pack = result.package
@ -154,6 +169,39 @@ const getScanResult = (result) => {
}
handleCalcHandleQty()
}
const setDataBatch = (result)=>{
let balance = result.balance;
let label = result.label;
let pack = result.package;
let labelQty =result.label.qty;
let balanceQty =result.balance.qty;
let item = detailSource.value.find(res => {
if (res.itemCode == balance.itemCode) {
return res
}
})
if (item == undefined) {
let itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
itemp.subList.push(newDetail);
detailSource.value.push(itemp)
} else {
let detail = item.subList.find(r => {
if (r.batch == balance.batch &&
r.locationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) {
return r;
}
})
if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack);
item.subList.push(newDetail);
} else {
detail.handleQty = calc.add(detail.handleQty, result.label.qty)
}
}
handleCalcHandleQty();
}
const handleCalcHandleQty = () => {
calcHandleQty(detailSource.value)
@ -173,11 +221,15 @@ const removePack = () => {
}
const openScanPopup = () => {
if (fromLocationCode.value == '') {
showFromLocationPopup()
return
if (businessType.value) {
if (fromLocationCode.value == "") {
showFromLocationPopup();
return
}
scanPopup.value.openScanPopupForType(fromLocationCode.value, businessType.value)
} else {
getBusinessType()
}
scanPopup.value.openScanPopupForType(fromLocationCode.value, businessType.value)
}
const showFromLocationPopup = () => {
@ -228,8 +280,13 @@ const commit = () => {
if (res.success) {
console.log(5555)
managementList.value = res.list
const params = setParams()
let obj = params.subList.find(item=>item.balanceQty < item.handleQty)
if(obj){
comMessageRef.value.showConfirmWarningModal('批次[' +obj.batch + ']数量[' + obj.handleQty + ']不允许大于库存数量[' +obj.balanceQty + ']')
uni.hideLoading()
return
}
deliverRecordSubmit(params)
.then((res) => {
uni.hideLoading()

2
src/pages/purchaseReceipt/job/receiptJob.vue

@ -397,7 +397,7 @@ const getScanResult = (result) => {
showMessage(error)
})
} catch (e) {
showMessage(`${error}\n扫描[${result.scanMessage}]`)
showMessage(`${e}\n扫描[${result.scanMessage}]`)
}
}
defineExpose({

Loading…
Cancel
Save