Browse Source

fix: purchaseReceipt\coms transfer\record unPlanned 文件修改 Vue2升级Vue3 10/25-11-11

syhx_app_vue3
王志国 1 week ago
parent
commit
2b6131e8e8
  1. 5
      .env.production
  2. 10
      src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue
  3. 2
      src/pages/transfer/record/deliverRecord.vue
  4. 88
      src/pages/unPlanned/job/issueJobDetail.vue
  5. 53
      src/pages/unPlanned/job/receiptJobDetail.vue
  6. 78
      src/pages/unPlanned/record/issueRecord.vue
  7. 12
      src/pages/unPlanned/record/receiptRecord.vue
  8. 44
      src/pages/unPlanned/record/receiptRecordByBatch.vue

5
.env.production

@ -5,7 +5,10 @@ VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:26800/admin-api
VITE_TENANT='[{"text":"长春1379","value":1}]'
# 是否是测试环境
VITE_isDevelopment=false
VITE_isDevelopment = false
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://dev.ccwin-in.com:26800'
# 项目管理模式 批次货/包装
VITE_MANAGE_MODEL="BY_BATCH"

10
src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue

@ -24,15 +24,15 @@
<script setup lang="ts">
import { ref, getCurrentInstance, onMounted, nextTick } from 'vue'
import { onLoad, onNavigationBarButtonTap, onPullDownRefresh } from '@dcloudio/uni-app'
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import ItemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
import jobDetailPopup from '@/mycomponents/detail/jobDetailPopup.vue'
import receiptDetailInfoPopup from '@/pages/purchaseReceipt/coms/receiptDetailInfoPopup.vue'
import RecommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
import JobDetailPopup from '@/mycomponents/detail/jobDetailPopup.vue'
import ReceiptDetailInfoPopup from '@/pages/purchaseReceipt/coms/receiptDetailInfoPopup.vue'
import winScanLocation from '@/mycomponents/scan/winScanLocation.vue'
import pack from '@/mycomponents/balance/pack.vue'
import detailList from '@/mycomponents/detail/detailList.vue'
import packageList from '@/mycomponents/package/packageList.vue'
import PackageList from '@/mycomponents/package/packageList.vue'
import { getDetailOption, getPurchaseReceiptOption, getRemoveOption } from '@/common/array.js'
const props = defineProps({

2
src/pages/transfer/record/deliverRecord.vue

@ -206,7 +206,7 @@ const removePack = () => {
}
const openScanPopup = () => {
if (this.businessType) {
if (businessType.value) {
if (fromLocationCode.value == '') {
showFromLocationPopup()
return

88
src/pages/unPlanned/job/issueJobDetail.vue

@ -20,11 +20,10 @@
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<comRecommendDetailCardBatch :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" @openDetail="openDetail" v-if="managementType=='BY_BATCH'">
</comRecommendDetailCardBatch>
<comRecommendDetailCard :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" @openDetail="openDetail" v-else>
<comRecommendDetailCard :dataContent="item" :index="index"
:settingParam="jobContent" @remove="updateData"
@updateData="updateData" @openDetail="openDetail">
</comRecommendDetailCard>
</view>
</view>
@ -64,10 +63,9 @@ import {
} from 'decimal.js'; //
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.vue'
import comRecommendDetailCard from "@/mycomponents/detail/comRecommendDetailCard.vue"
import comRecommendDetailCardBatch from "@/mycomponents/detail/comRecommendDetailCardBatch.vue"
import detailInfoPopup from '@/pages/unPlanned/coms/detailInfoPopup.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
import ComRecommendDetailCard from "@/mycomponents/detail/comRecommendDetailCard.vue"
import DetailInfoPopup from '@/pages/unPlanned/coms/detailInfoPopup.vue'
import JobTop from '@/mycomponents/job/jobTop.vue'
import { useCountStore } from '@/store'
// store
const store = useCountStore()
@ -171,8 +169,9 @@ const getDetail = () => {
await getManagementPrecisions(itemCodes, fromLocationCode.value, res => {
if (res.success) {
managementList.value = res.list;
managementType.value = managementList.value.some(item => item.ManagementPrecision ==
'BY_BATCH') ? 'BY_BATCH' : ''
managementType.value = managementList.value &&
managementList.value[0] &&
managementList.value[0].ManagementPrecision ? managementList.value[0].ManagementPrecision : 'BY_PACKAGING'
}
})
} else {
@ -213,22 +212,73 @@ const updateData = () => {
const openDetail = (item) => {
detailInfoPopupRef.value.openPopup(item)
}
const getScanResult = (result)=> {
if(import.meta.env.VITE_MANAGE_MODEL == 'BY_BATCH'){
setDataBatch(result)
}else{
setData(result)
}
}
const setDataBatch = (result) => {
try {
const { packingNumber,batch,
qty,itemCode,
locationCode,inventoryStatus} = result.balance
const detail = detailSource.value.find((r) => r.itemCode == itemCode)
const getScanResult = (result) => {
if (detail == undefined) {
showErrorMessage(`物料号【${itemCode}】不在列表中`)
} else {
const itemDetail = detail.subList.find((r) => {
return r.batch == batch &&
r.fromLocationCode == result.fromLocationCode &&
r.isRecommend==false
})
if (itemDetail == undefined) {
let newAdd = {
itemCode:itemCode,
packingNumber:packingNumber,
batch:batch,
handleQty:Number(result.label.qty),
qty:detail.qty,
fromLocationCode:locationCode,
inventoryStatus:inventoryStatus,
toInventoryStatus:inventoryStatus,
balance:result.balance,
isRecommend:false,
isNewAdd:"newAdd"
}
newAdd.balance.balanceQty = Number(result.balance.qty);
newAdd.balance.packQty = Number(result.package.packQty)
newAdd.balance.packUnit = result.package.packUnit
newAdd.scaned = true;
detail.subList.push(newAdd)
} else {
if (itemDetail.scaned) {
itemDetail.handleQty = calc.add(itemDetail.handleQty ,Number(result.label.qty));
}
}
calcHandleQty();
}
} catch (e) {
showMessage(e.message)
}
}
const setData = (result) => {
try {
const { packingNumber } = result.balance
const { batch } = result.balance
const { qty } = result.balance
const { itemCode } = result.balance
const { locationCode } = result.balance
const { inventoryStatus } = result.balance
const { packingNumber,batch,
qty,itemCode,locationCode,
inventoryStatus } = result.balance
const detail = detailSource.value.find((r) => r.itemCode == itemCode)
if (detail == undefined) {
showErrorMessage(`物料号【${itemCode}】不在列表中`)
} else {
const itemDetail = detail.subList.find((r) => {
return r.packingNumber == packingNumber && r.batch == batch && r.fromLocationCode == result.fromLocationCode && r.isRecommend==false
return r.packingNumber == packingNumber &&
r.batch == batch &&
r.fromLocationCode == result.fromLocationCode &&
r.isRecommend==false
})
if (itemDetail == undefined) {
let newAdd = {

53
src/pages/unPlanned/job/receiptJobDetail.vue

@ -13,13 +13,10 @@
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<comReceiptDetailCardBatch :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData"
:locationAreaTypeList='toLocationAreaTypeList' v-if="managementType=='BY_BATCH'">
</comReceiptDetailCardBatch>
<com-receipt-detail-card :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData"
:locationAreaTypeList='toLocationAreaTypeList' v-else>
:locationAreaTypeList='toLocationAreaTypeList'>
</com-receipt-detail-card>
</view>
<view class="split_line"></view>
@ -51,7 +48,7 @@ import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReach
import { getManagementPrecisions } from '@/common/balance.js'
import { getUnPlannedReceiptJobDetail, cancleTakeUnPlannedReceiptJob, takeUnPlannedReceiptJob, unPlannedReceiptJobSubmit } from '@/api/request2.js'
import { goHome, navigateBack, getPackingNumberAndBatch, getDirectoryItemArray } from '@/common/basic.js'
import { calc } from '@/common/calc.js';
import { getDataSource, createRecordInfo, calcHandleQty, getScanCount } from '@/common/detail.js'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
@ -59,7 +56,6 @@ import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import locationCompare from '@/mycomponents/location/locationCompare.vue'
import comReceiptDetailCard from '@/pages/unPlanned/coms/comReceiptDetailCard.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
import comReceiptDetailCardBatch from '@/pages/unPlanned/coms/comReceiptDetailCardBatch.vue'
import { useCountStore } from '@/store'
// store
const store = useCountStore()
@ -200,8 +196,49 @@ const continueScan = () => {
const updateData = () => {
calcHandleQty(detailSource.value)
}
const getScanResult = (result)=> {
if(import.meta.env.VITE_MANAGE_MODEL == 'BY_BATCH'){
setDataBatch(result)
}else{
setData(result)
}
}
const setDataBatch = (result)=>{
try {
const packingNumber = result.label.packingNumber;
const batch = result.label.batch;
const qty = result.label.qty;
const itemCode = result.label.itemCode;
const detail = detailSource.value.find(r => r.itemCode == itemCode);
if (detail == undefined) {
showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else {
const getScanResult = (result) => {
var itemDetail = detail.subList.find(r => r.batch == batch);
if (itemDetail == undefined) {
showErrorMessage("批次【" + batch + "】" + "不在列表中")
} else {
if (itemDetail.scaned) {
// this.showErrorMessage("" + packingNumber + "," + batch + "" + "")
itemDetail.handleQty = calc.add(itemDetail.handleQty ,Number(result.label.qty));
} else {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.label.qty);
itemDetail.toLocationCode = toLocationCode.value ? toLocationCode.value : itemDetail
.toLocationCode;
itemDetail.packQty = result.package.packQty
itemDetail.labelQty = Number(result.label.qty);
continueScan()
}
}
calcHandleQty(detailSource.value);
}
} catch (e) {
showErrorMessage(e.message)
}
}
const setData = (result) => {
try {
const { packingNumber } = result.label
const { batch } = result.label

78
src/pages/unPlanned/record/issueRecord.vue

@ -15,7 +15,19 @@
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<record-com-detail-card :dataContent="item" :index="index" @removeItem="removeItem(index, item)" @updateData="updateData" :isShowLocation="true" @removePack="removePack" :isShowToLocation="false"> </record-com-detail-card>
<record-com-detail-card-batch :dataContent="item" :index="index" :isShowFromLocation="false"
:isShowParentToLocation="false"
@removeItem="removeItem(index,item)" :isShowToLocation="false" @updateData="updateData"
@removePack="removePack"
:allowModifyQty="true"
v-if="managementType == 'BY_BATCH'||managementType =='BY_QUANTITY' ">
</record-com-detail-card-batch>
<record-com-detail-card :dataContent="item" :index="index" v-else
@removeItem="removeItem(index, item)"
@updateData="updateData" :isShowLocation="true"
@removePack="removePack"
:isShowToLocation="false">
</record-com-detail-card>
</view>
<view class="split_line"></view>
</view>
@ -37,16 +49,18 @@
<script setup lang="ts">
import { ref, getCurrentInstance, nextTick, onMounted } from 'vue'
import { onLoad, onNavigationBarButtonTap, onReady, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from '@/mycomponents/scan/winScanLocation.vue'
import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.vue'
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import RecordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import RecordComDetailCardBatch from '@/mycomponents/record/recordComDetailCardBatch.vue'
import { unPlannedIssueRecordSubmit } from '@/api/request2.js'
import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty } from '@/common/record.js'
import {
calc
} from '@/common/calc.js';
import { getDirectoryItemArray, getUnPlannedIssuseReasonList } from '@/common/directory.js'
@ -70,6 +84,8 @@ const show = ref(false)
const scanFromLocationCode = ref()
const scanPopup = ref()
const comMessageRef = ref()
const managementType = ref('')
onMounted(() => {
reasonList.value = getUnPlannedIssuseReasonList()
const typeCode = 'UnplannedDeliver'
@ -85,11 +101,15 @@ onMounted(() => {
})
const openScanPopup = () => {
if (businessType.value) {
if (fromLocationCode.value == '') {
showFromLocationPopup()
return
}
scanPopup.value.openScanPopupForType(fromLocationCode.value, businessType.value)
} else {
getBusinessType()
}
}
const showFromLocationPopup = () => {
nextTick(() => {
@ -103,10 +123,52 @@ const getfromLocationCode = (location) => {
fromLocationCode.value = location.code
openScanPopup()
}
const getScanResult = (result) => {
getDataSource(result)
const getScanResult = (result,managementTypeParams) => {
this.managementType = managementTypeParams
console.log(managementTypeParams)
if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") {
setDataBatch(result)
} else {
setData(result)
}
}
const setDataBatch = (result)=> {
let balance = result.balance;
let label = result.label;
let pack = result.package;
let item = detailSource.value.find(res => {
if (res.itemCode == label.itemCode) {
return res
}
})
if (item == undefined) {
let itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
// newDetail.inventoryStatus ="OK";
itemp.subList.push(newDetail);
detailSource.value.push(itemp)
packGetFocus()
} else {
let detail = item.subList.find(r => {
if (r.batch == balance.batch &&
r.locationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus &&
r.scaned == true) {
return r;
}
})
if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack);
item.subList.push(newDetail);
packGetFocus()
}else {
detail.handleQty = calc.add(detail.handleQty, result.label.qty)
}
}
handleCalcHandleQty()
}
const getDataSource = (result) => {
const setData = (result) => {
const { balance } = result
const { label } = result
const pack = result.package
@ -176,7 +238,7 @@ const commit = () => {
.then((res) => {
uni.hideLoading()
if (res.data) {
showCommitSuccessMessage(`提交成功<br>生成采购收货记录<br>${res.data}`)
showCommitSuccessMessage(`提交成功\n生成计划外出库记录\n${res.data}`)
} else {
showErrorMessage(`提交失败[${res.msg}]`)
}

12
src/pages/unPlanned/record/receiptRecord.vue

@ -16,7 +16,12 @@
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<com-receipt-record :dataContent="item" @removeItem="removeItem(index, item)" @updateData="updateData" :isShowLocation="false" @removePack="removePack"> </com-receipt-record>
<com-receipt-record
:dataContent="item" @removeItem="removeItem(index,item)"
:queryBalance="false" :allowModifyQty="true"
:isShowLocation="false"
@updateData="updateData" @removePack="removePack">
</com-receipt-record>
</view>
<view class="split_line"></view>
</view>
@ -98,7 +103,10 @@ const openScanPopup = () => {
const getToLocationCode = (location, code) => {
toLocationCode.value = code
}
const getScanResult = (result) => {
const getScanResult = (result)=> {
setData(result)
}
const setData = (result) => {
const { label } = result
const pack = result.package
const item = detailSource.value.find((res) => {

44
src/pages/unPlanned/record/receiptRecordByBatch.vue

@ -47,44 +47,44 @@
</template>
<script setup>
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comReceiptRecord from '@/pages/unPlanned/coms/comReceiptRecord.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanPack from "@/mycomponents/scan/winScanPack.vue"
import {
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comReceiptRecord from '@/pages/unPlanned/coms/comReceiptRecord.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanPack from "@/mycomponents/scan/winScanPack.vue"
import {
unPlannedReceiptRecordbSubmit
} from '@/api/request2.js';
} from '@/api/request2.js';
import {
import {
getDirectoryItemArray,
getUnPlannedReceiptReasonList
} from '@/common/directory.js';
} from '@/common/directory.js';
import {
import {
getBusinessType,
} from '@/common/record.js';
} from '@/common/record.js';
import {
import {
calc
} from '@/common/calc.js';
} from '@/common/calc.js';
import {
import {
Decimal
} from 'decimal.js'; //
import {
} from 'decimal.js'; //
import {
goHome,
deepCopyData,
getPackingNumberAndBatchByList
} from '@/common/basic.js';
} from '@/common/basic.js';
import {
import {
getPrecisionStrategyList
} from '@/common/balance.js';
} from '@/common/balance.js';
import { ref, onMounted } from 'vue';
import {ref, onMounted} from 'vue';
const toLocationCode = ref("");
const toInventoryStatus = ref([]);

Loading…
Cancel
Save