Browse Source

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

pull/1/head
test 6 months ago
parent
commit
0be5334006
  1. 99
      src/mycomponents/recommend/recommendBatch.vue

99
src/mycomponents/recommend/recommendBatch.vue

@ -29,7 +29,7 @@
</view> </view>
</template> </template>
<script> <script setup>
import container from '@/mycomponents/container/container.vue' import container from '@/mycomponents/container/container.vue'
import pack from '@/mycomponents/balance/pack.vue' import pack from '@/mycomponents/balance/pack.vue'
import location from '@/mycomponents/balance/location.vue' import location from '@/mycomponents/balance/location.vue'
@ -39,26 +39,13 @@
import compareQty from '@/mycomponents/qty/compareQty.vue' import compareQty from '@/mycomponents/qty/compareQty.vue'
import config from '@/static/config.js' import config from '@/static/config.js'
export default {
components: {
container,
pack,
location,
toLocation,
batch,
recommendQty,
compareQty
},
data() { import { watch, computed } from 'vue';
return {
} const props = defineProps({
},
props: {
detail: { detail: {
type: Object, type: Object,
default: {} default: () => ({})
}, },
isShowContainer: { isShowContainer: {
type: Boolean, type: Boolean,
@ -84,42 +71,31 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
locationTitle: { locationTitle: {
type: String, type: String,
default: '库位' default: '库位'
},
},
watch: {
//
detail: {
handler(newVal, oldVal) {
if(newVal.scaned){
newVal.copyContent = "HPQ;V1.0;I" + newVal.itemCode + ";P" + newVal.packingNumber + ";B" + newVal.batch + ";Q" + newVal.qty
}else{
newVal.copyContent = ''
} }
console.log('newVal.copyContent',newVal.copyContent) });
},
immediate: true, // Watchers
deep: true watch(() => props.detail, (newVal, oldVal) => {
if (newVal.scaned) {
newVal.copyContent = `HPQ;V1.0;I${newVal.itemCode};P${newVal.packingNumber};B${newVal.batch};Q${newVal.qty}`;
} else {
newVal.copyContent = '';
} }
}, console.log('newVal.copyContent', newVal.copyContent);
methods: { }, { immediate: true, deep: true });
copy() {
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100 const copy = () => {
var content = "HPQ;V1.0;I" + this.detail.itemCode + ";P" + this.detail.packingNumber + ";B" + this.detail const content = `HPQ;V1.0;I${props.detail.itemCode};P${props.detail.packingNumber};B${props.detail.batch};Q${props.detail.qty}`;
.batch + ";Q" + this.detail.qty
// #ifdef H5 // #ifdef H5
this.$copyText(content).then( uni.$copyText(content).then(() => {
res => {
uni.showToast({ uni.showToast({
title: '复制采购标签成功', title: '复制采购标签成功',
icon: 'none' icon: 'none'
}) });
} });
)
// #endif // #endif
// #ifndef H5 // #ifndef H5
uni.setClipboardData({ uni.setClipboardData({
@ -127,24 +103,21 @@
success: () => { success: () => {
uni.showToast({ uni.showToast({
title: '复制采购标签成功' title: '复制采购标签成功'
}) });
} }
}) });
// #endif // #endif
}, };
copyPro() {
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100 const copyPro = () => {
var content = "HMQ;V1.0;I" + this.detail.itemCode + ";P" + this.detail.packingNumber + ";B" + this.detail const content = `HMQ;V1.0;I${props.detail.itemCode};P${props.detail.packingNumber};B${props.detail.batch};Q${props.detail.qty}`;
.batch + ";Q" + this.detail.qty
// #ifdef H5 // #ifdef H5
this.$copyText(content).then( uni.$copyText(content).then(() => {
res => {
uni.showToast({ uni.showToast({
title: '复制制品标签成功', title: '复制制品标签成功',
icon: 'none' icon: 'none'
}) });
} });
)
// #endif // #endif
// #ifndef H5 // #ifndef H5
uni.setClipboardData({ uni.setClipboardData({
@ -152,17 +125,15 @@
success: () => { success: () => {
uni.showToast({ uni.showToast({
title: '复制制品标签成功' title: '复制制品标签成功'
}) });
} }
}) });
// #endif // #endif
}, };
isDevlement() {
return config.isDevelopment; const isDevlement = computed(() => config.isDevelopment);
}
}
}
</script> </script>
<style> <style>
</style> </style>
Loading…
Cancel
Save