Browse Source

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

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

95
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,26 +39,13 @@
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: {
const props = defineProps({
detail: {
type: Object,
default: {}
default: () => ({})
},
isShowContainer: {
type: Boolean,
@ -84,42 +71,31 @@
type: Boolean,
default: true
},
locationTitle: {
type: String,
default: '库位'
},
}
});
},
watch: {
//
detail: {
handler(newVal, oldVal) {
// 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
newVal.copyContent = `HPQ;V1.0;I${newVal.itemCode};P${newVal.packingNumber};B${newVal.batch};Q${newVal.qty}`;
} else {
newVal.copyContent = ''
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
console.log('newVal.copyContent', newVal.copyContent);
}, { immediate: true, deep: true });
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
this.$copyText(content).then(
res => {
uni.$copyText(content).then(() => {
uni.showToast({
title: '复制采购标签成功',
icon: 'none'
})
}
)
});
});
// #endif
// #ifndef H5
uni.setClipboardData({
@ -127,24 +103,21 @@
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
};
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
this.$copyText(content).then(
res => {
uni.$copyText(content).then(() => {
uni.showToast({
title: '复制制品标签成功',
icon: 'none'
})
}
)
});
});
// #endif
// #ifndef H5
uni.setClipboardData({
@ -152,17 +125,15 @@
success: () => {
uni.showToast({
title: '复制制品标签成功'
})
});
}
})
});
// #endif
},
isDevlement() {
return config.isDevelopment;
}
}
}
};
const isDevlement = computed(() => config.isDevelopment);
</script>
<style>
</style>
Loading…
Cancel
Save