Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-uniapp into master_hella

hella_vue3
lijuncheng 7 months ago
parent
commit
3851d362da
  1. 25
      src/common/detail.js
  2. 146
      src/mycomponents/detail/detailList.vue
  3. 38
      src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue
  4. 7
      src/pages/purchaseReceipt/job/receiptDetail.vue
  5. 2
      src/static/config.js

25
src/common/detail.js

@ -2,10 +2,17 @@ import {
calc
} from '@/common/calc'
import { Decimal } from 'decimal.js';//引入
export function getDataSource(subList) {
import {
Decimal
} from 'decimal.js'; //引入
export function getDataSource(dataList) {
let items = [];
subList.forEach(detail => {
let parentList = dataList.filter(r => r.parentPackingNumber == null || r
.parentPackingNumber == '');
let childList = dataList.filter(r => r.parentPackingNumber != '' && r.parentPackingNumber != null);
parentList.forEach(detail => {
var item = items.find(r =>
r.itemCode == detail.itemCode)
if (item == undefined) {
@ -19,6 +26,16 @@ import { Decimal } from 'decimal.js';//引入
item.subList.push(newDetail);
}
})
if (childList.length > 0) {
items.forEach(r =>
r.subList.forEach(s => {
s.packList = childList.filter(c => c.parentPackingNumber == s.packingNumber)
})
)
}
return items;
}
@ -38,8 +55,8 @@ import { Decimal } from 'decimal.js';//引入
export function createDetailInfo(data) {
data.scaned = false;
// data.record = {};
let detail = data;
detail.packList = [];
return detail;
}

146
src/mycomponents/detail/detailList.vue

@ -0,0 +1,146 @@
<template>
<view class="" v-for="(item,index) in dataContent" :key="item.id">
<uni-collapse ref="collapse" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<recommend :detail="item" :isShowLocation="false" :isShowFromLocation="false"></recommend>
</template>
<view v-for="(pack,index) in item.packList" :key="pack.id" style="margin-left: 20px;">
<recommend :detail="pack" :isShowLocation="false" :isShowFromLocation="false"
:isShowToLocation="false" :isShowBatch="false"></recommend>
</view>
</uni-collapse-item>
</uni-collapse>
</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'
import recommend from '@/mycomponents/recommend/recommend.vue'
export default {
components: {
container,
pack,
location,
toLocation,
batch,
recommendQty,
compareQty,
recommend
},
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.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>

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

@ -1,24 +1,16 @@
<template>
<view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" @change="">
<uni-collapse ref="collapse" @change="" style="height: 500px;">
<uni-collapse-item :open="true">
<template v-slot:title>
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowPackUnit="false"></itemCompareQty>
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowPackUnit="false"></itemCompareQty>
</template>
<view class="" v-for="(item,index) in dataContent.subList" :key="item.id">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions">
<recommend :detail="item" :isShowLocation="false" :isShowFromLocation="false" :isShowToLocation="settingParam.allowModifyLocation=='TRUE'"></recommend>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
<detail-list :dataContent="dataContent.subList"></detail-list>
</uni-collapse-item>
</uni-collapse>
<recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam"
@confirm="confirm">
<recommend-qty-edit ref=" receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm">
</recommend-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
:locationTypeList="locationTypeList"></win-scan-location>
@ -34,6 +26,8 @@
import jobDetailPopup from '@/mycomponents/detail/jobDetailPopup.vue'
import receiptDetailInfoPopup from '@/pages/purchaseReceipt/coms/receiptDetailInfoPopup.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import pack from '@/mycomponents/balance/pack.vue'
import detailList from '@/mycomponents/detail/detailList.vue'
import {
getDetailOption,
@ -47,7 +41,8 @@
recommendQtyEdit,
jobDetailPopup,
receiptDetailInfoPopup,
winScanLocation
winScanLocation,
detailList
},
props: {
dataContent: {
@ -88,11 +83,24 @@
this.detailOptions = getDetailOption();
}
if (this.scanOptions.length == 0) {
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty,this.settingParam.allowModifyLocation)
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, this.settingParam
.allowModifyLocation)
}
this.resizeCollapse();
},
methods: {
resizeCollapse() {
this.$nextTick(r => {
this.$refs.collapse.forEach(r => {
r.childrens.forEach(i => {
i.init();
})
r.resize();
})
});
},
swipeClick(e, item) {
if (e.content.text == "详情") {
this.detail(item)

7
src/pages/purchaseReceipt/job/receiptDetail.vue

@ -46,8 +46,9 @@
</view>
</view>
<win-scan-pack ref="scanPopup" @getResult='getScanResult'></win-scan-pack>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<winScanPackAndCont ref="scanPopup" @getResult='getScanResult'></winScanPackAndCont>
<!-- <winScanPackAndCont ref="scanPopup" @getResult='getScanResult'></winScanPackAndCont> -->
<comMessage ref="comMessage"></comMessage>
</view>
</template>
@ -87,16 +88,17 @@
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackAndCont from '@/mycomponents/scan/winScanPackAndCont.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import locationCompare from '@/mycomponents/location/locationCompare.vue'
import comReceiptDetailCard from '@/pages/purchaseReceipt/coms/comReceiptDetailCard.vue'
import jobTopAsn from '@/mycomponents/job/jobTopAsn.vue'
export default {
name: 'receipt_detail',
components: {
winScanButton,
winScanPackAndCont,
winScanPack,
comReceiptDetailCard,
locationCompare,
jobTopAsn
@ -217,6 +219,7 @@
getScanResult(result) {
try {
var itemCode = result.label.itemCode;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {

2
src/static/config.js

@ -1,7 +1,7 @@
let request_url = "http://192.168.0.211:12080/admin-api"
// let request_url = "http://dev.ccwin-in.com:25100/api/admin-api"
let isDevelopment = true
let isDevelopment = false
export default {
request_url,

Loading…
Cancel
Save