Browse Source

mycomponents/detail 文件迁移Vue2升级Vue3 8/2-10/25

hella_vue3
王志国 3 weeks ago
parent
commit
042ebdecde
  1. 360
      src/mycomponents/detail/comDetailCardBatch.vue
  2. 282
      src/mycomponents/detail/comJobDetailCardBatch.vue
  3. 306
      src/mycomponents/detail/comLableDetailCard.vue
  4. 335
      src/mycomponents/detail/comRecommendDetailCard.vue
  5. 457
      src/mycomponents/detail/comRecommendDetailCardBatch.vue

360
src/mycomponents/detail/comDetailCardBatch.vue

@ -3,24 +3,18 @@
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowStdPack="false"> <item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowStdPack="false">
</item-compare-qty> </item-compare-qty>
<view class="" v-for="(item,index) in dataContent.subList" :key="index" :class="item.scaned?'scan_view':''"> <view class="" v-for="(item,index) in dataContent.subList" :key="index" :class="item.scaned?'scan_view':''">
<uni-swipe-action ref="swipeAction" v-if='index==0'> <u-swipe-action ref="swipeAction"
:options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options"
<uni-swipe-action-item @click="(...event)=>swipeClick(event,item,'parent')"
:right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options" v-if='index==0'>
@click="swipeClick($event,item,'parent')" style='padding:0px 0px 5px 0px;align-items: center;'> <div style="display: flex;">
<!-- <recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false" isShowPack='false'> <div style="flex: 1;">
</recommend> --> <batch v-if="item.batch" :batch="item.batch"></batch>
<location title="来源库位" v-if="item.fromLocationCode" :locationCode="item.fromLocationCode"></location>
<div style="display: flex;"> </div>
<div style="flex: 1;"> <text style="font-size: 30rpx;color: #2979ff; " @click="copy(item)" v-if="isDevlement()">复制</text>
<batch v-if="item.batch" :batch="item.batch"></batch> </div>
<location title="来源库位" v-if="item.fromLocationCode" :locationCode="item.fromLocationCode"></location> </u-swipe-action>
</div>
<text style="font-size: 30rpx;color: #2979ff; " @click="copy(item)" v-if="isDevlement()">复制</text>
</div>
</uni-swipe-action-item>
</uni-swipe-action>
</view> </view>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance" <balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance"
@confirm="confirm"></balance-qty-edit> @confirm="confirm"></balance-qty-edit>
@ -30,7 +24,7 @@
</view> </view>
</template> </template>
<script> <script setup>
import config from '@/static/config.js' import config from '@/static/config.js'
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'
@ -47,179 +41,161 @@
getEditRemoveOption getEditRemoveOption
} from '@/common/array.js'; } from '@/common/array.js';
export default {
emits: ['openDetail', "updateData"], import { ref, watch, onMounted, nextTick } from 'vue';
components: {
itemCompareQty, const props = defineProps({
recommend, dataContent: {
balanceQtyEdit, type: Object,
winScanLocation, default: null
location, },
toLocation, settingParam: {
batch, type: Object,
}, default: null
props: { },
dataContent: { isShowPack: {
type: Object, type: Boolean,
default: null default: true
}, },
settingParam: { isShowBatch: {
type: Object, type: Boolean,
default: null default: true
}, },
isShowPack: { isShowLocation: {
type: Boolean, type: Boolean,
default: true default: true
}, },
isShowBatch: { locationAreaTypeList: {
type: Boolean, type: Array,
default: true default: null
}, },
isShowLocation: { queryBalance: {
type: Boolean, type: Boolean,
default: true default: true
}, },
locationAreaTypeList: { isShowStatus: {
type: Array, type: Boolean,
default: null default: true
}, },
queryBalance: { isEdit: {
type: Boolean, type: Boolean,
default: true default: true
}, }
isShowStatus: { });
type: Boolean, const emit = defineEmits(['openDetail', 'remove', 'updateData']);
default: true
}, const option = ref([]);
isEdit: { const showItem = ref({});
type: Boolean, const locatonItem = ref({});
default: true const editItem = ref({});
}, const detailOptions = ref([]);
}, const scanOptions = ref([]);
watch: { const options = ref([]);
dataContent: { const removeOptions = ref([]);
handler(newName, oldName) { const editAndRemoveOptions = ref([]);
if (this.dataContent.subList.length > 0) {
this.$nextTick(res => { const collapse1Ref = ref(null);
setTimeout(() => { const qtyEditRef = ref(null);
if (this.$refs.collapse1) { const messageRef = ref(null);
this.$refs.collapse1.resize(); const scanLocationCodeRef = ref(null);
}
}, 500) watch(() => props.dataContent, (newDataContent, oldDataContent) => {
}) if (newDataContent?.subList?.length > 0) {
} nextTick(() => {
}, setTimeout(() => {
if (collapse1Ref.value) {
collapse1Ref.value.resize();
immediate: true, }
deep: true }, 500);
} });
}, }
}, { immediate: true, deep: true });
data() {
return { onMounted(() => {
option: [], if (detailOptions.value.length === 0) {
showItem: {}, detailOptions.value = getDetailOption();
locatonItem: {}, }
editItem: {}, if (scanOptions.value.length === 0) {
detailOptions: [], scanOptions.value = getPurchaseReceiptOption(props.settingParam.allowModifyQty, false);
scanOptions: [], }
options: [], removeOptions.value = getRemoveOption();
removeOptions: [], editAndRemoveOptions.value = getEditRemoveOption();
editAndRemoveOptions: [] });
}
}, const swipeClick = (e, item) => {
if (e.content.text === "详情") {
mounted() { detail(item);
if (this.detailOptions.length == 0) { } else if (e.content.text === "编辑") {
this.detailOptions = getDetailOption(); edit(item);
} } else if (e.content.text === "库位") {
if (this.scanOptions.length == 0) { showLocation(item);
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, false) } else if (e.content.text === "移除") {
} remove(item);
this.removeOptions = getRemoveOption(); }
this.editAndRemoveOptions = getEditRemoveOption() };
// this.showLocation();
}, const edit = (item) => {
editItem.value = item;
methods: { qtyEditRef.value.openEditPopup(item.balance, item.handleQty);
swipeClick(e, item) { };
if (e.content.text == "详情") {
this.detail(item) const detail = (item) => {
} else if (e.content.text == "编辑") { emit('openDetail', item);
this.edit(item) };
} else if (e.content.text == "库位") {
this.showLocation(item) const remove = (item) => {
} else if (e.content.text == "移除") { messageRef.value.showQuestionMessage("确定移除扫描信息?", (res) => {
this.remove(item) if (res) {
} item.scaned = false;
}, item.balance = {};
edit(item) { item.handleQty = null;
this.editItem = item; emit('remove', item);
this.$refs.qtyEdit.openEditPopup(item.balance, item.handleQty); }
}, });
};
detail(item) {
this.$emit('openDetail', item); const confirm = (qty) => {
// this.showItem = item; editItem.value.handleQty = qty;
// this.$refs.jobDetailPopup.openPopup(item) emit('updateData');
}, };
remove(item) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?", const showLocation = (item) => {
res => { locatonItem.value = item;
if (res) { scanLocationCodeRef.value.openScanPopup();
item.scaned = false };
item.balance = {}
item.handleQty = null; const getLocation = (location, code) => {
this.$forceUpdate() locatonItem.value.toLocationCode = code;
this.$emit('remove', item) emit('updateData');
} };
});
}, const isDevlement = () => {
confirm(qty) { return config.isDevelopment;
this.editItem.handleQty = qty; };
this.$emit('updateData')
}, const copy = (detail) => {
showLocation(item) { console.log(detail);
this.locatonItem = item; const content = `HPQ;V1.0;I${detail.itemCode};P${detail.packingNumber};B${detail.batch};Q${detail.qty}`;
this.$refs.scanLocationCode.openScanPopup(); // #ifdef H5
}, uni.copyText(content).then(() => {
// uni.showToast({
getLocation(location, code) { title: '复制采购标签成功',
this.locatonItem.toLocationCode = code; icon: 'none'
this.$emit('updateData') });
}, });
isDevlement() { // #endif
return config.isDevelopment; // #ifndef H5
}, uni.setClipboardData({
copy(detail) { data: content,
console.log(detail) success: () => {
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100 uni.showToast({
var content = "HPQ;V1.0;I" + detail.itemCode + ";P" + detail.packingNumber + ";B" + detail title: '复制采购标签成功'
.batch + ";Q" + detail.qty });
// #ifdef H5 }
this.$copyText(content).then( });
res => { // #endif
uni.showToast({ };
title: '复制采购标签成功',
icon: 'none'
})
}
)
// #endif
// #ifndef H5
uni.setClipboardData({
data: content,
success: () => {
uni.showToast({
title: '复制采购标签成功'
})
}
})
// #endif
},
}
}
</script> </script>
<style> <style>

282
src/mycomponents/detail/comJobDetailCardBatch.vue

@ -1,26 +1,24 @@
<!-- 采购上架任务详情按批次显示详情的组件 --> <!-- 采购上架任务详情按批次显示详情的组件 -->
<template> <template>
<view class="" style="background-color: #fff;"> <view class="" style="background-color: #fff;">
<uni-swipe-action> <u-swipe-action
<uni-swipe-action-item @click="(...event)=>swipeClick(event,dataContent,'parent')"
:right-options="(dataContent.scaned&&isEdit)?editAndRemoveOptions : dataContent.scaned? removeOptions:options" :options="(dataContent.scaned&&isEdit)?editAndRemoveOptions : dataContent.scaned? removeOptions:options">
@click="swipeClick($event,dataContent,'parent')"> <itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowPackUnit="true">
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowPackUnit="true"> </itemCompareQty>
</itemCompareQty> <batch v-if="dataContent.subList[0].batch" :batch="dataContent.subList[0].batch"></batch>
<batch v-if="dataContent.subList[0].batch" :batch="dataContent.subList[0].batch"></batch> <location title="来源库位" v-if="dataContent.subList[0].fromLocationCode"
<location title="来源库位" v-if="dataContent.subList[0].fromLocationCode" :locationCode="dataContent.subList[0].fromLocationCode">
:locationCode="dataContent.subList[0].fromLocationCode"> </location>
</location> </u-swipe-action>
</uni-swipe-action-item>
</uni-swipe-action> <recommend-qty-edit ref="receiptEditRef" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm">
<recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm">
</recommend-qty-edit> </recommend-qty-edit>
<comMessage ref="message"></comMessage> <comMessage ref="messageRef"></comMessage>
</view> </view>
</template> </template>
<script> <script setup>
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'
@ -41,143 +39,121 @@
getPurchaseReceiptOption getPurchaseReceiptOption
} from '@/common/array.js'; } from '@/common/array.js';
export default { import { ref, onMounted, nextTick } from 'vue';
emits: ["updateData"],
components: { const props = defineProps({
itemCompareQty, dataContent: {
recommend, type: Object,
recommendQtyEdit, default: null
jobDetailPopup, },
receiptDetailInfoPopup, settingParam: {
detailList, type: Object,
packageList, default: null
location, },
toLocation, locationAreaTypeList: {
batch, type: Object,
}, default: null
props: { },
dataContent: { isShowStatus: {
type: Object, type: Boolean,
default: null default: true
}, },
settingParam: { isShowPackListStatus: {
type: Object, type: Boolean,
default: null default: true
}, },
locationAreaTypeList: { isEdit: {
type: Object, type: Boolean,
default: null default: true
}, }
isShowStatus: { });
type: Boolean,
default: true const showItem = ref({});
}, const editItem = ref({ record: {} });
isShowPackListStatus: { const locatonItem = ref({});
type: Boolean, const detailOptions = ref([]);
default: true const scanOptions = ref([]);
}, const options = ref([]);
isEdit: { const removeOptions = ref([]);
type: Boolean, const editAndRemoveOptions = ref([]);
default: true
} const collapseRef = ref(null);
}, const receiptEditRef = ref(null);
watch: { const messageRef = ref(null);
},
onMounted(() => {
data() { if (detailOptions.value.length === 0) {
return { detailOptions.value = getDetailOption();
showItem: {}, }
editItem: { if (scanOptions.value.length === 0) {
record: { scanOptions.value = getPurchaseReceiptOption(props.settingParam.allowModifyQty, props.settingParam.allowModifyLocation);
}
} removeOptions.value = getRemoveOption();
}, editAndRemoveOptions.value = getEditRemoveOption();
locatonItem: {}, });
detailOptions: [],
scanOptions: [],
options: [], const collapseChange = () => {
removeOptions: [], setTimeout(() => {
editAndRemoveOptions: [] resizeCollapse();
} }, 500);
}, };
mounted() { const resizeCollapse = () => {
if (this.detailOptions.length == 0) { nextTick(() => {
this.detailOptions = getDetailOption(); if (collapseRef.value) {
} collapseRef.value.resize();
if (this.scanOptions.length == 0) { }
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, this.settingParam });
.allowModifyLocation) };
}
this.removeOptions = getRemoveOption(); const refreshCollapse = () => {
this.editAndRemoveOptions = getEditRemoveOption() nextTick(() => {
if (collapseRef.value) {
collapseRef.value.forEach(r => {
}, r.childrens.forEach(i => {
i.init();
updated() { });
console.log('updated') r.resize();
}, });
}
methods: { });
collapseChange() { };
setTimeout(() => {
this.resizeCollapse(); const swipeClick = (e, item, type) => {
}, 500) if (e.content.text === "编辑") {
}, edit(item);
} else if (e.content.text === "移除") {
resizeCollapse() { remove(item);
this.$nextTick(r => { }
this.$refs.collapse.resize() };
});
this.$forceUpdate(); const edit = (item) => {
}, editItem.value = item;
receiptEditRef.value.openTaskEditPopup(item.qty, item.handleQty, item.labelQty);
};
refreshCollapse() {
this.$nextTick(r => { const remove = (item) => {
this.$refs.collapse.forEach(r => { messageRef.value.showQuestionMessage("确定移除扫描信息?", (res) => {
r.childrens.forEach(i => { if (res) {
i.init(); item.scaned = false;
}) item.handleQty = null;
r.resize(); emit('remove', item);
}) }
}); });
this.$forceUpdate(); };
},
const confirm = (qty) => {
swipeClick(e, item, type) { editItem.value.handleQty = qty;
if (e.content.text == "编辑") { emit('updateData');
this.edit(item) };
} else if (e.content.text == "移除") {
this.remove(item) const updateData = () => {
} emit('updateData');
}, };
edit(item) {
this.editItem = item; const emit = defineEmits(['remove', 'updateData']);
this.$refs.receiptEdit.openTaskEditPopup(item.qty, item.handleQty, item.labelQty);
},
remove(item) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false
item.handleQty = null
this.$forceUpdate()
this.$emit('remove', item)
}
});
},
confirm(qty) {
this.editItem.handleQty = qty;
this.$emit('updateData')
},
updateData() {
this.$emit('updateData')
}
}
}
</script> </script>
<style> <style>

306
src/mycomponents/detail/comLableDetailCard.vue

@ -1,7 +1,7 @@
<template> <template>
<view class="" style="background-color: #fff;"> <view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" @change=""> <u-collapse ref="collapse1" @change="">
<uni-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"> :isShowStdPack="false">
@ -9,30 +9,26 @@
</template> </template>
<view class="" v-for="(item,index) in dataContent.subList" :key="index"> <view class="" v-for="(item,index) in dataContent.subList" :key="index">
<uni-swipe-action ref="swipeAction"> <u-swipe-action ref="swipeAction"
<uni-swipe-action-item @click="swipeClick($event,item)" @click="(...event)=>swipeClick(event,item)"
:right-options="item.scaned?scanOptions:detailOptions" style='padding:0px 0px 5px 0px;align-items: center;'
style='padding:0px 0px 5px 0px;align-items: center;'> :options="item.scaned?scanOptions:detailOptions">
<recommend :detail="item" :isShowFromLocation="isShowFromLocation" <recommend :detail="item" :isShowFromLocation="isShowFromLocation"
:isShowStatus="isShowStatus" :isShowToLocation="isShowToLocation"> :isShowStatus="isShowStatus" :isShowToLocation="isShowToLocation">
</recommend> </recommend>
</u-swipe-action>
</uni-swipe-action-item>
</uni-swipe-action>
</view> </view>
</uni-collapse-item> </u-collapse-item>
</uni-collapse> </u-collapse>
<recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm"> <recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm">
</recommend-qty-edit> </recommend-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation' <win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
:locationAreaTypeList="locationAreaTypeList"></win-scan-location> :locationAreaTypeList="locationAreaTypeList"></win-scan-location>
<comMessage ref="message"></comMessage> <comMessage ref="message"></comMessage>
</view> </view>
</template> </template>
<script> <script setup>
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'
@ -42,148 +38,140 @@
getPurchaseReceiptOption getPurchaseReceiptOption
} from '@/common/array.js'; } from '@/common/array.js';
export default { import { ref, watch, onMounted, nextTick } from 'vue';
emits: ['openDetail', "updateData","remove"],
components: { const props = defineProps({
itemCompareQty, dataContent: {
recommend, type: Object,
recommendQtyEdit, default: null
winScanLocation },
}, settingParam: {
props: { type: Object,
dataContent: { default: null
type: Object, },
default: null isShowPack: {
}, type: Boolean,
settingParam: { default: true
type: Object, },
default: null isShowBatch: {
}, type: Boolean,
isShowPack: { default: true
type: Boolean, },
default: true isShowLocation: {
}, type: Boolean,
isShowBatch: { default: true
type: Boolean, },
default: true isShowFromLocation: {
}, type: Boolean,
isShowLocation: { default: true
type: Boolean, },
default: true isShowToLocation: {
}, type: Boolean,
isShowFromLocation: { default: false
type: Boolean, },
default: true locationAreaTypeList: {
}, type: Array,
isShowToLocation: { default: null
type: Boolean, },
default: false queryBalance: {
}, type: Boolean,
default: true
locationAreaTypeList: { },
type: Array, isShowStatus: {
default: null type: Boolean,
}, default: true
queryBalance: { }
type: Boolean, });
default: true
}, const collapse1 = ref(null);
isShowStatus: { const receiptEdit = ref(null);
type: Boolean, const message = ref(null);
default: true const scanLocationCode = ref(null);
},
}, const option = ref([]);
watch: { const showItem = ref({});
dataContent: { const locatonItem = ref({});
handler(newName, oldName) { const editItem = ref({});
if (this.dataContent.subList.length > 0) { const detailOptions = ref([]);
this.$nextTick(res => { const scanOptions = ref([]);
setTimeout(() => {
if (this.$refs.collapse1) { watch(() => props.dataContent, (newDataContent, oldDataContent) => {
this.$refs.collapse1.resize(); if (newDataContent?.subList.length > 0) {
} nextTick(() => {
}, 500) setTimeout(() => {
}) if (collapse1.value) {
} collapse1.value.resize();
}, }
}, 500);
});
immediate: true, }
deep: true }, { immediate: true, deep: true });
}
}, onMounted(() => {
if (detailOptions.value.length === 0) {
data() { detailOptions.value = getDetailOption();
return { }
option: [], if (scanOptions.value.length === 0) {
showItem: {}, scanOptions.value = getPurchaseReceiptOption(props.settingParam.allowModifyQty, false);
locatonItem: {}, }
editItem: {}, // showLocation();
detailOptions: [], });
scanOptions: []
} const swipeClick = (e, item) => {
}, switch (e.content.text) {
case "详情":
mounted() { detail(item);
if (this.detailOptions.length == 0) { break;
this.detailOptions = getDetailOption(); case "编辑":
} edit(item);
if (this.scanOptions.length == 0) { break;
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, false) case "库位":
} showLocation(item);
break;
// this.showLocation(); case "移除":
}, remove(item);
break;
methods: { }
swipeClick(e, item) { };
if (e.content.text == "详情") {
this.detail(item) const edit = (item) => {
} else if (e.content.text == "编辑") { editItem.value = item;
this.edit(item) receiptEdit.value.openTaskEditPopup(item.qty, item.handleQty, item.labelQty);
} else if (e.content.text == "库位") { };
this.showLocation(item)
} else if (e.content.text == "移除") { const detail = (item) => {
this.remove(item) emit('openDetail', item);
} // showItem.value = item;
}, // jobDetailPopup.value.openPopup(item);
edit(item) { };
this.editItem = item;
this.$refs.receiptEdit.openTaskEditPopup(item.qty, item.handleQty, item.labelQty); const remove = (item) => {
}, message.value.showQuestionMessage("确定移除扫描信息?", (res) => {
if (res) {
detail(item) { item.scaned = false;
this.$emit('openDetail', item); item.balance = {};
// this.showItem = item; item.handleQty = null;
// this.$refs.jobDetailPopup.openPopup(item) emit('remove', item);
}, }
remove(item) { });
this.$refs.message.showQuestionMessage("确定移除扫描信息?", };
res => {
if (res) { const confirm = (qty) => {
item.scaned = false editItem.value.handleQty = qty;
item.balance = {} emit('updateData');
item.handleQty = null; };
this.$forceUpdate()
this.$emit('remove', item) const showLocation = (item) => {
} locatonItem.value = item;
}); scanLocationCode.value.openScanPopup();
}, };
confirm(qty) {
this.editItem.handleQty = qty; const getLocation = (location, code) => {
this.$emit('updateData') locatonItem.value.toLocationCode = code;
}, emit('updateData');
showLocation(item) { };
this.locatonItem = item;
this.$refs.scanLocationCode.openScanPopup(); const emit = defineEmits(['openDetail', 'remove', 'updateData']);
},
//
getLocation(location, code) {
this.locatonItem.toLocationCode = code;
this.$emit('updateData')
},
}
}
</script> </script>
<style> <style>

335
src/mycomponents/detail/comRecommendDetailCard.vue

@ -1,45 +1,37 @@
<template> <template>
<view class="" style="background-color: #fff;"> <view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" > <u-collapse ref="collapse1" >
<uni-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"> :isShowStdPack="false">
</item-compare-qty> </item-compare-qty>
</template> </template>
<view class="" v-for="(item,index) in dataContent.subList" :key="index"> <view class="" v-for="(item,index) in dataContent.subList" :key="index">
<uni-swipe-action ref="swipeAction"> <u-swipe-action ref="swipeAction"
<uni-swipe-action-item @click="swipeClick($event,item)" :options="item.scaned?scanOptions:detailOptions"
:right-options="item.scaned?scanOptions:detailOptions" style='padding:0px 0px 5px 0px;align-items: center;'
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 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 class="" style="font-size: 32rpx; color: black; font-weight: bold; text-align: center;">
</view>
</view> <recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false">
</recommend>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false"> </view>
</recommend> <view v-else class="uni-flex" style="flex-direction: row; align-items: center;background-color: antiquewhite; margin-top: 5rpx;">
</view> <view class="" style="font-size: 32rpx; color: red; font-weight: bold; text-align: center;">
<view v-else class="uni-flex" style="flex-direction: row; align-items: center;background-color: antiquewhite; margin-top: 5rpx;">
<view class="" style="font-size: 32rpx; color: red; font-weight: bold; text-align: center;"> </view>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false">
</recommend>
</view> </view>
</u-swipe-action>
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false">
</recommend>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
</view> </view>
</uni-collapse-item> </u-collapse-item>
</uni-collapse> </u-collapse>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance" @confirm="confirm"></balance-qty-edit> <balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance" @confirm="confirm"></balance-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation' <win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
:locationAreaTypeList="locationAreaTypeList"></win-scan-location> :locationAreaTypeList="locationAreaTypeList"></win-scan-location>
@ -47,147 +39,142 @@
</view> </view>
</template> </template>
<script> <script setup>
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 balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import { import {
getDetailOption, getDetailOption,
getPurchaseReceiptOption getPurchaseReceiptOption
} from '@/common/array.js'; } from '@/common/array.js';
export default { import {ref, watch, onMounted, nextTick} from 'vue';
emits: ['openDetail', "updateData"],
components: { const props = defineProps({
itemCompareQty, dataContent: {
recommend, type: Object,
balanceQtyEdit, default: null
winScanLocation },
}, settingParam: {
props: { type: Object,
dataContent: { default: null
type: Object, },
default: null isShowPack: {
}, type: Boolean,
settingParam: { default: true
type: Object, },
default: null isShowBatch: {
}, type: Boolean,
isShowPack: { default: true
type: Boolean, },
default: true isShowLocation: {
}, type: Boolean,
isShowBatch: { default: true
type: Boolean, },
default: true locationAreaTypeList: {
}, type: Array,
isShowLocation: { default: null
type: Boolean, },
default: true queryBalance: {
}, type: Boolean,
locationAreaTypeList: { default: true
type: Array, },
default: null isShowStatus: {
}, type: Boolean,
queryBalance: { default: true
type: Boolean, }
default: true });
}, const emit = defineEmits(['openDetail', 'remove', 'updateData']);
isShowStatus: {
type: Boolean, const collapse1 = ref(null);
default: true const qtyEdit = ref(null);
}, const message = ref(null);
}, const scanLocationCode = ref(null);
watch: {
dataContent: { const option = ref([]);
handler(newName, oldName) { const showItem = ref({});
if (this.dataContent.subList.length > 0) { const locatonItem = ref({});
this.$nextTick(res => { const editItem = ref({});
setTimeout(() => { const detailOptions = ref([]);
if (this.$refs.collapse1) { const scanOptions = ref([]);
this.$refs.collapse1.resize();
} watch(() => props.dataContent, (newDataContent, oldDataContent) => {
}, 500) if (newDataContent?.subList.length > 0) {
}) nextTick(() => {
} setTimeout(() => {
}, if (collapse1.value) {
immediate: true, collapse1.value.resize();
deep: true }
} }, 500);
}, });
}
data() { }, { immediate: true, deep: true });
return {
option: [], onMounted(() => {
showItem: {}, if (detailOptions.value.length === 0) {
locatonItem: {}, detailOptions.value = getDetailOption();
editItem: {}, }
detailOptions: [], if (scanOptions.value.length === 0) {
scanOptions: [] scanOptions.value = getPurchaseReceiptOption(props.settingParam.allowModifyQty, false);
} }
}, // showLocation();
});
mounted() {
if (this.detailOptions.length == 0) { const swipeClick = (e, item) => {
this.detailOptions = getDetailOption(); switch (e.content.text) {
} case "详情":
if (this.scanOptions.length == 0) { detail(item);
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, false) break;
} case "编辑":
edit(item);
// this.showLocation(); break;
}, case "库位":
showLocation(item);
methods: { break;
swipeClick(e, item) { case "移除":
if (e.content.text == "详情") { remove(item);
this.detail(item) break;
} else if (e.content.text == "编辑") { }
this.edit(item) };
} else if (e.content.text == "库位") {
this.showLocation(item) const edit = (item) => {
} else if (e.content.text == "移除") { editItem.value = item;
this.remove(item) qtyEdit.value.openEditPopup(item.balance, item.handleQty);
} };
},
edit(item) { const detail = (item) => {
this.editItem = item; emit('openDetail', item);
this.$refs.qtyEdit.openEditPopup(item.balance, item.handleQty); // showItem.value = item;
}, // jobDetailPopup.value.openPopup(item);
};
detail(item) {
this.$emit('openDetail', item); const remove = (item) => {
// this.showItem = item; message.value.showQuestionMessage("确定移除扫描信息?", (res) => {
// this.$refs.jobDetailPopup.openPopup(item) if (res) {
}, item.scaned = false;
remove(item) { item.balance = {};
this.$refs.message.showQuestionMessage("确定移除扫描信息?", item.handleQty = null;
res => { emit('remove', item);
if (res) { }
item.scaned = false });
item.balance = {} };
item.handleQty = null;
this.$forceUpdate() const confirm = (qty) => {
this.$emit('remove', item) editItem.value.handleQty = qty;
} emit('updateData');
}); };
},
confirm(qty) { const showLocation = (item) => {
this.editItem.handleQty = qty; locatonItem.value = item;
this.$emit('updateData') scanLocationCode.value.openScanPopup();
}, };
showLocation(item) {
this.locatonItem = item; const getLocation = (location, code) => {
this.$refs.scanLocationCode.openScanPopup(); locatonItem.value.toLocationCode = code;
}, emit('updateData');
// };
getLocation(location, code) {
this.locatonItem.toLocationCode = code;
this.$emit('updateData')
},
}
}
</script> </script>
<style> <style>

457
src/mycomponents/detail/comRecommendDetailCardBatch.vue

@ -1,240 +1,229 @@
<template> <template>
<view class="" style="background-color: #fff;"> <view class="" style="background-color: #fff;">
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowStdPack="false">
:isShowStdPack="false"> </item-compare-qty>
</item-compare-qty> <view class="" v-for="(item,index) in dataContent.subList" :key="index">
<uni-swipe-action ref="swipeAction"
style='padding:0px 0px 5px 0px;align-items: center;'
<view class="" v-for="(item,index) in dataContent.subList" :key="index"> :options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options"
<uni-swipe-action ref="swipeAction"> @click="(...event)=>swipeClick(event,item)">
<uni-swipe-action-item @click="swipeClick($event,item)" <view v-if="item.isRecommend" class="uni-flex" style="flex-direction: row;">
:right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options" <view class=""
style='padding:0px 0px 5px 0px;align-items: center;'> style="font-size: 32rpx; color: black; font-weight: bold; text-align: center;background-color: antiquewhite;display: flex;align-items: center;justify-content: center;padding: 0px 10rpx;">
<br/>
<view v-if="item.isRecommend" class="uni-flex" style="flex-direction: row;">
<view class="" style="font-size: 32rpx; color: black; font-weight: bold; text-align: center;background-color: antiquewhite;display: flex;align-items: center;justify-content: center;padding: 0px 10rpx;"> </view>
<br/> <view class="" style="flex:1;">
<batch v-if="item.batch" :batch="item.batch"></batch>
</view> <location v-if="item.fromLocationCode" title="来源库位" :locationCode="item.fromLocationCode">
<view class="" style="flex:1;"> </location>
<batch v-if="item.batch" :batch="item.batch"></batch> </view>
<location v-if="item.fromLocationCode" title="来源库位" :locationCode="item.fromLocationCode"> <text style="font-size: 30rpx;color: #2979ff; " @click="copy(item)" v-if="isDevlement()">复制</text>
</location> </view>
</view> <view v-else class="uni-flex" style="flex-direction: row; margin-top: 5rpx;">
<text style="font-size: 30rpx;color: #2979ff; " @click="copy(item)" v-if="isDevlement()">复制</text> <view class=""
style="font-size: 32rpx; color: black; font-weight: bold; text-align: center;background-color: antiquewhite;display: flex;align-items: center;justify-content: center;padding: 0px 10rpx;">
</view> <br/>
<view v-else class="uni-flex" style="flex-direction: row; margin-top: 5rpx;"> </view>
<view class="" style="font-size: 32rpx; color: black; font-weight: bold; text-align: center;background-color: antiquewhite;display: flex;align-items: center;justify-content: center;padding: 0px 10rpx;"> <view class="scan_view" style="flex:1;">
<br/> <batch v-if="item.batch" :batch="item.batch"></batch>
<location v-if="item.fromLocationCode" title="来源库位" :locationCode="item.fromLocationCode">
</view> </location>
<view class="scan_view" style="flex:1;"> </view>
<batch v-if="item.batch" :batch="item.batch"></batch> <!-- <recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false">
<location v-if="item.fromLocationCode" title="来源库位" :locationCode="item.fromLocationCode"> </recommend> -->
</location> </view>
</view> </uni-swipe-action>
<!-- <recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false"> </view>
</recommend> -->
</view> <balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance"
@confirm="confirm"></balance-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
</uni-swipe-action-item> :locationAreaTypeList="locationAreaTypeList"></win-scan-location>
</uni-swipe-action> <comMessage ref="message"></comMessage>
</view> </view>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance" @confirm="confirm"></balance-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
:locationAreaTypeList="locationAreaTypeList"></win-scan-location>
<comMessage ref="message"></comMessage>
</view>
</template> </template>
<script> <script setup>
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 balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import location from '@/mycomponents/balance/location.vue' import location from '@/mycomponents/balance/location.vue'
import toLocation from '@/mycomponents/balance/toLocation.vue' import toLocation from '@/mycomponents/balance/toLocation.vue'
import batch from '@/mycomponents/balance/batch.vue' import batch from '@/mycomponents/balance/batch.vue'
import config from '@/static/config.js' import config from '@/static/config.js'
import { import {
getRemoveOption, getRemoveOption,
getEditRemoveOption getEditRemoveOption
} from '@/common/array.js'; } from '@/common/array.js';
export default { import { ref, watch, onMounted, nextTick } from 'vue';
emits: ['openDetail', "updateData"],
components: { const props = defineProps({
itemCompareQty, dataContent: {
recommend, type: Object,
balanceQtyEdit, default: null
winScanLocation, },
location, settingParam: {
toLocation, type: Object,
itemCompareQty, default: null
batch, },
}, isShowPack: {
props: { type: Boolean,
dataContent: { default: true
type: Object, },
default: null isShowBatch: {
}, type: Boolean,
settingParam: { default: true
type: Object, },
default: null isShowLocation: {
}, type: Boolean,
isShowPack: { default: true
type: Boolean, },
default: true locationAreaTypeList: {
}, type: Array,
isShowBatch: { default: null
type: Boolean, },
default: true queryBalance: {
}, type: Boolean,
isShowLocation: { default: true
type: Boolean, },
default: true isShowStatus: {
}, type: Boolean,
locationAreaTypeList: { default: true
type: Array, },
default: null isEdit: {
}, type: Boolean,
queryBalance: { default: true
type: Boolean, }
default: true });
}, const emit = defineEmits(['openDetail', 'remove', 'updateData']);
isShowStatus: {
type: Boolean, const collapse1 = ref(null);
default: true const qtyEdit = ref(null);
}, const message = ref(null);
isEdit: { const scanLocationCode = ref(null);
type: Boolean,
default: true const option = ref([]);
}, const showItem = ref({});
}, const locatonItem = ref({});
watch: { const editItem = ref({});
dataContent: { const detailOptions = ref([]);
handler(newName, oldName) { const scanOptions = ref([]);
if (this.dataContent.subList.length > 0) { const options = ref([]);
this.$nextTick(res => { const removeOptions = ref([]);
setTimeout(() => { const editAndRemoveOptions = ref([]);
if (this.$refs.collapse1) {
this.$refs.collapse1.resize(); watch(() => props.dataContent, (newDataContent, oldDataContent) => {
} if (newDataContent?.subList.length > 0) {
}, 500) nextTick(() => {
}) setTimeout(() => {
} if (collapse1.value) {
}, collapse1.value.resize();
immediate: true, }
deep: true }, 500);
} });
}, }
}, { immediate: true, deep: true });
data() {
return { onMounted(() => {
option: [], removeOptions.value = getRemoveOption();
showItem: {}, editAndRemoveOptions.value = getEditRemoveOption();
locatonItem: {}, // showLocation();
editItem: {}, });
detailOptions: [],
scanOptions: [], const swipeClick = (e, item) => {
switch (e.content.text) {
options: [], case "详情":
removeOptions: [], detail(item);
editAndRemoveOptions: [] break;
} case "编辑":
}, edit(item);
break;
mounted() { case "库位":
showLocation(item);
this.removeOptions = getRemoveOption(); break;
this.editAndRemoveOptions = getEditRemoveOption() case "移除":
// this.showLocation(); remove(item);
}, break;
}
methods: { };
swipeClick(e, item) {
if (e.content.text == "详情") { const edit = (item) => {
this.detail(item) editItem.value = item;
} else if (e.content.text == "编辑") { qtyEdit.value.openEditPopup(item.balance, item.handleQty);
this.edit(item) };
} else if (e.content.text == "库位") {
this.showLocation(item) const detail = (item) => {
} else if (e.content.text == "移除") { emit('openDetail', item);
this.remove(item) // showItem.value = item;
} // jobDetailPopup.value.openPopup(item);
}, };
edit(item) {
this.editItem = item; const remove = (item) => {
this.$refs.qtyEdit.openEditPopup(item.balance, item.handleQty); message.value.showQuestionMessage("确定移除扫描信息?", (res) => {
}, if (res) {
item.scaned = false;
detail(item) { item.balance = {};
this.$emit('openDetail', item); item.handleQty = null;
// this.showItem = item; emit('remove', item);
// this.$refs.jobDetailPopup.openPopup(item) }
}, });
remove(item) { };
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => { const confirm = (qty) => {
if (res) { editItem.value.handleQty = qty;
item.scaned = false emit('updateData');
item.balance = {} };
item.handleQty = null;
this.$forceUpdate() const showLocation = (item) => {
this.$emit('remove', item) locatonItem.value = item;
} scanLocationCode.value.openScanPopup();
}); };
},
confirm(qty) { const getLocation = (location, code) => {
this.editItem.handleQty = qty; locatonItem.value.toLocationCode = code;
this.$emit('updateData') emit('updateData');
}, };
showLocation(item) {
this.locatonItem = item; const isDevlement = () => {
this.$refs.scanLocationCode.openScanPopup(); return config.isDevelopment;
}, };
//
getLocation(location, code) { const copy = (detail) => {
this.locatonItem.toLocationCode = code; console.log(detail);
this.$emit('updateData') const content = `HPQ;V1.0;I${detail.itemCode};P${detail.packingNumber};B${detail.batch};Q${detail.qty}`;
}, // #ifdef H5
isDevlement() { navigator.clipboard.writeText(content).then(
return config.isDevelopment; () => {
}, uni.showToast({
copy(detail) { title: '复制采购标签成功',
console.log(detail) icon: 'none'
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100 });
var content = "HPQ;V1.0;I" + detail.itemCode + ";P" + detail.packingNumber + ";B" + detail },
.batch + ";Q" + detail.qty () => {
// #ifdef H5 uni.showToast({
this.$copyText(content).then( title: '复制失败',
res => { icon: 'none'
uni.showToast({ });
title: '复制采购标签成功', }
icon: 'none' );
}) // #endif
} // #ifndef H5
) uni.setClipboardData({
// #endif data: content,
// #ifndef H5 success: () => {
uni.setClipboardData({ uni.showToast({
data: content, title: '复制采购标签成功'
success: () => { });
uni.showToast({ }
title: '复制采购标签成功' });
}) // #endif
} };
})
// #endif
},
}
}
</script> </script>
<style> <style>

Loading…
Cancel
Save