Browse Source

增加包装组件

hella_vue3
niexiting 9 months ago
parent
commit
3167e9e482
  1. 158
      src/mycomponents/package/packageCard.vue
  2. 150
      src/mycomponents/package/packageList.vue
  3. 30
      src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue
  4. 4
      src/static/config.js

158
src/mycomponents/package/packageCard.vue

@ -0,0 +1,158 @@
<template>
<view :class="dataContent.scaned?'scan_view':''" style="background-color: #ffffff; border-bottom: 1upx solid #EEEEEE;">
<view class="uni-flex uni-row space-between" style="align-items: center">
<!-- uni-inline-item 暂时拿掉-->
<view style="word-break: break-all;">
<!-- <container v-if="isShowContainer&&dataContent.containerNumber!=null" :container="dataContent.containerNumber">
</container> -->
<pack v-if="isShowPack && dataContent.packingNumber!=null" :packingCode="dataContent.packingNumber"></pack>
<batch v-if="isShowBatch && dataContent.batch!=null" :batch="dataContent.batch"></batch>
<location v-if="isShowFromLocation" title="来源库位" :locationCode="dataContent.fromLocationCode">
</location>
<!-- <to-location></to-location> -->
<to-location v-if="isShowToLocation" title="目标库位" :locationCode="dataContent.toLocationCode">
</to-location>
</view>
<view style="word-break: break-all;">
<!-- ||dataContent.handleQty==0 可能会有扫描到0的情况-->
<recommend-qty v-if="dataContent.handleQty==null || dataContent.handleQty==undefined" :dataContent="dataContent"
:isShowStdPack="false" :isShowStatus="isShowStatus"></recommend-qty>
<compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)"
:handleQty="Number(dataContent.handleQty)" :isShowStdPack="false">
</compare-qty>
<view class="uni-flex uni-row center" style="vertical-align:center ;" v-if="isDevlement()">
<text style="font-size: 30rpx;color: #2979ff; " @click="copy">复制采购</text>
<text style="font-size: 30rpx;color: #2979ff;" @click="copyPro">|制品</text>
</view>
</view>
</view>
</view>
</template>
<script>
import container from '@/mycomponents/container/container.vue'
import pack from '@/mycomponents/balance/pack.vue'
import location from '@/mycomponents/balance/location.vue'
import toLocation from '@/mycomponents/balance/toLocation.vue'
import batch from '@/mycomponents/balance/batch.vue'
import recommendQty from '@/mycomponents/qty/recommendQty.vue'
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 {
}
},
props: {
dataContent: {
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: '库位'
},
},
watch: {
},
methods: {
copy() {
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100
var content = "HPQ;V1.0;I" + this.dataContent.itemCode + ";P" + this.dataContent.packingNumber + ";B" + this.dataContent
.batch + ";Q" + this.dataContent.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.dataContent.itemCode + ";P" + this.dataContent.packingNumber + ";B" + this.dataContent
.batch + ";Q" + this.dataContent.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>
<style>
</style>

150
src/mycomponents/package/packageList.vue

@ -0,0 +1,150 @@
<template>
<view class="" v-for="(item,index) in dataContent" :key="item.id">
<uni-collapse ref="collapse2" @change="collapseChange">
<uni-collapse-item :disabled="false">
<template v-slot:title>
<package-card :dataContent="item" :isShowLocation="false"
:isShowFromLocation="false"></package-card>
</template>
<view v-for="(pack,index) in item.packList" :key="pack.id" style="margin-left: 20px; width: 90%;">
<package-card :dataContent="pack" :isShowLocation="false" :isShowFromLocation="false"
:isShowToLocation="false" :isShowBatch="false"></package-card>
</view>
</uni-collapse-item>
</uni-collapse>
</view>
</template>
<script>
import config from '@/static/config.js'
import packageCard from '@/mycomponents/package/packageCard.vue'
export default {
emits: ["refreshUI"],
components: {
packageCard
},
data() {
return {
}
},
props: {
dataContent: {
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: '库位'
},
},
watch: {
},
methods: {
collapseChange() {
this.$emit("collapseChange");
this.resizeCollapse();
},
resizeCollapse() {
this.$nextTick(r => {
this.$refs.collapse2.forEach(r => {
r.childrens.forEach(i => {
i.init();
})
r.resize();
})
});
this.$forceUpdate();
},
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;
}
}
}
</script>
<style>
</style>

30
src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue

@ -6,7 +6,7 @@
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowPackUnit="false"></itemCompareQty>
</template>
<detail-list :dataContent="dataContent.subList"></detail-list>
<package-list :dataContent="dataContent.subList" @collapseChange="collapseChange"></package-list>
</uni-collapse-item>
</uni-collapse>
@ -28,6 +28,7 @@
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import pack from '@/mycomponents/balance/pack.vue'
import detailList from '@/mycomponents/detail/detailList.vue'
import packageList from '@/mycomponents/package/packageList.vue'
import {
getDetailOption,
@ -42,7 +43,8 @@
jobDetailPopup,
receiptDetailInfoPopup,
winScanLocation,
detailList
detailList,
packageList
},
props: {
dataContent: {
@ -86,11 +88,30 @@
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, this.settingParam
.allowModifyLocation)
}
this.resizeCollapse();
},
updated() {
console.log('updated')
},
methods: {
methods: {
collapseChange(){
setTimeout(() => {
this.resizeCollapse();
}, 500)
},
resizeCollapse() {
this.$nextTick(r => {
this.$refs.collapse.resize()
});
this.$forceUpdate();
},
refreshCollapse() {
this.$nextTick(r => {
this.$refs.collapse.forEach(r => {
r.childrens.forEach(i => {
@ -99,6 +120,7 @@
r.resize();
})
});
this.$forceUpdate();
},
swipeClick(e, item) {

4
src/static/config.js

@ -1,5 +1,5 @@
let request_url = "http://dev.ccwin-in.com:25300/api/admin-api"
// let request_url = "http://192.168.0.211:12080/admin-api"
// let request_url = "http://dev.ccwin-in.com:25300/api/admin-api"
let request_url = "http://192.168.0.211:12080/admin-api"
let isDevelopment = false

Loading…
Cancel
Save