Browse Source

修改器具绑定和解绑

wms3.0_pda
niexiting 11 months ago
parent
commit
0c3cc2e2e8
  1. 2
      mycomponents/balance/balance.vue
  2. 4
      mycomponents/record/recordComDetailCard.vue
  3. 2
      mycomponents/scan/winScanContainer.vue
  4. 77
      pages/container/record/containerBindRecord.vue
  5. 80
      pages/container/record/containerUnBindRecord.vue
  6. 2
      pages/purchaseReceipt/job/receiptDetail.vue
  7. 2
      static/config.json

2
mycomponents/balance/balance.vue

@ -1,5 +1,5 @@
<template>
<view :class="dataContent.scaned?'scan_view':''" style="background-color: #ffffff;">
<view :class="dataContent.scaned?'scan_view':''" style="background-color: #ffffff;margin-bottom: 2px; ">
<view class="uni-flex uni-row space-between" style="align-items: center">
<view>
<pack v-if="isShowPack && dataContent.packingNumber" :packingCode="dataContent.packingNumber"></pack>

4
mycomponents/record/recordComDetailCard.vue

@ -10,7 +10,7 @@
</uni-swipe-action-item>
</uni-swipe-action>
</template>
<u-line />
<!-- <u-line /> -->
<view class="" v-for="(detail,index) in dataContent.subList">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,detail,index)"
@ -19,7 +19,7 @@
:isShowPack="true" :isShowLocation="isShowLocation"></balance>
</uni-swipe-action-item>
</uni-swipe-action>
<u-line />
<!-- <u-line /> -->
</view>
</uni-collapse-item>
</uni-collapse>

2
mycomponents/scan/winScanContainer.vue

@ -78,7 +78,7 @@
uni.hideLoading();
if (res.data.list.length > 0) {
this.containerInfo = res.data.list[0];
if (this.containerInfo.status == 'USED') {
if (this.containerInfo.containerStatus == 'USED') {
this.callBack();
} else {
this.showErrorMessage("器具[" + this.code + "]状态是[" + this.containerInfo.status + "],不可以绑定")

77
pages/container/record/containerBindRecord.vue

@ -38,7 +38,7 @@
</view>
<win-scan-button @goScan='showScanPackagePopup'></win-scan-button>
</view>
<win-scan-location ref="scanLocationPopup" title="库位" @getLocation="getFromLocation"
<win-scan-location ref="scanLocationPopup" title="来源库位" @getLocation="getFromLocation"
:locationTypeList="fromlocationTypeList"></win-scan-location>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :allowModifyLocation="false">
</win-scan-pack-and-location>
@ -48,7 +48,6 @@
</template>
<script>
import {
containerBindRecordSubmit
} from '@/api/request2.js';
@ -98,6 +97,7 @@
jobContent: {}, //
subList: [], //subList
detailSource: [], //
container: {},
containerCode: "",
businessType: {},
fromlocationCode: '',
@ -190,38 +190,6 @@
}
}
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) {
@ -264,8 +232,12 @@
},
commit() {
uni.showLoading({
title: '提交中...',
mask: true
})
if (this.containerCode == "") {
this.showMessage("请先选择托码")
this.showMessage("请扫描托码")
return;
}
@ -274,6 +246,18 @@
}
let params = this.getParams();
console.log("提交" + JSON.stringify(params))
containerBindRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成器具绑定记录<br>" + res.data)
this.clear();
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
getParams() {
@ -281,9 +265,10 @@
var creator = this.$store.state.user.id
let params = {
number: this.containerCode,
type: 'bind',
status: 'USED',
creator: creator
status: this.container.containerStatus,
toLocatoinCode: this.fromLocationCode,
containerType: this.container.type,
creator: creator,
};
this.detailSource.forEach(item => {
@ -291,11 +276,6 @@
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)
}
@ -305,7 +285,6 @@
return params;
},
showMessage(message) {
setTimeout(r => {
this.scanPopupLoseFocus();
@ -329,13 +308,13 @@
},
getContainer(containerInfo) {
this.container = containerInfo;
this.containerCode = containerInfo.number;
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.fromLocationCode = '';
})
},
@ -347,6 +326,14 @@
this.detailSource.splice(i, 1)
}
}
},
clear() {
this.jobContent = {};
this.subList = [];
this.detailSource = [];
this.containerCode = '';
this.fromlocationCode = '';
}
}
}

80
pages/container/record/containerUnBindRecord.vue

@ -14,11 +14,12 @@
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<!-- {{item.contentNumber}} -->
<comPalletRecord :dataContent="item" :index="index" :settingParam="jobContent"
:isShowPatch="false" @removeItem="removeItem(index,item)" @updateData="updateData"
@removePack="removePack">
</comPalletRecord>
<u-line></u-line>
</view>
</view>
</scroll-view>
@ -44,7 +45,8 @@
<script>
import {
containerUnBindRecordSubmit
containerUnBindRecordSubmit,
getContainerDetailByNumber
} from '@/api/request2.js';
import {
goHome
@ -61,6 +63,10 @@
calcHandleQty
} from '@/common/record.js';
import {
getScanCount
} from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
@ -169,7 +175,6 @@
this.$forceUpdate();
},
getDataSource(subList) {
let items = [];
subList.forEach(detail => {
@ -192,6 +197,7 @@
updateData() {
this.calcHandleQty();
},
removeItem(index, item) {
this.detailSource.splice(index, 1)
},
@ -212,7 +218,7 @@
createDetailInfo(data) {
data.scaned = false;
data.packingNumber = data.ContentNumber
data.packingNumber = data.contentNumber
data.qty = Number(data.qty)
let detail = data;
return detail;
@ -242,7 +248,7 @@
},
closeScanPopup() {
this.$refs.scanPopup.closeScanPopup();
this.$refs.scanPopup.closeScanPopup();
},
scanPopupGetFocus() {
@ -257,12 +263,62 @@
}
},
commit() {
if (this.containerCode == "") {
this.showMessage("请先选择目标库位")
uni.showLoading({
title: '提交中...',
mask: true
})
this.scanCount = getScanCount(this.detailSource[0].subList);
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描要解绑的箱码")
return;
}
let params = this.getParams();
console.log("提交" + JSON.stringify(params))
containerUnBindRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成器具绑定记录<br>" + res.data)
this.clear();
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
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;
},
@ -288,7 +344,6 @@
})
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
@ -300,14 +355,15 @@
closeScanMessage() {
this.scanPopupGetFocus();
},
getContainer(containerInfo) {
this.containerCode = containerInfo.number;
getContainerDetailByNumber(this.containerCode).then(res => {
if (res.data.length > 0) {
this.detailSource = this.getDataSource(res.data)
if (res.data != null && res.data.subList.length > 0) {
this.detailSource = this.getDataSource(res.data.subList)
}
}).catch(error => {
this.showErrorMessage(error.message)
})
},

2
pages/purchaseReceipt/job/receiptDetail.vue

@ -274,8 +274,6 @@
return
}
console.log("校验通过")
//
if (this.scanCount == this.subList.length) {
this.submitJob();

2
static/config.json

@ -18,7 +18,7 @@
"request_url": {
"name": "request_url",
"value": "http://192.168.0.230:12080/admin-api",
"value": "http://192.168.0.106:12080/admin-api",
"dev2": "http://192.168.0.157:12080/admin-api",
"chefang": "http://192.168.0.176:12080/admin-api",
"chenxinming": "http://192.168.0.230:12080/admin-api",

Loading…
Cancel
Save