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> <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 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)">
<view style="flex: 1"> <item :dataContent="dataContent"></item>
<item :dataContent="dataContent"></item>
</view>
<view> <view>
<balance-qty v-if="isShowBalanceQty" :dataContent="dataContent"></balance-qty> <balance-qty v-if="isShowBalanceQty" :dataContent="dataContent"></balance-qty>
<compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.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) { if (checkedToday.value) {
filters.push({ filters.push({
column: 'create_time', column: 'create_time',
action: 'betweeen', action: 'between',
value: todayTime.value value: todayTime.value
}) })
} }

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

@ -8,7 +8,11 @@
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <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>
<view class="split_line"></view> <view class="split_line"></view>
</view> </view>
@ -54,7 +58,9 @@ import { goHome, getPackingNumberAndBatchByList, deepCopyData } from '@/common/b
import { getInventoryStatusDesc, getDirectoryItemArray } from '@/common/directory.js' import { getInventoryStatusDesc, getDirectoryItemArray } from '@/common/directory.js'
import { getPrecisionStrategyList } from '@/common/balance.js' import { getPrecisionStrategyList } from '@/common/balance.js'
import {
calc
} from '@/common/calc.js';
import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty } from '@/common/record.js' import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty } from '@/common/record.js'
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
@ -87,6 +93,7 @@ const scanLocationCodeRef = ref()
const comMessageRef = ref() const comMessageRef = ref()
const showCustomer = ref(false) const showCustomer = ref(false)
const toWarehouseCode = ref('') const toWarehouseCode = ref('')
const managementType = ref('')
onLoad((option) => { onLoad((option) => {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: option.title title: option.title
@ -123,7 +130,15 @@ onNavigationBarButtonTap((e) => {
goHome() 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 { balance } = result
const { label } = result const { label } = result
const pack = result.package const pack = result.package
@ -154,6 +169,39 @@ const getScanResult = (result) => {
} }
handleCalcHandleQty() 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 = () => { const handleCalcHandleQty = () => {
calcHandleQty(detailSource.value) calcHandleQty(detailSource.value)
@ -173,11 +221,15 @@ const removePack = () => {
} }
const openScanPopup = () => { const openScanPopup = () => {
if (fromLocationCode.value == '') { if (businessType.value) {
showFromLocationPopup() if (fromLocationCode.value == "") {
return showFromLocationPopup();
return
}
scanPopup.value.openScanPopupForType(fromLocationCode.value, businessType.value)
} else {
getBusinessType()
} }
scanPopup.value.openScanPopupForType(fromLocationCode.value, businessType.value)
} }
const showFromLocationPopup = () => { const showFromLocationPopup = () => {
@ -228,8 +280,13 @@ const commit = () => {
if (res.success) { if (res.success) {
console.log(5555) console.log(5555)
managementList.value = res.list managementList.value = res.list
const params = setParams() 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) deliverRecordSubmit(params)
.then((res) => { .then((res) => {
uni.hideLoading() uni.hideLoading()

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

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

Loading…
Cancel
Save