Browse Source

修改扫描组件

hella_online_20240829
niexiting 4 months ago
parent
commit
8985ed091a
  1. 2
      .env.development
  2. 175
      src/mycomponents/scan/winScanPackAndLocationNoBalance.vue
  3. 4
      src/pages/putaway/job/putawayDetail.vue
  4. 82
      src/pages/putaway/job/putawayJob.vue

2
.env.development

@ -1 +1 @@
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_TENANT='[{"text":"长春","value":1},{"text":"成都","value":2}]'
VITE_BASE_URL=http://172.21.32.14:81/api/admin-api VITE_BASE_URL_IMAGE=http://172.21.32.14:81/api/admin-api # 租户配置 VITE_TENANT='[{"text":"长春","value":1},{"text":"成都","value":2}]'

175
src/mycomponents/scan/winScanPackAndLocationNoBalance.vue

@ -28,7 +28,7 @@
<view v-if='allowModifyLocation'>
<uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请扫描来源库位"
style='height: 30rpx;border:1px solid #fff ;'></uni-combox>
style='height: 30rpx;border:1px solid #fff ;'></uni-combox>
</view>
<view v-else>
<text style="padding: 5px">
@ -45,7 +45,7 @@
</view>
</view>
</uni-popup>
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select>
<!-- <balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select> -->
</view>
<comMessage ref="comMessage"></comMessage>
</template>
@ -120,7 +120,7 @@
inventoryStatus: [],
managementPrecision: '',
fromInventoryStatuses: "",
isCheck:false
isCheck: false
}
},
created() {
@ -171,7 +171,8 @@
},
scanLocation(scanResult) {
getScanResult(scanResult) {
this.scanResult = scanResult;
var isCheck = false;
if (this.fromLocationCode == '') {
this.showErrorMessage('来源库位不能为空', callback => {
@ -180,9 +181,9 @@
return;
}
if(this.fromLocationList.length>0){
if(!this.isInLocationList(this.fromLocationCode)){
this.showErrorMessage("扫描库位【"+this.fromLocationCode+'】不在任务来源库位中', callback => {
if (this.fromLocationList.length > 0) {
if (!this.isInLocationList(this.fromLocationCode)) {
this.showErrorMessage("扫描库位【" + this.fromLocationCode + '】不在任务来源库位中', callback => {
this.locationGetFocus();
})
return;
@ -193,6 +194,7 @@
title: '扫描中...',
mask: true
});
getBasicLocationByCode(this.fromLocationCode).then(res => {
if (res.data.total > 0) {
let result = res.data.list[0];
@ -201,8 +203,7 @@
if (available == "TRUE") {
if (checkDirectoryItemExist(this.fromLocationTypeArray, type)) {
this.location = result;
// this.packGetFocus();
this.checkPackage(scanResult);
this.packCallBack();
} else {
uni.hideLoading();
var hint = getListLocationTypeDesc(this.fromLocationTypeArray);
@ -212,11 +213,11 @@
})
}
} else {
uni.hideLoading();
this.showErrorMessage("扫描库位[" + this.fromLocationCode + "]不可用", res => {
this.locationGetFocus();
})
}
uni.hideLoading();
} else {
uni.hideLoading();
this.showErrorMessage('未查询到库位[' + this.fromLocationCode + ']', res => {
@ -231,131 +232,13 @@
})
},
getScanResult(result) {
// console.log("", result)
// if (this.fromLocationCode == '' || this.fromLocationCode == null) {
// this.showMessage('', callback => {
// this.locationGetFocus();
// })
// return;
// } else
this.scanLocation(result);
// debugger
// if(this.isCheck){
// this.checkPackage(result);
// }
},
checkPackage(result){
if (result.label != null) {
this.scanResult = result;
// uni.showLoading({
// title: '...',
// mask: true
// })
getBalanceByManagementPrecision(result.label, this.fromLocationCode, this.fromInventoryStatuses,
res => {
uni.hideLoading();
if (res.success) {
this.managementPrecision = res.managementPrecision
this.afterQueryBalance(res.data.list);
} else {
this.showErrorMessage(res.message, res => {
this.packGetFocus();
})
}
// uni.hideLoading();
});
}
},
afterQueryBalance(datas) {
if (this.allowNullBalance) {
this.allowNoneBalance(datas);
} else if (this.noShowBalanceMessage) {
this.countCallBack(datas);
} else {
this.mustHavaBalance(datas);
}
uni.hideLoading();
},
//
allowNoneBalance(datas) {
this.packCallBack(null);
// if (datas.length == 0) {
// this.packCallBack(null);
// } else {
// this.showErrorMessage('[' + this.fromLocationCode + '],,', res => {
// this.packGetFocus();
// })
// }
},
//
mustHavaBalance(datas) {
if (datas.length == 0) {
this.showErrorMessage(this.getQueryCondition() + '<br>未查找到库存记录', res => {
this.packGetFocus();
})
} else if (datas.length == 1) {
let balance = datas[0];
this.packCallBack(balance);
// 20231228
// if (balance.qty > 0) {
// this.packCallBack(balance);
// } else {
// this.showErrorMessage(this.getQueryCondition() + '<br>[' + balance.qty + "],<br>",
// res => {
// this.packGetFocus();
// })
// }
} else {
this.showBalanceSelect(datas);
}
},
showBalanceSelect(items) {
this.$refs.balanceSelect.openPopup(items);
},
selectBalanceItem(balance) {
this.packCallBack(balance);
// 20231228
// if (balance.qty > 0) {
// this.packCallBack(balance);
// } else {
// this.showErrorMessage(this.getQueryCondition() + '<br>[' + balance.qty + "],",
// res => {
// this.packGetFocus();
// })
// }
},
//
countCallBack(datas) {
this.$refs.comscan.clear();
//
let data = {
label: this.scanResult.label,
package: this.scanResult.package,
balance: datas,
fromLocationCode: this.fromLocationCode,
}
this.packGetFocus();
this.$emit("getCountScanResult", data);
},
packCallBack(item) {
packCallBack() {
this.$refs.comscan.clear();
//
let data = {
label: this.scanResult.label,
package: this.scanResult.package,
balance: item,
balance: null,
fromLocationCode: this.fromLocationCode,
}
this.packGetFocus();
@ -379,36 +262,6 @@
this.locationOnFocus = true;
},
getQueryCondition() {
let condition = '按照以下条件:<br>';
let label = this.scanResult.label;
let status = getInventoryStatusDesc(this.inventoryStatus);
switch (this.managementPrecision) {
case 'BY_PACKAGING':
condition = condition + '物料号=[' + label.itemCode + ']<br>箱码=[' + label.packingNumber +
']<br>批次=[' +
label.batch +
']<br>库位=[' + this.fromLocationCode + ']'
break;
case 'BY_BATCH':
condition = condition + '物料号=[' + label.itemCode + ']<br>批次=[' +
label.batch +
']<br>库位=[' + this.fromLocationCode + ']'
break;
case 'BY_QUANTITY':
condition = condition + '物料号=[' + label.itemCode + ']<br>库位=[' + this.fromLocationCode + ']'
break;
case 'BY_UNIQUEID':
condition = condition + '物料号=[' + label.itemCode + ']'
break;
}
if (this.inventoryStatus.length > 0) {
condition = condition + '<br>库存状态=[' + status + ']'
}
return condition;
},
showMessage(message, callback) {
setTimeout(r => {
@ -428,9 +281,7 @@
this.show = e.show
},
isInLocationList(location) {
var item = this.fromLocationList.find(res => res == location)
if (item = undefined) {
return false
}

4
src/pages/putaway/job/putawayDetail.vue

@ -282,7 +282,7 @@
var qty = result.label.qty;
var itemCode = result.label.itemCode;
var locationCode = result.fromLocationCode;
var inventoryStatus = "OK";
// var inventoryStatus = "OK";
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
@ -339,7 +339,7 @@
itemDetail.scaned = true;
this.detailSource[0].subList.sort(compareAsc('scaned')); //
itemDetail.handleQty = result.label.qty;
itemDetail.toInventoryStatus = "OK"
// itemDetail.toInventoryStatus = "OK"
itemDetail.packList.forEach(pac => {
pac.scaned = true
pac.handleQty = Number(pac.qty);

82
src/pages/putaway/job/putawayJob.vue

@ -9,8 +9,7 @@
<view v-if="jobList.length>0">
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in jobList" :key="index">
<uni-swipe-action-item
:right-options="item.status=='2'?detailGiveupOptions:detailOptions"
<uni-swipe-action-item :right-options="item.status=='2'?detailGiveupOptions:detailOptions"
@click="swipeClick($event,item)">
<com-putaway-job-card :dataContent="item" @click='openJobDetail(item)'></com-putaway-job-card>
</uni-swipe-action-item>
@ -220,12 +219,12 @@
cancleJob(id) {
cancleTakePutawayJob(id).then(res => {
if(res.data){
if (res.data) {
this.getList("refresh")
uni.showToast({
title:"放弃任务成功"
title: "放弃任务成功"
})
}else {
} else {
this.showMessage("放弃任务失败")
}
}).catch(error => {
@ -296,7 +295,7 @@
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
selectItem(item){
selectItem(item) {
this.$refs.scanPopup.closeScanPopup();
uni.navigateTo({
url: './putawayDetail?id=' + item.masterId + '&status=' + item.status
@ -305,44 +304,51 @@
getScanResult(result) {
try {
var filters = [{
column: "packingNumber",
action: "==",
value: result.label.packingNumber
},
{
column: "batch",
action: "==",
value: result.label.batch
},
{
column: "qty",
action: "==",
value: result.label.qty
},{
column: "itemCode",
action: "==",
value: result.label.itemCode
},{
column: "fromLocationCode",
action: "==",
value: result.label.fromLocationCode
}]
column: "packingNumber",
action: "==",
value: result.label.packingNumber
},
{
column: "batch",
action: "==",
value: result.label.batch
},
// {
// column: "qty",
// action: "==",
// value: result.label.qty
// },
{
column: "itemCode",
action: "==",
value: result.label.itemCode
},
// {
// column: "fromLocationCode",
// action: "==",
// value: result.label.fromLocationCode
// },
]
getPutawayJobList({
filters: filters,
pageNo: 1,
pageSize: 100,
}).then(res => {
console.log('getPutawayJobList',getPutawayJobList)
console.log('getPutawayJobList', getPutawayJobList)
var list = res.data.list;
list.forEach(item=>{
item.title = item.number;
item.selected = false
})
console.log('list',list)
if(list.length>1){
this.$refs.jobList.openList(list)
}else{
this.selectItem(list[0])
if (list.length > 0) {
list.forEach(item => {
item.title = item.number;
item.selected = false
})
console.log('list', list)
if (list.length > 1) {
this.$refs.jobList.openList(list)
} else {
this.selectItem(list[0])
}
} else {
this.showMessage('未查找到任务')
}
}).catch(error => {
this.showMessage(error)

Loading…
Cancel
Save