Browse Source

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

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

211
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,130 +39,101 @@
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({
}, detail: {
props: { type: Object,
detail: { default: () => ({})
type: Object, },
default: {} isShowContainer: {
}, type: Boolean,
isShowContainer: { default: true
type: Boolean, },
default: true isShowPack: {
}, type: Boolean,
isShowPack: { default: true
type: Boolean, },
default: true isShowBatch: {
}, type: Boolean,
isShowBatch: { default: true
type: Boolean, },
default: true isShowFromLocation: {
}, type: Boolean,
isShowFromLocation: { default: true
type: Boolean, },
default: true isShowToLocation: {
}, type: Boolean,
isShowToLocation: { default: false
type: Boolean, },
default: false isShowStatus: {
}, type: Boolean,
isShowStatus: { default: true
type: Boolean, },
default: true locationTitle: {
}, type: String,
default: '库位'
}
});
locationTitle: { // Watchers
type: String, watch(() => props.detail, (newVal, oldVal) => {
default: '库位' 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 });
}, const copy = () => {
watch: { const content = `HPQ;V1.0;I${props.detail.itemCode};P${props.detail.packingNumber};B${props.detail.batch};Q${props.detail.qty}`;
// // #ifdef H5
detail: { uni.$copyText(content).then(() => {
handler(newVal, oldVal) { uni.showToast({
if(newVal.scaned){ title: '复制采购标签成功',
newVal.copyContent = "HPQ;V1.0;I" + newVal.itemCode + ";P" + newVal.packingNumber + ";B" + newVal.batch + ";Q" + newVal.qty icon: 'none'
}else{ });
newVal.copyContent = '' });
} // #endif
console.log('newVal.copyContent',newVal.copyContent) // #ifndef H5
}, uni.setClipboardData({
immediate: true, data: content,
deep: true success: () => {
} uni.showToast({
}, title: '复制采购标签成功'
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 // #endif
.batch + ";Q" + this.detail.qty };
// #ifdef H5
this.$copyText(content).then( const copyPro = () => {
res => { const content = `HMQ;V1.0;I${props.detail.itemCode};P${props.detail.packingNumber};B${props.detail.batch};Q${props.detail.qty}`;
uni.showToast({ // #ifdef H5
title: '复制采购标签成功', uni.$copyText(content).then(() => {
icon: 'none' uni.showToast({
}) title: '复制制品标签成功',
} icon: 'none'
) });
// #endif });
// #ifndef H5 // #endif
uni.setClipboardData({ // #ifndef H5
data: content, uni.setClipboardData({
success: () => { data: content,
uni.showToast({ success: () => {
title: '复制采购标签成功' uni.showToast({
}) title: '复制制品标签成功'
} });
}) }
// #endif });
}, // #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 const isDevlement = computed(() => config.isDevelopment);
.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;
}
}
}
</script> </script>
<style> <style>
</style> </style>
Loading…
Cancel
Save