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 5 months ago
parent
commit
1c61e37949
  1. 6
      .env.development
  2. 4
      src/mycomponents/scan/winComScan.vue
  3. 92
      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=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_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}]' # 租户配置 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>
<view style="width: 100%;"> <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="uni-flex uni-row space-between u-col-center">
<view class="" style="padding: 10rpx;"> <view class="" style="padding: 10rpx;">
历史记录 历史记录
@ -33,7 +33,7 @@
</view> </view>
</view> </view>
<u-line class='line_color' style='padding-top: 10rpx;padding-bottom: 20rpx;'></u-line> <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;"> style="height: 70px;">
<view class="uni-flex u-col" v-for="(item,index) in scanList"> <view class="uni-flex u-col" v-for="(item,index) in scanList">
<view style="width: 100%;max-height: 100px;"> <view style="width: 100%;max-height: 100px;">

92
src/mycomponents/scan/winScanPackage.vue

@ -14,20 +14,24 @@
</view> </view>
<view class=""> <view class="">
<view class=""> <view class="">
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult" :headerType="headerType" <win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult"
:isShowHistory="isShowHistory" :clearResult="true"></win-com-scan> :headerType="headerType" :isShowHistory="isShowHistory" :clearResult="true"></win-com-scan>
</view> </view>
</view> </view>
</view> </view>
</uni-popup> </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> <comMessage ref="comMessage" @afterClose="getfocus"></comMessage>
</view> </view>
</template> </template>
<script> <script>
import winComScan from '@/mycomponents/scan/winComScan.vue' import winComScan from '@/mycomponents/scan/winComScan.vue'
import {
getBalanceByFilter
} from '@/api/request2.js';
export default { export default {
name: 'winScanPack', name: 'winScanPack',
@ -43,21 +47,22 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
headerType:{ headerType: {
type: String, type: String,
default: 'HPQ' default: 'HPQ,HMQ'
} }
}, },
data() { data() {
return { return {
show: false, show: false,
businessType: null
} }
}, },
created() { created() {
}, },
methods: { methods: {
simulateScan(item){ simulateScan(item) {
this.$refs.comscansimulate.setItemCodeSimulate(item.copyContent) this.$refs.comscansimulate.setItemCodeSimulate(item.copyContent)
this.$refs.comscansimulate.clickScanMsg(); this.$refs.comscansimulate.clickScanMsg();
}, },
@ -67,32 +72,103 @@
}, 200) }, 200)
}, },
openScanPopupByBusinessType(businessType) {
setTimeout(res => {
this.$refs.popup.open('bottom')
this.businessType = businessType;
}, 200)
},
closeScanPopup() { closeScanPopup() {
this.$refs.popup.close(); this.$refs.popup.close();
this.$emit("close", ''); this.$emit("close", '');
}, },
scanClick() { scanClick() {
if(this.$refs.comscan){ if (this.$refs.comscan) {
this.$refs.comscan.clickScanMsg(); this.$refs.comscan.clickScanMsg();
} }
}, },
cancelClick() { cancelClick() {
if(this.$refs.comscan){ if (this.$refs.comscan) {
this.$refs.comscan.clearScanValue(); this.$refs.comscan.clearScanValue();
} }
}, },
getScanResult(result) { getScanResult(result) {
if (result.success) { if (result.success) {
this.getBalance(result, res => {
result.balance = res;
this.$emit("getResult", result); this.$emit("getResult", result);
})
} else { } else {
this.showMessage(result.message) 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() { getfocus() {
if (this.$refs.comscan != undefined) { if (this.$refs.comscan != undefined) {
this.$refs.comscan.getfocus(); this.$refs.comscan.getfocus();

158
src/pages/material/materialDowngrade.vue

@ -39,8 +39,8 @@
</view> </view>
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
</view> </view>
<win-scan-pack ref="scanPopup" @getResult='getScanResult' :allowModifyLocation='false'> <win-scan-package ref="scanPopup" @getResult='getScanResult' :allowModifyLocation='false'>
</win-scan-pack> </win-scan-package>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
<!-- <win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation' <!-- <win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location> --> :locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location> -->
@ -85,7 +85,7 @@
} from '@/common/balance.js'; } from '@/common/balance.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue' 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 requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue' import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
@ -94,7 +94,7 @@
export default { export default {
components: { components: {
winScanButton, winScanButton,
winScanPack, winScanPackage,
// requiredLocation, // requiredLocation,
comBlankView, comBlankView,
winScanLocation, winScanLocation,
@ -115,7 +115,7 @@
showToLoaction: true, showToLoaction: true,
recommendLocationList: [], // recommendLocationList: [], //
fromWarehouseCode: '', // fromWarehouseCode: '', //
businessTypeCode: "PurchasePutaway" businessTypeCode: "Relegate"
}; };
}, },
onLoad(option) { onLoad(option) {
@ -152,100 +152,9 @@
let poLine =label.poLine; let poLine =label.poLine;
let poNumber =label.poNumber; let poNumber =label.poNumber;
let supplierCode=label.supplierCode; 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) { showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, res => {
@ -271,18 +180,9 @@
this.updateData(); 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() { openScanPopup() {
this.$refs.scanPopup.openScanPopup(this.businessType); this.$refs.scanPopup.openScanPopupByBusinessType(this.businessType);
}, },
showFromLocationPopup() { 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() { setRecordParams() {
var subList = [] var subList = []
var creator = this.$store.state.user.id var creator = this.$store.state.user.id
@ -431,21 +300,6 @@
getLocation(location, code) { getLocation(location, code) {
this.getFromLocationCode(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) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { 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" <!-- <recommend :dataContent="record" :packageContent="record.package" :isShowStatus="false"
:isShowLocation="false"></recommend> --> :isShowLocation="false"></recommend> -->
<balance :dataContent="record" :packageContent="record.package" :isShowStatus="false" <balance :dataContent="record" :packageContent="record.package" :isShowStatus="false"
:isShowFromLocation="false"></balance> :isShowFromLocation="false" :isShowToLocation="false"></balance>
</view> </view>
</view> </view>
</uni-swipe-action-item> </uni-swipe-action-item>

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

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

121
src/pages/point/index.vue

@ -59,7 +59,7 @@
</view> </view>
</view> </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" <button @click="printImage"
style='background:rgb(60, 156, 255) !important ;color: white;margin-top: 80rpx;'> 打印</button> style='background:rgb(60, 156, 255) !important ;color: white;margin-top: 80rpx;'> 打印</button>
</view> </view>
@ -81,13 +81,67 @@
name: 'point', name: 'point',
data() { data() {
return { return {
data: {}, timer:null,
originData:[],
data: [],
newHtmlContent: '', //html newHtmlContent: '', //html
isLoadFinish: false, isLoadFinish: false,
} }
}, },
methods: { 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 // #ifdef APP
// //
printImage() { printImage() {
@ -116,6 +170,7 @@
if (newVal == true) { if (newVal == true) {
// html // html
let str = '' let str = ''
// #ifdef APP
this.readFile(htmlFileUrl, (htmlContent) => { this.readFile(htmlFileUrl, (htmlContent) => {
this.newHtmlContent = htmlContent this.newHtmlContent = htmlContent
this.data.forEach(item => { this.data.forEach(item => {
@ -195,60 +250,34 @@
"mainBody", str); // "mainBody", str); //
console.log(this.newHtmlContent) console.log(this.newHtmlContent)
}); });
// #endif
} }
} }
}, },
onLoad(option) { onLoad(option) {
uni.showLoading({
title: '加载中...',
mask: true
});
if (option.points) { if (option.points) {
this.data = JSON.parse(option.points); this.originData = JSON.parse(option.points);
} }
}, },
async onShow() { unmounted() {
// if(this.timer){
// 线 线 clearTimeout(this.timer)
// this.data = [{ this.timer = null
// 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
} }
}).catch(err => {
console.log(err);
})
}, },
fail(err) { onShow() {
console.log('err:::', err) this.timer = setTimeout(()=>{
if(this.timer){
clearTimeout(this.timer)
this.timer = null
} }
}) this.data = this.originData
this.getListData()
}) },1000)
})
}, },
} }
</script> </script>

Loading…
Cancel
Save