Browse Source

增加器具绑定

wms3.0_pda
niexiting 11 months ago
parent
commit
ce2df660b0
  1. 1
      mycomponents/qty/qty.vue
  2. 4
      mycomponents/record/recordComDetailCard.vue
  3. 17
      mycomponents/scan/winScanContainer.vue
  4. 44
      mycomponents/scan/winScanPackAndLocation.vue
  5. 4
      pages.json
  6. 128
      pages/pallet/record/bindPalletRecord.vue
  7. 3
      static/config.json

1
mycomponents/qty/qty.vue

@ -1,7 +1,6 @@
<template>
<view class="center uni-column">
<view class="uni-flex uni-row">
{{dataContent.inventoryStatus}}
<status v-show="isShowStatus" :status='dataContent.inventoryStatus'></status>
<view class="text_default center">
{{Number(dataContent.qty)}}

4
mycomponents/record/recordComDetailCard.vue

@ -43,7 +43,7 @@
import {
getDetailOption,
getDetailEditRemoveOption,
getDetailRemoveOption,
getClearOption
} from '@/common/array.js';
export default {
@ -113,7 +113,7 @@
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getDetailEditRemoveOption();
this.scanOptions = getDetailRemoveOption();
this.removeOptions = getClearOption();
},

17
mycomponents/scan/winScanContainer.vue

@ -23,9 +23,8 @@
</template>
<script>
import {
getBasicLocationByCode,
getContainerByNumber
} from '@/api/request2.js';
import winComScan from '@/mycomponents/scan/winComScan.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
@ -74,14 +73,18 @@
mask: true
});
let label = result.label;
this.code = label.Container;
getBalanceByContainer(this.code).then(res => {
this.code = label.container;
getContainerByNumber(this.code).then(res => {
uni.hideLoading();
if (res.data.length > 0) {
this.containerInfo = res.data[0];
if (res.data.list.length > 0) {
this.containerInfo = res.data.list[0];
if (this.containerInfo.status == 'USED') {
this.callBack();
} else {
this.showErrorMessage("托码[" + this.code + "]没查询到")
this.showErrorMessage("器具[" + this.code + "]状态是[" + this.containerInfo.status + "],不可以绑定")
}
} else {
this.showErrorMessage("未查找到器具[" + this.code + "]")
}
}).catch(error => {
uni.hideLoading();

44
mycomponents/scan/winScanPackAndLocation.vue

@ -16,16 +16,26 @@
background-color: #fff;
margin-left: 20rpx;
margin-right: 20rpx;
border-radius: 8rpx;">
border-radius: 8rpx;
height: 30px;">
<view class="uni-center" style="width: 25%; ">
来源库位
</view>
<view class="" style="width: 75%;padding: 8rpx">
<!-- <input v-model="fromLocationCode" placeholder="请扫描来源库位" :focus="locationOnFocus"
placeholder-style="font-size:12px" style="padding: 5px;" @confirm="scanLocation" /> -->
<view v-if='allowModifyLocation'>
<uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请扫描来源库位"
@confirm="scanLocation"></uni-combox>
</view>
<view v-else>
<text style="padding: 5px">
{{fromLocationCode}}
</text>
</view>
</view>
</view>
<view class="">
<view class="">
@ -80,6 +90,11 @@
type: Boolean,
default: false
},
//
allowModifyLocation: {
type: Boolean,
default: true
},
},
data() {
return {
@ -97,7 +112,7 @@
businessType: {},
inventoryStatus: [],
managementPrecision: '',
fromInventoryStatuses:""
fromInventoryStatuses: ""
}
},
created() {
@ -191,7 +206,7 @@
},
getScanResult(result) {
console.log("扫描",result)
console.log("扫描", result)
if (this.fromLocationCode == '' || this.fromLocationCode == null) {
this.showMessage('请先扫描来源库位', callback => {
this.locationGetFocus();
@ -200,11 +215,12 @@
} else {
if (result.label != null) {
this.scanResult = result;
getBalanceByManagementPrecision(result.label,this.fromLocationCode,this.fromInventoryStatuses,res=>{
if(res.success){
this.managementPrecision =res.managementPrecision
getBalanceByManagementPrecision(result.label, this.fromLocationCode, this.fromInventoryStatuses,
res => {
if (res.success) {
this.managementPrecision = res.managementPrecision
this.afterQueryBalance(res.data.list);
}else {
} else {
this.showErrorMessage(res.message, res => {
this.packGetFocus();
})
@ -243,10 +259,11 @@
})
} else if (datas.length == 1) {
let balance = datas[0];
if(balance.qty>0){
if (balance.qty > 0) {
this.packCallBack(balance);
}else {
this.showErrorMessage(this.getQueryCondition() + '<br>查找到库存记录数量为['+balance.qty+"],<br>不可以进行操作", res => {
} else {
this.showErrorMessage(this.getQueryCondition() + '<br>查找到库存记录数量为[' + balance.qty + "],<br>不可以进行操作",
res => {
this.packGetFocus();
})
}
@ -260,10 +277,11 @@
},
selectBalanceItem(balance) {
if(balance.qty>0){
if (balance.qty > 0) {
this.packCallBack(balance);
}else {
this.showErrorMessage(this.getQueryCondition() + '<br>查找到库存记录数量为['+balance.qty+"],不可以进行操作", res => {
} else {
this.showErrorMessage(this.getQueryCondition() + '<br>查找到库存记录数量为[' + balance.qty + "],不可以进行操作",
res => {
this.packGetFocus();
})
}

4
pages.json

@ -1668,14 +1668,14 @@
{
"path": "pages/pallet/record/bindPalletRecord",
"style": {
"navigationBarTitleText": "托盘绑定",
"navigationBarTitleText": "器具绑定",
"enablePullDownRefresh": false
}
},
{
"path": "pages/pallet/record/unBindPalletRecord",
"style": {
"navigationBarTitleText": "托盘解绑",
"navigationBarTitleText": "器具解绑",
"enablePullDownRefresh": false
}
},

128
pages/pallet/record/bindPalletRecord.vue

@ -4,6 +4,13 @@
<com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view>
</view>
<view class="page-wraper" v-if="detailSource.length>0">
<view class="page-header">
<view class="header_item">
来源库位{{fromLocationCode}}
</view>
<u-line color="#D8D8D8" style="margin-bottom: 15rpx;margin-top: 10rpx;"></u-line>
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
@ -20,7 +27,7 @@
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<targetContainer ref="scanContainer" title="托盘" :containerCode="containerCode"
<targetContainer ref="scanContainer" title="器具" :containerCode="containerCode"
@getContainer="getContainer">
</targetContainer>
</view>
@ -29,11 +36,12 @@
</view>
</view>
</view>
<win-scan-button @goScan='showFromLocationPopup'></win-scan-button>
<win-scan-button @goScan='showScanPackagePopup'></win-scan-button>
</view>
<win-scan-location ref="scanLocationPopup" title="库位" @getLocation="getFromLocation"
:locationTypeList="fromlocationTypeList"></win-scan-location>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :allowModifyLocation="false">
</win-scan-pack-and-location>
<!-- <win-scan-pack ref="scanPopup" @getResult='getScanResult'></win-scan-pack> -->
<com-message ref="comMessage"></com-message>
</view>
@ -136,43 +144,80 @@
getFromLocation(location) {
if (location != null) {
this.fromLocationCode = location.code;
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType)
this.showScanPackagePopup();
}
},
showScanPackagePopup() {
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType)
},
getScanResult(result) {
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var itemCode = result.label.itemCode;
var pack = result.package;
let balance = result.balance;
let label = result.label;
let pack = result.package;
var item = this.detailSource.find(res => {
if (res.itemCode == itemCode) {
if (res.itemCode == balance.itemCode) {
return res
}
})
if (item == undefined) {
var itemp = createItemInfo(result.label, pack);
let newDetail = createDetailInfo(result.label, pack); //
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
var itemInfo = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack);
itemInfo.subList.push(newDetail);
this.detailSource.push(itemInfo)
} else {
var detail = item.subList.find(r => {
if (r.packingNumber == packingNumber) {
if (r.packingNumber == balance.packingNumber &&
r.batch == balance.batch &&
r.locationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus &&
r.scaned == true) {
return r;
}
})
if (detail == undefined) {
let newDetail = createDetailInfo(result.label, pack);
let newDetail = createDetailInfo(balance, pack);
item.subList.push(newDetail);
} else {
if (detail.scaned == true) {
this.showErrorMessage("箱码[" + packingNumber + "批次[" + batch + "]已经在列表中")
}
this.showErrorMessage('箱码[' + balance.packingNumber + "]已经在列表中")
}
}
this.calcHandleQty();
this.scanPopupGetFocus();
calcHandleQty(this.detailSource);
// var packingNumber = result.label.packingNumber;
// var batch = result.label.batch;
// var qty = result.label.qty;
// var itemCode = result.label.itemCode;
// var pack = result.package;
// var item = this.detailSource.find(res => {
// if (res.itemCode == itemCode) {
// return res
// }
// })
// if (item == undefined) {
// var itemp = createItemInfo(result.label, pack);
// let newDetail = createDetailInfo(result.label, pack); //
// itemp.subList.push(newDetail);
// this.detailSource.push(itemp)
// } else {
// var detail = item.subList.find(r => {
// if (r.packingNumber == packingNumber) {
// return r;
// }
// })
// if (detail == undefined) {
// let newDetail = createDetailInfo(result.label, pack);
// item.subList.push(newDetail);
// } else {
// if (detail.scaned == true) {
// this.showErrorMessage("[" + packingNumber + "[" + batch + "]")
// }
// }
// }
// this.calcHandleQty();
// this.scanPopupGetFocus();
},
showErrorMessage(message) {
@ -207,11 +252,11 @@
},
scanPopupGetFocus() {
this.$refs.scanPopup.getfocus();
this.$refs.scanPopup.packGetFocus();
},
scanPopupLoseFocus() {
this.$refs.scanPopup.losefocus();
this.$refs.scanPopup.packLoseFocus();
},
commit() {
@ -219,9 +264,44 @@
this.showMessage("请先选择托码")
return;
}
if (this.detailSource.length == 0) {
return;
}
let params = this.getParams();
console.log("提交" + JSON.stringify(params))
},
getParams() {
var subList = []
var creator = this.$store.state.user.id
let params = {
number: this.containerCode,
type: 'bind',
status: 'USED',
creator: creator
};
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.containerContentType = 'PACKAGE';
detail.contentNumber = detail.packingNumber;
detail.itemCode = detail.itemCode;
detail.batch = detail.batch;
detail.inventoryStatus = detail.inventoryStatus;
detail.package = null;
subList.push(detail)
}
})
})
params.subList = subList
return params;
},
showMessage(message) {
setTimeout(r => {
this.scanPopupLoseFocus();
@ -245,7 +325,7 @@
},
getContainer(containerInfo) {
this.containerCode = containerInfo.Number;
this.containerCode = containerInfo.number;
},
showCommitSuccessMessage(hint) {

3
static/config.json

@ -18,11 +18,12 @@
"request_url": {
"name": "request_url",
"value": "http://192.168.0.230:12080/admin-api",
"value": "http://dev.ccwin-in.com:25100/api/admin-api",
"dev2": "http://192.168.0.157:12080/admin-api",
"chefang": "http://192.168.0.180:12080/admin-api",
"chenxinming": "http://192.168.0.230:12080/admin-api",
"liuchen": "http://192.168.0.159:12080/admin-api",
"xuebing": "http://192.168.0.106:12080/admin-api",
"dev": "http://dev.ccwin-in.com:25100/api/admin-api",
"local": "http://localhost:12080",
"desc": "api请求地址"

Loading…
Cancel
Save