Browse Source

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

hella_online_20240829
niexiting 2 months ago
parent
commit
0543304083
  1. 2
      src/common/directory.js
  2. 25
      src/common/noclick.js
  3. 7
      src/main.js
  4. 2
      src/mycomponents/job/jobComMainDetailCard.vue
  5. 309
      src/pages/issue/record/issueRecord.vue
  6. 2
      src/pages/package/coms/comScanPackagePack.vue
  7. 1
      src/pages/repleinsh/record/repleinshRecord.vue

2
src/common/directory.js

@ -617,12 +617,10 @@ export function getPackUnitName(value) {
//获取优先级
export function getPriorityName(value) {
console.log(344,value)
var resultInfo = "";
if (priorityList.length == 0) {
priorityList = getDirectoryInfo("priority")
}
console.log(455,priorityList)
if (priorityList.length > 0) {
for (let item of priorityList) {
if (item.value == value) {

25
src/common/noclick.js

@ -0,0 +1,25 @@
// 防止处理多次点击
function noMultipleClicks(methods, info) {
// methods是需要点击后需要执行的函数, info是点击需要传的参数
let that = this;
if (that.noClick) {
// 第一次点击
that.noClick= false;
if(info && info !== '') {
// info是执行函数需要传的参数
methods(info);
} else {
methods();
}
setTimeout(()=> {
that.noClick= true;
}, 2000)
} else {
// 这里是重复点击的判断
}
}
//导出
export default {
noMultipleClicks,//禁止多次点击
}

7
src/main.js

@ -4,10 +4,12 @@ import './router/my_router.js'; //引入拦截
import VueClipboard from 'vue-clipboard2' //复制粘贴
import uView from './uni_modules/vk-uview-ui';// 引入 uView UI
import comMessage from './mycomponents/common/comMessage.vue'
import noclick from './common/noclick.js'
// #ifndef VUE3
import Vue from 'vue'
console.log("Vuew2222");
console.log("Vuew2222");//配置公共方法 防治多次点击
Vue.config.productionTip = false
Vue.prototype.$store = store
Vue.prototype.$adpid = "1111111111"
@ -33,8 +35,7 @@ export function createApp() {
app.use(VueClipboard)
app.use(uView)
app.component('comMessage', comMessage)
console.log("网络22请求")
app.config.globalProperties.$noMultipleClicks = noclick.noMultipleClicks;
// startApp(app);
return {
app,

2
src/mycomponents/job/jobComMainDetailCard.vue

@ -12,7 +12,7 @@
<view class="u-flex u-row-between">
<location v-if="isShowFromLocation&&dataContent.fromLocationCode" title="来源库位" :locationCode="dataContent.fromLocationCode">
</location>
<level title="优先级" :priority="dataContent.priority">
<level title="优先级" :priority="dataContent.priority" v-if="dataContent.priority !== '' && dataContent.priority !== underfind && dataContent.priority !== null ">
</level>
</view>

309
src/pages/issue/record/issueRecord.vue

@ -1,7 +1,7 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan='showFromLocationPopup' v-if="recommendList.length==0"></com-blank-view>
<com-blank-view @goScan='openScanPopup' v-if="recommendList.length==0"></com-blank-view>
</view>
<view class="page-wraper" v-if="recommendList.length>0">
<!-- <view class="page-header">
@ -38,7 +38,7 @@
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowFromLocation="false" @removeItem="removeItem(index,item)"
:isShowFromLocation="true" @removeItem="removeItem(index,item)"
:isShowToLocation="false" @updateData="updateData" @removePack="removePack">
</record-com-detail-card>
@ -66,13 +66,9 @@
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<win-scan-pack-and-location ref="scanPopup" @getResult='onScan' :allowModifyLocation='false'
:queryBalance="false">
</win-scan-pack-and-location>
<comMessage ref="comMessage"></comMessage>
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location>
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select>
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode">
</winComScanBalance>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
@ -103,7 +99,6 @@
getBusinessType,
createItemInfo,
createDetailInfo,
calcTreeHandleQty,
calcHandleQty
} from '@/common/record.js';
@ -117,12 +112,9 @@
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import balance from '@/mycomponents/balance/balance.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
export default {
components: {
@ -130,12 +122,9 @@
winScanPack,
requiredLocation,
comBlankView,
winScanLocation,
winScanPackAndLocation,
recordComDetailCard,
recordDetailCard,
balanceSelect,
balance
winComScanBalance
},
data() {
return {
@ -157,7 +146,8 @@
show: false,
positionInfo: "请选择生产线",
resultData: {},
recommendList: []
recommendList: [],
fromInventoryStatuses:[]
};
},
onLoad(option) {
@ -168,9 +158,9 @@
getBusinessType(this.businessTypeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList;
this.toLocationAreaTypeList = res.toLocationAreaTypeList;
this.showFromLocationPopup();
this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses);
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList
this.openScanPopup();
} else {
this.showErrorMessage(res.message)
}
@ -204,131 +194,8 @@
mounted() {},
methods: {
getBalance(label, packageInfo, callback) {
var filters = []
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.fromInventoryStatuses != null && this.fromInventoryStatuses != "") {
filters.push({
column: "inventoryStatus",
action: "in",
value: this.fromInventoryStatuses
})
}
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getBalanceByFilter(params).then(res => {
callback(res.data)
}).catch(err => {
this.showErrorMessage(err.message);
})
},
getScanResult(result) {
this.resultData = result;
let packageInfo = result.package;
this.getBalance(result.label, packageInfo, balances => {
//
let s = '';
if (!result.package.parentNumber) {
if (balances.list.length == 0) {
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else {
let newBalances = balances.list.filter(b => b.locationCode == this
.fromLocationCode);
if (newBalances.length == 0) {
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else if (newBalances.length == 1) {
let balance = newBalances[0];
result.balance = balance;
this.afterGetBalance(result);
} else {
this.showBalanceSelect(newBalances);
}
}
} else {
//
if (balances.list.length == 0) {
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else {
//
let subPackitems = balances.list.filter(r => r.packingNumber == packageInfo
.number)
//
let subParentPackitems = balances.list.filter(r => r.packingNumber ==
packageInfo
.parentNumber && r.locationCode == this.fromLocationCode)
//
if (subPackitems.length == 0) {
//
if (subParentPackitems.length > 0) {
if (subParentPackitems.length == 1) {
let balance = subParentPackitems[0];
balance.qty = packageInfo.qty;
result.balance = balance;
this.afterGetBalance(result);
} else {
this.showBalanceSelect(subParentPackitems);
}
} else {
this.showErrorMessage('按外包装【' + packageInfo.parentNumber + '】和子包装【' +
packageInfo.number + '】都未查找到库存余额')
}
} else {
var locationCode = this.fromLocationCode
if (balances.list == 1) {
locationCode = balances.list[0].locationCode
} else {
var manyBlances = balances.list.filter(r => r.locationCode != this
.fromLocationCode)
if (manyBlances.length > 0) {
locationCode = manyBlances[0].locationCode;
}
}
this.showErrorMessage('该包装【' + packageInfo.number + '】在库位【' +
locationCode +
'】已经有库存余额,请重新扫描')
}
}
}
})
},
onScan(result) {
getScanResult(result){
let that = this;
let pack = result.package;
if (that.recommendList.length > 0) {
@ -340,7 +207,7 @@
if (batch == undefined) {
that.showErrorMessage('扫描的批次【' + pack.batch + '】,不是系统推荐的批次,不满足系统的先进先出规则,请重新扫描物料');
} else {
this.getScanResult(result);
this.setData(result);
}
}
} else {
@ -370,7 +237,7 @@
that.showErrorMessage('扫描的批次【' + result.package.batch + '】,不是系统推荐的批次【' +
recommendInfo.batch + '】,不满足系统的先进先出规则,请重新扫描');
} else {
this.getScanResult(result);
this.setData(result);
}
} else {
that.showErrorMessage('未查找到物料的推荐信息');
@ -384,16 +251,7 @@
},
showBalanceSelect(items) {
this.$refs.balanceSelect.openPopup(items);
},
selectBalanceItem(balance) {
this.resultData.balance = balance;
this.afterGetBalance(this.resultData);
},
afterGetBalance(result) {
setData(result) {
let balance = result.balance;
let label = result.label;
let pack = result.package;
@ -445,104 +303,12 @@
},
getScanResult1(result) {
let balance = result.balance;
let label = result.label;
let pack = result.package;
let packUnit = pack.packUnit;
let packQty = pack.packQty
var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) {
return res
}
})
if (this.fromWarehouseCode == '') {
this.fromWarehouseCode = balance.warehouseCode;
}
if (item == undefined) {
var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
newDetail.packUnit = packUnit;
newDetail.packQty = packQty;
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) {
let newDetail = createDetailInfo(balance, pack);
newDetail.packUnit = packUnit;
newDetail.packQty = packQty;
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
})
callback(res.data);
uni.hideLoading();
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error);
uni.hideLoading();
})
} else {
callback(recommend);
}
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {}
});
},
calcTreeHandleQty() {
for (let item of this.detailSource) {
item.qty = 0;
for (let detail of item.subList) {
if (detail != undefined) {
item.qty = calc.add(item.qty, detail.qty)
}
}
}
this.$forceUpdate();
},
showSelect() {
// if (this.editPosition) {
@ -614,38 +380,36 @@
},
openScanPopup() {
if (this.fromLocationCode == "") {
this.showFromLocationPopup();
return
if (this.businessType) {
this.$refs.scanPopup.openScanPopup(this.businessType);
} else {
this.getBusinessType()
}
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType);
},
showFromLocationPopup() {
this.$nextTick(() => {
this.$refs.scanLocationCode.openScanPopup();
})
},
closeScanPopup() {
if (this.$refs.scanPopup != undefined) {
if (this.$refs.scanPopup ) {
this.$refs.scanPopup.closeScanPopup();
}
},
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
if (this.$refs.scanPopup ) {
this.$refs.scanPopup.getfocus();
}
},
// scanLocationCode(location, code) {
// this.toLocationCode = code
// this.toLocationCode = location;
// },
commit() {
if(this.detailSource.length==0){
this.showErrorMessage("扫描数据为0,请先扫描数据")
return;
}
if(this.positionInfo=="请选择生产线"){
this.showErrorMessage("请先选择生产线")
return;
}
uni.showLoading({
title: "提交中....",
mask: true
@ -757,16 +521,6 @@
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 => {
@ -793,6 +547,7 @@
this.toWarehouseCode = '';
this.detailSource = [];
this.positionInfo = "请选择生产线";
this.recommendList =[]
}
}
}

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

@ -314,7 +314,7 @@ import { getDirectoryItemArray } from '@/common/directory';
packingNumber: packageInfo.number,
parentPackingNumber:packageInfo.parentNumber,
batch: label.batch,
qty: Number(balance.qty),
qty: balance.lableQty?balance.lableQty:balance.qty,
// qty: Number(label.qty) > Number(balance.qty) ? Number(balance.qty) : Number(label.qty),
uom: balance.uom,
inventoryStatus: balance.inventoryStatus,

1
src/pages/repleinsh/record/repleinshRecord.vue

@ -61,7 +61,6 @@
import {
repleinshRecordSubmit,
validateItemAndLocation,
getPutawayRecommendLocation,
getBalanceByFilter,
getBalanceByBatchOffShelf
} from '@/api/request2.js';

Loading…
Cancel
Save