Browse Source

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

hella_online_20240829
lijuncheng 2 months ago
parent
commit
1c61e37949
  1. 6
      .env.development
  2. 4
      src/mycomponents/scan/winComScan.vue
  3. 84
      src/mycomponents/scan/winScanPackage.vue
  4. 158
      src/pages/material/materialDowngrade.vue
  5. 2
      src/pages/package/coms/comPackageRecord.vue
  6. 12
      src/pages/package/record/splitPackageRecord.vue
  7. 121
      src/pages/point/index.vue

6
.env.development

@ -1,7 +1,7 @@
VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api
VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/api/admin-api
#VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api
#VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/api/admin-api
#VITE_BASE_URL=http://172.21.32.13:81/api/admin-api #VITE_BASE_URL_IMAGE=http://172.21.32.13:81/admin-api
VITE_BASE_URL=http://172.21.32.13:81/api/admin-api VITE_BASE_URL_IMAGE=http://172.21.32.13:81/admin-api
# 租户配置 VITE_TENANT='[{"text":"长春1379","value":1},{"text":"成都1397","value":2},{"text":"长春2379","value":3}]'
# 是否是测试环境

4
src/mycomponents/scan/winComScan.vue

@ -23,7 +23,7 @@
</view>
<view style="width: 100%;">
<view style="width: 100%;" v-if="isShowHistory">
<view style="width: 100%;" v-if="isShowHistory&&scanList.length>0">
<view class="uni-flex uni-row space-between u-col-center">
<view class="" style="padding: 10rpx;">
历史记录
@ -33,7 +33,7 @@
</view>
</view>
<u-line class='line_color' style='padding-top: 10rpx;padding-bottom: 20rpx;'></u-line>
<scroll-view scroll-y="true" class="scroll-view" v-if="expand&&scanList.length>0"
<scroll-view scroll-y="true" class="scroll-view" v-if="expand"
style="height: 70px;">
<view class="uni-flex u-col" v-for="(item,index) in scanList">
<view style="width: 100%;max-height: 100px;">

84
src/mycomponents/scan/winScanPackage.vue

@ -14,20 +14,24 @@
</view>
<view class="">
<view class="">
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult" :headerType="headerType"
:isShowHistory="isShowHistory" :clearResult="true"></win-com-scan>
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult"
:headerType="headerType" :isShowHistory="isShowHistory" :clearResult="true"></win-com-scan>
</view>
</view>
</view>
</uni-popup>
<!-- 模拟扫描功能 -->
<win-com-scan v-show="false" ref="comscansimulate" @getResult="getScanResult" :headerType="headerType" :isShowHistory="false" :clearResult="true"></win-com-scan>
<win-com-scan v-show="false" ref="comscansimulate" @getResult="getScanResult" :headerType="headerType"
:isShowHistory="false" :clearResult="true"></win-com-scan>
<comMessage ref="comMessage" @afterClose="getfocus"></comMessage>
</view>
</template>
<script>
import winComScan from '@/mycomponents/scan/winComScan.vue'
import {
getBalanceByFilter
} from '@/api/request2.js';
export default {
name: 'winScanPack',
@ -45,12 +49,13 @@
},
headerType: {
type: String,
default: 'HPQ'
default: 'HPQ,HMQ'
}
},
data() {
return {
show: false,
businessType: null
}
},
created() {
@ -67,6 +72,16 @@
}, 200)
},
openScanPopupByBusinessType(businessType) {
setTimeout(res => {
this.$refs.popup.open('bottom')
this.businessType = businessType;
}, 200)
},
closeScanPopup() {
this.$refs.popup.close();
this.$emit("close", '');
@ -87,12 +102,73 @@
getScanResult(result) {
if (result.success) {
this.getBalance(result, res => {
result.balance = res;
this.$emit("getResult", result);
})
} else {
this.showMessage(result.message)
}
},
getBalance(result, callback) {
var filters = []
let label = result.label;
let packageInfo = result.package;
if (packageInfo.parentNumber) {
var packingNumber = packageInfo.parentNumber + "," + label.packingNumber;
filters.push({
column: "packingNumber",
action: "in",
value: packingNumber
})
} else {
filters.push({
column: "packingNumber",
action: "==",
value: label.packingNumber
})
}
filters.push({
column: "itemCode",
action: "==",
value: label.itemCode
})
filters.push({
column: "batch",
action: "==",
value: label.batch
})
if (this.businessType != null) {
filters.push({
column: "inventoryStatus",
action: "in",
value: this.businessType.inInventoryStatuses
})
}
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getBalanceByFilter(params).then(res => {
if (res.length == 0) {
this.showErrorMessage('未查找到该包装的库存余额', res => {
this.packGetFocus();
})
} else {
callback(res.data)
}
}).catch(err => {
this.showErrorMessage(err.message);
})
},
getfocus() {
if (this.$refs.comscan != undefined) {
this.$refs.comscan.getfocus();

158
src/pages/material/materialDowngrade.vue

@ -39,8 +39,8 @@
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<win-scan-pack ref="scanPopup" @getResult='getScanResult' :allowModifyLocation='false'>
</win-scan-pack>
<win-scan-package ref="scanPopup" @getResult='getScanResult' :allowModifyLocation='false'>
</win-scan-package>
<comMessage ref="comMessage"></comMessage>
<!-- <win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location> -->
@ -85,7 +85,7 @@
} from '@/common/balance.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import winScanPackage from '@/mycomponents/scan/winScanPackage.vue'
// import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
@ -94,7 +94,7 @@
export default {
components: {
winScanButton,
winScanPack,
winScanPackage,
// requiredLocation,
comBlankView,
winScanLocation,
@ -115,7 +115,7 @@
showToLoaction: true,
recommendLocationList: [], //
fromWarehouseCode: '', //
businessTypeCode: "PurchasePutaway"
businessTypeCode: "Relegate"
};
},
onLoad(option) {
@ -152,100 +152,9 @@
let poLine =label.poLine;
let poNumber =label.poNumber;
let supplierCode=label.supplierCode;
var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) {
return res
}
})
if (this.fromWarehouseCode == '') {
this.fromWarehouseCode = balance.warehouseCode;
}
if (item == undefined) {
//
this.getRecommendLocation(balance, pack, toLocation => {
var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
newDetail.toLocationCode = toLocation.locationCode;
newDetail.toWarehouseCode = toLocation.toWarehouseCode;
newDetail.poLine=poLine;
newDetail.poNumber=poNumber;
newDetail.supplierCode=supplierCode;
newDetail.fromInventoryStatus = balance.inventoryStatus;
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
calcHandleQty(this.detailSource);
})
} else {
var detail = item.subList.find(r => {
if (r.packingNumber == balance.packingNumber &&
r.batch == balance.batch &&
r.locationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) {
return r;
}
})
if (detail == undefined) {
this.getRecommendLocation(balance, pack, toLocation => {
let newDetail = createDetailInfo(balance, pack);
newDetail.toLocationCode = toLocation.locationCode;
newDetail.toWarehouseCode = toLocation.toWarehouseCode;
newDetail.poLine=poLine;
newDetail.poNumber=poNumber;
newDetail.supplierCode=supplierCode;
newDetail.fromInventoryStatus = balance.inventoryStatus;
item.subList.push(newDetail);
calcHandleQty(this.detailSource);
});
} else {
if (detail.scaned == true) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中")
}
}
}
},
//
getRecommendLocation(balance, pack, callback) {
uni.showLoading({
title: '扫描中...',
mask: true
})
let recommend = this.recommendLocationList.find(r => r.itemCode == balance.itemCode);
if (recommend == undefined) {
let param = {
itemCode: balance.itemCode,
batch: balance.batch,
inventoryStatus: balance.inventoryStatus,
supplierCode: pack.supplierCode,
businessCode: this.businessTypeCode
};
console.log(JSON.stringify(param))
getPutawayRecommendLocation(param).then(res => {
this.recommendLocationList.push({
itemCode: balance.itemCode,
locationCode: res.data.code,
toWarehouseCode:res.data.toWarehouseCode
})
var result = {
locationCode: res.data.code,
toWarehouseCode:res.data.toWarehouseCode
}
callback(result);
uni.hideLoading();
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error);
})
} else {
callback(recommend);
}
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
@ -271,18 +180,9 @@
this.updateData();
},
removePack() {
for (var i = 0; i < this.detailSource.length; i++) {
var item = this.detailSource[i];
if (item.subList.length == 0) {
this.detailSource.splice(i, 1)
}
}
this.updateData();
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup(this.businessType);
this.$refs.scanPopup.openScanPopupByBusinessType(this.businessType);
},
showFromLocationPopup() {
@ -343,37 +243,6 @@
},
getItemAndLocationRelations() {
var itemList = []
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.toLocationCode = this.toLocationCode;
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode &&
res.locationCode == detail.toLocationCode &&
res.batch == detail.batch &&
res.inventoryStatus == detail.inventoryStatus) {
return res
}
})
//
if (filterResult.length == 0) {
var result = {
itemCode: item.itemCode,
locationCode: detail.toLocationCode,
batch: detail.batch,
inventoryStatus: detail.inventoryStatus,
}
itemList.push(result)
}
}
})
})
return itemList;
},
setRecordParams() {
var subList = []
var creator = this.$store.state.user.id
@ -431,21 +300,6 @@
getLocation(location, code) {
this.getFromLocationCode(location, code)
},
getFromLocationCode(location, code) {
this.fromLocationInfo = location;
this.fromLocationCode = code;
this.openScanPopup();
},
getToLocationCode(location, code) {
if (this.fromLocationCode == code) {
uni.showToast({
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致",
duration: 2000
})
return
}
this.toLocationCode = code;
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {

2
src/pages/package/coms/comPackageRecord.vue

@ -18,7 +18,7 @@
<!-- <recommend :dataContent="record" :packageContent="record.package" :isShowStatus="false"
:isShowLocation="false"></recommend> -->
<balance :dataContent="record" :packageContent="record.package" :isShowStatus="false"
:isShowFromLocation="false"></balance>
:isShowFromLocation="false" :isShowToLocation="false"></balance>
</view>
</view>
</uni-swipe-action-item>

12
src/pages/package/record/splitPackageRecord.vue

@ -181,12 +181,12 @@
item.subList[0].Records.forEach(function(item1, index) {
sumQty = calc.add(sumQty,item1.qty)
});
if (calc.add(qty,sumQty)> item.subList[0].qty) {
this.showErrorMessage("扫描数量总和【" + (Number(qty) + sumQty) + "】(当前输入数量【" + qty + "】+已添加数量【" +
sumQty +
"】)已超过拆包箱码的数量【" + Number(item.subList[0].qty) + "】!");
return;
}
// if (calc.add(qty,sumQty)> item.subList[0].qty) {
// this.showErrorMessage("" + (Number(qty) + sumQty) + "(" + qty + "+" +
// sumQty +
// ")" + Number(item.subList[0].qty) + "!");
// return;
// }
item.subList[0].Records.push(temp);
this.$forceUpdate();
}

121
src/pages/point/index.vue

@ -59,7 +59,7 @@
</view>
</view>
</view>
<view class="" style="position: fixed;width: 100%;bottom: 0rpx;left: 0px;">
<view class="" style="position: fixed;width: 100%;bottom: 0rpx;left: 0px;" v-show="isLoadFinish">
<button @click="printImage"
style='background:rgb(60, 156, 255) !important ;color: white;margin-top: 80rpx;'> 打印</button>
</view>
@ -81,13 +81,67 @@
name: 'point',
data() {
return {
data: {},
timer:null,
originData:[],
data: [],
newHtmlContent: '', //html
isLoadFinish: false,
}
},
methods: {
getListData(){
//
// 线 线
// this.data = [{
// itemCode:'065.051-01M', //
// itemName: 'PCCLARNATEA1225BLACK9999', //
// packName: '',//
// packageCode: 'PS0513-000003', //
// batch:'20240514',//
// parentNumber:'PS0513-000003',//
// itemType:'',//
// asnNumber:'123232',//ASN
// supplierCode: 'Fewewq', //
// qty: '100', //
// printTimes:'2019-09-09 09:09:00', //
// barcodeString: 'HMQ;V1.0;Dwork1-line1;F;R2024-04-03T08:28:41;B20240403;PPN0403-000005;I399.960-12;Q5.000000;UEA;',
// barcodeBase64: '',
// productionLineCode:''//线
// }]
let _this = this
this.$nextTick(async () => {
//
const el = _this.$refs['qrcodeRef']
let str = ''
el.forEach(async (item, index) => {
await item.canvasToTempFilePath({
success: async (res) => {
// base64
await pathToBase64(res.tempFilePath).then(base64 => {
_this.data[index].barcodeBase64 = base64
if (index == el.length - 1) {
_this.isLoadFinish = true
uni.hideLoading();
}
}).catch(err => {
console.log(err);
})
},
fail(err) {
console.log('err:::', err)
}
})
})
})
},
// #ifdef APP
//
printImage() {
@ -116,6 +170,7 @@
if (newVal == true) {
// html
let str = ''
// #ifdef APP
this.readFile(htmlFileUrl, (htmlContent) => {
this.newHtmlContent = htmlContent
this.data.forEach(item => {
@ -195,60 +250,34 @@
"mainBody", str); //
console.log(this.newHtmlContent)
});
// #endif
}
}
},
onLoad(option) {
uni.showLoading({
title: '加载中...',
mask: true
});
if (option.points) {
this.data = JSON.parse(option.points);
this.originData = JSON.parse(option.points);
}
},
async onShow() {
//
// 线 线
// this.data = [{
// itemCode:'065.051-01M', //
// itemName: 'PCCLARNATEA1225BLACK9999', //
// packName: '',//
// packageCode: 'PS0513-000003', //
// batch:'20240514',//
// parentNumber:'PS0513-000003',//
// itemType:'',//
// asnNumber:'123232',//ASN
// supplierCode: 'Fewewq', //
// qty: '100', //
// printTimes:'2019-09-09 09:09:00', //
// barcodeString: 'HMQ;V1.0;Dwork1-line1;F;R2024-04-03T08:28:41;B20240403;PPN0403-000005;I399.960-12;Q5.000000;UEA;',
// barcodeBase64: '',
// productionLineCode:''//线
// }]
this.$nextTick(async () => {
//
const el = this.$refs['qrcodeRef']
let str = ''
el.forEach(async (item, index) => {
await item.canvasToTempFilePath({
success: async (res) => {
// base64
await pathToBase64(res.tempFilePath).then(base64 => {
this.data[index].barcodeBase64 = base64
if (index == el.length - 1) {
this.isLoadFinish = true
unmounted() {
if(this.timer){
clearTimeout(this.timer)
this.timer = null
}
}).catch(err => {
console.log(err);
})
},
fail(err) {
console.log('err:::', err)
onShow() {
this.timer = setTimeout(()=>{
if(this.timer){
clearTimeout(this.timer)
this.timer = null
}
})
})
})
this.data = this.originData
this.getListData()
},1000)
},
}
</script>

Loading…
Cancel
Save