Browse Source

page/inventoryMove/coms 文件迁移 8/8-10/25

pull/1/head
test 3 months ago
parent
commit
0589b23409
  1. 28
      src/pages/inventoryMove/coms/comInventoryDetailCard.vue
  2. 186
      src/pages/inventoryMove/coms/comInventoryDetailCardBatch.vue
  3. 4
      src/pages/inventoryMove/coms/comMove.vue
  4. 46
      src/pages/inventoryMove/coms/comMoveJob.vue
  5. 59
      src/pages/inventoryMove/coms/comMoveRecord.vue
  6. 8
      src/pages/inventoryMove/coms/comMoveRecordCard.vue

28
src/pages/inventoryMove/coms/comInventoryDetailCard.vue

@ -11,8 +11,8 @@
</u-swipe-action>
</u-collapse-item>
</u-collapse>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" @confirm="confirm" :allowEditStatus="true"></balance-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation="getLocation"></win-scan-location>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" @confirm="confirm" :allowEditQty="allowEditQty" :allowEditStatus="true"></balance-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" :locationAreaTypeList="locationAreaTypeList" @getLocation="getLocation"></win-scan-location>
<detail-info-popup ref="detailInfoPopupRef"></detail-info-popup>
<com-message ref="comMessageRef" />
</view>
@ -36,7 +36,29 @@ const props = defineProps({
settingParam: {
type: Object,
default: {}
},
allowEditQty: {
type: Boolean,
default: false
},
locationAreaTypeList: {
type: Array,
default: []
}
})
watch(()=> props.dataContent, (newName, oldName)=>{
if (dataContent.value.subList.length > 0) {
nextTick(res => {
setTimeout(() => {
if (collapse1.value) {
collapse1.value.init();
}
}, 200)
})
}
},{
immediate: true,
deep: true
})
const option = ref([])
const title = ref('推荐详情')
@ -53,7 +75,7 @@ const scanLocationCode = ref('')
const winHint = ref()
const dataContent = ref(props.dataContent)
const collapse1 = ref()
const locatonItem = ref({})
onMounted(() => {
if (detailOptions.value.length == 0) {
detailOptions.value = getDetailOption()

186
src/pages/inventoryMove/coms/comInventoryDetailCardBatch.vue

@ -0,0 +1,186 @@
<template>
<view class="" style="background-color: #fff;">
<!-- <item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"></item-qty> -->
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowStdPack="false">
</item-compare-qty>
<view class='split_line'></view>
<view class="" v-for="(item,index) in dataContent.subList">
<u-swipe-action ref="swipeAction" v-if="index ==0" :class="item.scaned?'scan_view':''">
<u-swipe-action-item
:right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options"
@click="swipeClick($event,item)">
<div style="display: flex;">
<div style="flex: 1;">
<batch v-if="item.batch" :batch="item.batch"></batch>
<location v-if="item.fromLocationCode" title="来源库位" :locationCode="item.fromLocationCode">
</location>
<to-location v-if="item.toLocationCode" title="目标库位" :locationCode="item.toLocationCode">
</to-location>
</div>
<text style="font-size: 30rpx;color: #2979ff; " @click="copy(item)" v-if="isDevlement()">复制</text>
</div>
</u-swipe-action-item>
</u-swipe-action>
</view>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" @confirm="confirm"
:allowEditStatus="true"></balance-qty-edit>
<win-scan-location ref="scanLocationCode" :locationAreaTypeList="locationAreaTypeList" title="目标库位"
@getLocation='getLocation'></win-scan-location>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<comMessage ref="message"></comMessage>
</view>
</template>
<script setup lang="ts">
import {ref, watch, onMounted, computed} from 'vue';
import itemQty from '@/mycomponents/item/itemQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import detailInfoPopup from '@/pages/inventoryMove/coms/detailInfoPopup.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import location from '@/mycomponents/balance/location.vue'
import toLocation from '@/mycomponents/balance/toLocation.vue'
import batch from '@/mycomponents/balance/batch.vue'
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import config from '@/static/config.js'
import {getRemoveOption, getEditRemoveOption} from '@/common/array.js';
const props = defineProps({
dataContent: {
type: Object,
default: () => ({})
},
settingParam: {
type: Object,
default: () => ({})
},
allowEditQty: {
type: Boolean,
default: false
},
locationAreaTypeList: {
type: Array,
default: () => []
},
isEdit: {
type: Boolean,
default: true
}
});
const emit = defineEmits(['openDetail', 'remove'])
const option = ref([]);
const title = ref("推荐详情");
const showItem = ref({});
const editItem = ref({});
const detailOptions = ref([]);
const scanOptions = ref([]);
const options = ref([]);
const removeOptions = ref([]);
const editAndRemoveOptions = ref([]);
const collapse1 = ref(null)
const qtyEdit = ref(null)
const winHint = ref(null)
const message = ref(null)
const locatonItem = ref({})
const scanLocationCode = ref(null)
watch(() => props.dataContent, (newName, oldName) => {
if (props.dataContent.subList.length > 0) {
setTimeout(() => {
if (collapse1.value) {
collapse1.value.init();
}
}, 200);
}
}, {immediate: true, deep: true});
onMounted(() => {
removeOptions.value = getRemoveOption();
editAndRemoveOptions.value = getEditRemoveOption();
});
const openDetailCardPopup = () => {
winHint.value.openScanPopup();
};
const swipeClick = (e, item) => {
switch (e.content.text) {
case "详情":
detail(item);
break;
case "编辑":
edit(item);
break;
case "库位":
showLocation(item);
break;
case "移除":
remove(item);
break;
}
};
const edit = (item) => {
editItem.value = item;
qtyEdit.value.openEditPopup(item.balance, item.handleQty);
};
const detail = (item) => {
emit('openDetail', item);
};
const remove = (item) => {
message.value.showQuestionMessage("确定移除扫描信息?", (res) => {
if (res) {
item.scaned = false;
item.balance = {};
item.handleQty = 0;
emit('remove', item);
}
});
};
const confirm = (qty) => {
editItem.value.handleQty = qty;
emit('updateData');
};
const showLocation = (item) => {
locatonItem.value = item;
scanLocationCode.value.openScanPopup();
};
const getLocation = (location, code) => {
locatonItem.value.toLocationCode = code;
emit('updateData');
};
const isDevlement = () => {
return config.isDevelopment;
};
const copy = (detail) => {
const content = `HPQ;V1.0;I${detail.itemCode};P${detail.packingNumber};B${detail.batch};Q${detail.qty}`;
// #ifdef H5
navigator.clipboard.writeText(content).then(() => {
uni.showToast({title: '复制采购标签成功', icon: 'none'});
});
// #endif
// #ifndef H5
uni.setClipboardData({
data: content,
success: () => {
uni.showToast({title: '复制采购标签成功'});
}
});
// #endif
};
</script>
<style>
</style>

4
src/pages/inventoryMove/coms/comMove.vue

@ -228,7 +228,7 @@
newDetail.toInventoryStatus = this.toInventoryStatus
item.subList.push(newDetail);
} else {
this.showErrorMessage(balance.packingNumber + "已经在列表中")
this.showErrorMessage(balance.packingNumber + "重复扫描")
}
}
calcHandleQty(this.detailSource);
@ -307,7 +307,7 @@
inventoryMoveRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成" + this.title + "记录<br>" +
this.showCommitSuccessMessage("提交成功\n生成" + this.title + "记录\n" +
res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")

46
src/pages/inventoryMove/coms/comMoveJob.vue

@ -1,7 +1,11 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length == 0"></com-empty-view>
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday" @switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday" :checkedWaitTask="checkedWaitTask"> </job-filter>
<job-filter ref="filter" otherTitle="ASN" :isShowItemCode="isShowItemCode"
:isShowQurery="isShowQurery" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber"
:checkedToday="checkedToday" :checkedWaitTask="checkedWaitTask"
@onQuery="getListByFilter"></job-filter>
<view v-if="jobList.length > 0" class="u-p-20">
<u-swipe-action :show="item.show" :index="index" v-for="(item, index) in jobList" :key="index" :options="item.status == '2' ? detailGiveupOptions : detailOptions" bg-color="rgba(255,255,255,0)" class="u-m-b-20" @click="swipeClick">
<com-inventory-job-card :dataContent="item" @click="openJobDetail(item)"> </com-inventory-job-card>
@ -41,7 +45,15 @@ const props = defineProps({
title: {
type: String,
default: ''
}
},
isShowItemCode: {
type: Boolean,
default: false
},
isShowQurery: {
type: Boolean,
default: false
},
})
const jobList = ref([])
@ -59,6 +71,7 @@ const filter = ref()
const comMessageRef = ref()
const jobInfoPopupRef = ref()
const jobListPopupRef = ref()
const filterItemCode = ref('')
onMounted(() => {
nextTick(() => {
detailOptions.value = getDetailOption()
@ -121,6 +134,14 @@ const getList = (type) => {
action: 'in',
value: status.value
})
if(filterItemCode.value){
//
filters.push({
column: "itemCode",
action: "like",
value: filterItemCode.value
})
}
filters.push({
column: 'accept_user_id',
action: '==',
@ -147,11 +168,11 @@ const getList = (type) => {
const { list } = res.data
totalCount.value = res.data.total
loadingType.value = 'loadmore'
jobList.value = type === "refresh" ? list : jobList.value.concat(list);
if (list == null || list.length == 0) {
loadingType.value = 'nomore'
return
}
jobList.value = type === 'refresh' ? list : jobList.value.concat(list)
console.log(jobList.value)
pageNo.value++
updateTitle()
@ -217,6 +238,25 @@ const cancleJob = (id) => {
showMessage(error)
})
}
const getListByFilter = (params)=> {
console.log('getListByFilter',params)
if (params.itemCode) {
//
filterItemCode.value = params.itemCode
}else{
filterItemCode.value = ''
}
if (params.status) {
status.value = params.status
}else{
status.value = "1,2"
}
if(params.creationTime == ""){
checkedToday.value = false;
}
todayTime.value = params.creationTime
getList('refresh')
}
const switchChangeToday = (state, creationTime) => {
checkedToday.value = state
todayTime.value = creationTime

59
src/pages/inventoryMove/coms/comMoveRecord.vue

@ -46,7 +46,7 @@ import winScanLocation from '@/mycomponents/scan/winScanLocation.vue'
import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.vue'
import { inventoryMoveRecordSubmit, getBasicLocationByCode } from '@/api/request2.js'
import { getDirectoryItemArray } from '@/common/directory.js'
import { getDirectoryItemArray,getInventoryStatusName } from '@/common/directory.js'
import { getPrecisionStrategyList } from '@/common/balance.js'
@ -222,7 +222,7 @@ const getScanResult = (result) => {
detailSource.value.push(itemp)
} else {
const detail = item.subList.find((r) => {
if (r.packingNumber == balance.packingNumber && r.batch == balance.batch && r.fromLocationCode == balance.locationCode && r.toInventoryStatus == balance.inventoryStatus && r.scaned == true) {
if (r.packingNumber == pack.number && r.batch == pack.batch && r.fromLocationCode == balance.locationCode && r.toInventoryStatus == balance.inventoryStatus && r.scaned == true) {
return r
}
})
@ -235,18 +235,30 @@ const getScanResult = (result) => {
} else {
newDetail.toInventoryStatus = toInventoryStatus.value;
}
if (newDetail.packingNumber == '') {
newDetail.packingNumber = pack.number;
}
newDetail.toLocationCode = toLocationCode.value
newDetail.fromLocationCode = result.fromLocationCode
item.subList.push(newDetail)
} else {
showErrorMessage(`${balance.packingNumber}已经在列表中`)
showErrorMessage("包装[" + detail.packingNumber + "]\n" +
"批次[" + detail.batch + "]\n" + "库位[" + detail.fromLocationCode + "]\n" +
"库存状态[" + getInventoryStatusName(detail.toInventoryStatus) + "]\n" +
"重复扫描")
}
}
calcHandleQty(detailSource.value)
}
const showErrorMessage = (message) => {
if(scanPopup.value){
scanPopup.value.packLoseFocus()
}
comMessageRef.value.showErrorMessage(message, (res) => {
if (res) {
if(scanPopup.value){
scanPopup.value.packGetFocus()
}
}
})
}
@ -307,13 +319,41 @@ const commit = () => {
getPrecisionStrategyList(precisionStrategParams, (res) => {
if (res.success) {
managementList.value = res.list
submit()
} else {
uni.hideLoading()
showErrorMessage(res.message)
}
})
} else {
showErrorMessage('没有要提交的数据,请先扫描')
}
}
const submit = ()=>{
const params = setParams()
let hint = ""
dataContent.value.subList.forEach(res => {
if (res.fromLocationCode == res.toLocationCode) {
if (res.fromInventoryStatus == res.toInventoryStatus) {
let resultHint = res.fromPackingNumber ? `包装号【${res.fromPackingNumber}` : ""
hint += resultHint + `来源库位与目标库位 来源状态与目标状态一致,不可以提交\n`
}
}
})
if (hint) {
uni.hideLoading()
comMessageRef.value.showQuestionMessage1(hint, 'red', res => {
if (res) {}
});
return;
}
// console.log("" + JSON.stringify(params))
inventoryMoveRecordSubmit(params)
.then((res) => {
uni.hideLoading()
if (res.data) {
showCommitSuccessMessage(`提交成功<br>生成${title.value}<br>${res.data}`)
showCommitSuccessMessage(`提交成功\n生成${title.value}\n${res.data}`)
} else {
showErrorMessage(`提交失败[${res.msg}]`)
}
@ -322,24 +362,13 @@ const commit = () => {
uni.hideLoading()
showErrorMessage(error)
})
} else {
uni.hideLoading()
showErrorMessage(res.message)
}
})
} else {
showErrorMessage('没有要提交的数据,请先扫描')
}
}
const setPrecisionStrategParams = () => {
const itemList = []
detailSource.value.forEach((item) => {
item.subList.forEach((detail) => {
if (detail.scaned) {
if (detail.toLocationCode == '') {
detail.toLocationCode = toLocationCode.value
}
const filterResult = itemList.filter((res) => {
if (res.itemCode == item.itemCode && detail.toLocationCode == res.locationCode) {
return res

8
src/pages/inventoryMove/coms/comMoveRecordCard.vue

@ -28,7 +28,7 @@
<view class='split_line'></view>
</view> -->
<u-swipe-action :show="item.show" :index="index" v-for="(item, index) in dataContent.subList" :key="index" :options="item.scaned ? scanOptions : detailOptions" bg-color="rgba(255,255,255,0)" @click="(...event) => swipeClick(event, item)">
<comMovebalance :dataContent="item" :isShowStdPack="false" :isShowPack="true" :fromInventoryStatus="item.inventoryStatus" :toInventoryStatus="item.toInventoryStatus" :isShowLocation="true" :allowEditStatus="allowEditStatus"></comMovebalance>
<comMovebalance :dataContent="item" :isShowStdPack="false" :isShowPack="true" :fromInventoryStatus="item.inventoryStatus" :toInventoryStatus="item.toInventoryStatus" :isShowLocation="true" :allowEditStatus="allowEditStatus" :allowEditQty="allowEditQty"></comMovebalance>
</u-swipe-action>
</u-collapse-item>
</u-collapse>
@ -74,7 +74,11 @@ const props = defineProps({
allowEditStatus: {
type: Boolean,
default: false
}
},
allowEditQty: {
type: Boolean,
default: false
},
})
const collapse1 = ref()
watch(

Loading…
Cancel
Save