Browse Source

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

hella_vue3
王志国 3 weeks ago
parent
commit
0be5334006
  1. 211
      src/mycomponents/recommend/recommendBatch.vue

211
src/mycomponents/recommend/recommendBatch.vue

@ -29,7 +29,7 @@
</view>
</template>
<script>
<script setup>
import container from '@/mycomponents/container/container.vue'
import pack from '@/mycomponents/balance/pack.vue'
import location from '@/mycomponents/balance/location.vue'
@ -39,130 +39,101 @@
import compareQty from '@/mycomponents/qty/compareQty.vue'
import config from '@/static/config.js'
export default {
components: {
container,
pack,
location,
toLocation,
batch,
recommendQty,
compareQty
},
data() {
return {
import { watch, computed } from 'vue';
}
},
props: {
detail: {
type: Object,
default: {}
},
isShowContainer: {
type: Boolean,
default: true
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowFromLocation: {
type: Boolean,
default: true
},
isShowToLocation: {
type: Boolean,
default: false
},
isShowStatus: {
type: Boolean,
default: true
},
const props = defineProps({
detail: {
type: Object,
default: () => ({})
},
isShowContainer: {
type: Boolean,
default: true
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowFromLocation: {
type: Boolean,
default: true
},
isShowToLocation: {
type: Boolean,
default: false
},
isShowStatus: {
type: Boolean,
default: true
},
locationTitle: {
type: String,
default: '库位'
}
});
locationTitle: {
type: String,
default: '库位'
},
// Watchers
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);
}, { immediate: true, deep: true });
},
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,
deep: true
}
},
methods: {
copy() {
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100
var content = "HPQ;V1.0;I" + this.detail.itemCode + ";P" + this.detail.packingNumber + ";B" + this.detail
.batch + ";Q" + this.detail.qty
// #ifdef H5
this.$copyText(content).then(
res => {
uni.showToast({
title: '复制采购标签成功',
icon: 'none'
})
}
)
// #endif
// #ifndef H5
uni.setClipboardData({
data: content,
success: () => {
uni.showToast({
title: '复制采购标签成功'
})
}
})
// #endif
},
copyPro() {
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100
var content = "HMQ;V1.0;I" + this.detail.itemCode + ";P" + this.detail.packingNumber + ";B" + this.detail
.batch + ";Q" + this.detail.qty
// #ifdef H5
this.$copyText(content).then(
res => {
uni.showToast({
title: '复制制品标签成功',
icon: 'none'
})
}
)
// #endif
// #ifndef H5
uni.setClipboardData({
data: content,
success: () => {
uni.showToast({
title: '复制制品标签成功'
})
}
})
// #endif
},
isDevlement() {
return config.isDevelopment;
}
}
}
const copy = () => {
const content = `HPQ;V1.0;I${props.detail.itemCode};P${props.detail.packingNumber};B${props.detail.batch};Q${props.detail.qty}`;
// #ifdef H5
uni.$copyText(content).then(() => {
uni.showToast({
title: '复制采购标签成功',
icon: 'none'
});
});
// #endif
// #ifndef H5
uni.setClipboardData({
data: content,
success: () => {
uni.showToast({
title: '复制采购标签成功'
});
}
});
// #endif
};
const copyPro = () => {
const content = `HMQ;V1.0;I${props.detail.itemCode};P${props.detail.packingNumber};B${props.detail.batch};Q${props.detail.qty}`;
// #ifdef H5
uni.$copyText(content).then(() => {
uni.showToast({
title: '复制制品标签成功',
icon: 'none'
});
});
// #endif
// #ifndef H5
uni.setClipboardData({
data: content,
success: () => {
uni.showToast({
title: '复制制品标签成功'
});
}
});
// #endif
};
const isDevlement = computed(() => config.isDevelopment);
</script>
<style>
</style>
Loading…
Cancel
Save