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. 19
      mycomponents/scan/winScanContainer.vue
  4. 68
      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> <template>
<view class="center uni-column"> <view class="center uni-column">
<view class="uni-flex uni-row"> <view class="uni-flex uni-row">
{{dataContent.inventoryStatus}}
<status v-show="isShowStatus" :status='dataContent.inventoryStatus'></status> <status v-show="isShowStatus" :status='dataContent.inventoryStatus'></status>
<view class="text_default center"> <view class="text_default center">
{{Number(dataContent.qty)}} {{Number(dataContent.qty)}}

4
mycomponents/record/recordComDetailCard.vue

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

19
mycomponents/scan/winScanContainer.vue

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

68
mycomponents/scan/winScanPackAndLocation.vue

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

4
pages.json

@ -1668,14 +1668,14 @@
{ {
"path": "pages/pallet/record/bindPalletRecord", "path": "pages/pallet/record/bindPalletRecord",
"style": { "style": {
"navigationBarTitleText": "托盘绑定", "navigationBarTitleText": "器具绑定",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{ {
"path": "pages/pallet/record/unBindPalletRecord", "path": "pages/pallet/record/unBindPalletRecord",
"style": { "style": {
"navigationBarTitleText": "托盘解绑", "navigationBarTitleText": "器具解绑",
"enablePullDownRefresh": false "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> <com-blank-view @goScan='showFromLocationPopup' v-if="detailSource.length==0"></com-blank-view>
</view> </view>
<view class="page-wraper" v-if="detailSource.length>0"> <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"> <view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> <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" <view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<targetContainer ref="scanContainer" title="托盘" :containerCode="containerCode" <targetContainer ref="scanContainer" title="器具" :containerCode="containerCode"
@getContainer="getContainer"> @getContainer="getContainer">
</targetContainer> </targetContainer>
</view> </view>
@ -29,11 +36,12 @@
</view> </view>
</view> </view>
</view> </view>
<win-scan-button @goScan='showFromLocationPopup'></win-scan-button> <win-scan-button @goScan='showScanPackagePopup'></win-scan-button>
</view> </view>
<win-scan-location ref="scanLocationPopup" title="库位" @getLocation="getFromLocation" <win-scan-location ref="scanLocationPopup" title="库位" @getLocation="getFromLocation"
:locationTypeList="fromlocationTypeList"></win-scan-location> :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> --> <!-- <win-scan-pack ref="scanPopup" @getResult='getScanResult'></win-scan-pack> -->
<com-message ref="comMessage"></com-message> <com-message ref="comMessage"></com-message>
</view> </view>
@ -136,43 +144,80 @@
getFromLocation(location) { getFromLocation(location) {
if (location != null) { if (location != null) {
this.fromLocationCode = location.code; 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) { getScanResult(result) {
var packingNumber = result.label.packingNumber; let balance = result.balance;
var batch = result.label.batch; let label = result.label;
var qty = result.label.qty; let pack = result.package;
var itemCode = result.label.itemCode;
var pack = result.package;
var item = this.detailSource.find(res => { var item = this.detailSource.find(res => {
if (res.itemCode == itemCode) { if (res.itemCode == balance.itemCode) {
return res return res
} }
}) })
if (item == undefined) { if (item == undefined) {
var itemp = createItemInfo(result.label, pack); var itemInfo = createItemInfo(balance, pack);
let newDetail = createDetailInfo(result.label, pack); // let newDetail = createDetailInfo(balance, pack);
itemp.subList.push(newDetail); itemInfo.subList.push(newDetail);
this.detailSource.push(itemp) this.detailSource.push(itemInfo)
} else { } else {
var detail = item.subList.find(r => { 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; return r;
} }
}) })
if (detail == undefined) { if (detail == undefined) {
let newDetail = createDetailInfo(result.label, pack); let newDetail = createDetailInfo(balance, pack);
item.subList.push(newDetail); item.subList.push(newDetail);
} else { } else {
if (detail.scaned == true) { this.showErrorMessage('箱码[' + balance.packingNumber + "]已经在列表中")
this.showErrorMessage("箱码[" + packingNumber + "批次[" + batch + "]已经在列表中")
}
} }
} }
this.calcHandleQty(); calcHandleQty(this.detailSource);
this.scanPopupGetFocus(); // 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) { showErrorMessage(message) {
@ -207,11 +252,11 @@
}, },
scanPopupGetFocus() { scanPopupGetFocus() {
this.$refs.scanPopup.getfocus(); this.$refs.scanPopup.packGetFocus();
}, },
scanPopupLoseFocus() { scanPopupLoseFocus() {
this.$refs.scanPopup.losefocus(); this.$refs.scanPopup.packLoseFocus();
}, },
commit() { commit() {
@ -219,9 +264,44 @@
this.showMessage("请先选择托码") this.showMessage("请先选择托码")
return; return;
} }
if (this.detailSource.length == 0) {
return;
}
let params = this.getParams();
console.log("提交" + JSON.stringify(params)) 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) { showMessage(message) {
setTimeout(r => { setTimeout(r => {
this.scanPopupLoseFocus(); this.scanPopupLoseFocus();
@ -245,7 +325,7 @@
}, },
getContainer(containerInfo) { getContainer(containerInfo) {
this.containerCode = containerInfo.Number; this.containerCode = containerInfo.number;
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {

3
static/config.json

@ -18,11 +18,12 @@
"request_url": { "request_url": {
"name": "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", "dev2": "http://192.168.0.157:12080/admin-api",
"chefang": "http://192.168.0.180:12080/admin-api", "chefang": "http://192.168.0.180:12080/admin-api",
"chenxinming": "http://192.168.0.230:12080/admin-api", "chenxinming": "http://192.168.0.230:12080/admin-api",
"liuchen": "http://192.168.0.159: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", "dev": "http://dev.ccwin-in.com:25100/api/admin-api",
"local": "http://localhost:12080", "local": "http://localhost:12080",
"desc": "api请求地址" "desc": "api请求地址"

Loading…
Cancel
Save