Browse Source

修改参数

wms3.0_pda
lijuncheng 12 months ago
parent
commit
1e52b9f91b
  1. 2
      pages/count/job/countDetail.vue
  2. 69
      pages/customerReturn/job/returnDetail.vue
  3. 106
      pages/deliver/job/deliverDetail.vue
  4. 51
      pages/inventoryMove/coms/comInventoryDetailCard.vue
  5. 248
      pages/inventoryMove/job/inventoryMoveDetail.vue
  6. 3
      pages/issue/job/issueDetail.vue
  7. 2
      pages/productDismantle/job/productDismantleDetail.vue
  8. 2
      pages/productReceipt/job/productReceiptDetail.vue
  9. 81
      pages/productionReceipt/job/productionReceiptDetail.vue
  10. 2
      pages/productionReturn/job/returnDetail.vue
  11. 14
      pages/repleinsh/job/repleinshDetail.vue

2
pages/count/job/countDetail.vue

@ -515,7 +515,6 @@
setParams() { setParams() {
var subList = [] var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id var creator = this.$store.state.user.id
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
@ -530,7 +529,6 @@
}) })
}) })
this.jobContent.subList = subList this.jobContent.subList = subList
this.jobContent.createTime = createTime;
this.jobContent.creator = creator; this.jobContent.creator = creator;
return this.jobContent; return this.jobContent;
}, },

69
pages/customerReturn/job/returnDetail.vue

@ -5,7 +5,8 @@
<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">
<view class=""> <view class="">
<com-detail-card :dataContent="item" :settingParam="jobContent" :isShowLocation="false" <com-detail-card :dataContent="item" :settingParam="jobContent" :isShowLocation="false"
@remove="updateData" @updateData="updateData" @openDetail="openDetail"> @remove="updateData" @updateData="updateData" @openDetail="openDetail"
:locationTypeList="tolocationTypeList">
</com-detail-card> </com-detail-card>
</view> </view>
<u-line /> <u-line />
@ -37,7 +38,6 @@
</template> </template>
<script> <script>
import { import {
getManagementPrecisions getManagementPrecisions
} from '@/common/balance.js'; } from '@/common/balance.js';
@ -45,7 +45,7 @@
import { import {
getCustomerReturnJobDetail, getCustomerReturnJobDetail,
getBasicLocationByCode, getBasicLocationByCode,
takeCustomerReturnJob takeCustomerReturnJob,
cancleTakeCustomerReturnJob, cancleTakeCustomerReturnJob,
customerReturnJobSubmit customerReturnJobSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
@ -60,7 +60,8 @@
import { import {
getDataSource, getDataSource,
createRecordInfo, createRecordInfo,
calcHandleQty calcHandleQty,
getScanCount
} from '@/common/detail.js'; } from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
@ -203,7 +204,7 @@
// //
continueScan() { continueScan() {
this.scanCount = this.getScanCount(); this.scanCount = getScanCount(this.subList);
if (this.scanCount == this.subList.length) { if (this.scanCount == this.subList.length) {
this.closeScanPopup(); this.closeScanPopup();
} else { } else {
@ -211,15 +212,6 @@
} }
}, },
getScanCount(closeScan) {
let items = this.subList.filter(r => {
if (r.scaned) {
return r;
}
})
let scanCount = items != null ? items.length : 0;
return scanCount;
},
updateData() { updateData() {
this.calcHandleQty(); this.calcHandleQty();
@ -285,7 +277,12 @@
']不一致,是否继续上架?', res => { ']不一致,是否继续上架?', res => {
if (res) { if (res) {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.handleQty = Number(result.label.qty); itemDetail.handleQty = Number(result.label.qty) > Number(result.balance
.qty) ? Number(result.balance.qty) : Number(result.label.qty);
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = result.balance.qty;
itemDetail.balance.stdPackQty = result.package.stdPackQty
itemDetail.balance.stdPackUnit = result.package.stdPackUnit
this.calcHandleQty(); this.calcHandleQty();
} else { } else {
this.scanPopupGetFocus(); this.scanPopupGetFocus();
@ -293,7 +290,12 @@
}); });
} else { } else {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.handleQty = Number(result.label.qty); itemDetail.handleQty = Number(result.label.qty) > Number(result.balance
.qty) ? Number(result.balance.qty) : Number(result.label.qty);
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = result.balance.qty;
itemDetail.balance.stdPackQty = result.package.stdPackQty
itemDetail.balance.stdPackUnit = result.package.stdPackUnit
this.calcHandleQty(); this.calcHandleQty();
} }
} }
@ -316,10 +318,15 @@
}, },
commit() { commit() {
if (this.toLocationCode == "") { this.scanCount = getScanCount(this.subList);
this.showMessage("请先选择目标库位") if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
return; return;
} }
//
if (!this.checkLocation()) {
return
}
// //
if (this.scanCount == this.subList.length) { if (this.scanCount == this.subList.length) {
@ -341,7 +348,7 @@
} }
}, },
async submitJob() { submitJob() {
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
@ -351,7 +358,7 @@
itemCodes.push(item.itemCode) itemCodes.push(item.itemCode)
}) })
getManagementPrecisions(itemCodes,this.toLocationCode, res => { getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) { if (res.success) {
this.managementList = res.list; this.managementList = res.list;
var params = this.setParams() var params = this.setParams()
@ -379,7 +386,6 @@
setParams() { setParams() {
var subList = [] var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id var creator = this.$store.state.user.id
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
@ -394,11 +400,30 @@
}) })
}) })
this.jobContent.subList = subList this.jobContent.subList = subList
this.jobContent.createTime = createTime;
this.jobContent.creator = creator; this.jobContent.creator = creator;
return this.jobContent; return this.jobContent;
}, },
checkLocation() {
var isPass = true;
if (this.toLocationCode == "" || this.toLocationCode == null) {
this.showMessageHint('请扫描收货库位', callback => {
this.$refs.comScanLocation.showLocation();
})
return isPass = false;
}
return isPass;
},
showMessageHint(hint, callback) {
this.$refs.comMessage.showErrorMessage(hint, res => {
if (res) {
callback()
}
});
},
showMessage(message) { showMessage(message) {
setTimeout(r => { setTimeout(r => {
this.scanPopupLoseFocus(); this.scanPopupLoseFocus();

106
pages/deliver/job/deliverDetail.vue

@ -5,7 +5,8 @@
<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">
<view class=""> <view class="">
<com-detail-card :dataContent="item" :settingParam="jobContent" @remove="updateData" <com-detail-card :dataContent="item" :settingParam="jobContent" @remove="updateData"
@updateData="updateData" @openDetail="openDetail"> @updateData="updateData" @openDetail="openDetail"
:locationTypeList="tolocationTypeList">
</com-detail-card> </com-detail-card>
</view> </view>
</view> </view>
@ -13,7 +14,7 @@
</view> </view>
<requiredLocation ref='comScanLocation' title="目标库位" :locationCode="toLocationCode" <requiredLocation ref='comScanLocation' title="目标库位" :locationCode="toLocationCode"
@getLocation='getToLocationCode' :isShowEdit="jobContent.allowModifyLocation == 'TRUE'" @getLocation='scanLocationCode' :isShowEdit="jobContent.allowModifyLocation == 'TRUE'"
:locationTypeList="tolocationTypeList"></requiredLocation> :locationTypeList="tolocationTypeList"></requiredLocation>
<view class="page-footer"> <view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10" <view class="uni-flex u-col-center space-between padding_10"
@ -42,7 +43,7 @@
import { import {
getDeliverDetail, getDeliverDetail,
getBasicLocationByCode, getBasicLocationByCode,
takeDeliverJob takeDeliverJob,
cancleTakeDeliverJob, cancleTakeDeliverJob,
deliverJobSubmit deliverJobSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
@ -64,7 +65,8 @@
import { import {
getDataSource, getDataSource,
createRecordInfo, createRecordInfo,
calcHandleQty calcHandleQty,
getScanCount
} from '@/common/detail.js'; } from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
@ -207,7 +209,7 @@
// //
continueScan() { continueScan() {
this.scanCount = this.getScanCount(); this.scanCount = getScanCount(this.subList);
if (this.scanCount == this.subList.length) { if (this.scanCount == this.subList.length) {
this.closeScanPopup(); this.closeScanPopup();
} else { } else {
@ -215,15 +217,6 @@
} }
}, },
getScanCount(closeScan) {
let items = this.subList.filter(r => {
if (r.scaned) {
return r;
}
})
let scanCount = items != null ? items.length : 0;
return scanCount;
},
updateData() { updateData() {
this.calcHandleQty(); this.calcHandleQty();
@ -290,7 +283,12 @@
']不一致,是否继续发货?', res => { ']不一致,是否继续发货?', res => {
if (res) { if (res) {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.handleQty = Number(result.label.qty); itemDetail.handleQty = Number(result.label.qty) > Number(result.balance
.qty) ? Number(result.balance.qty) : Number(result.label.qty);
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = result.balance.qty;
itemDetail.balance.stdPackQty = result.package.stdPackQty
itemDetail.balance.stdPackUnit = result.package.stdPackUnit
this.calcHandleQty(); this.calcHandleQty();
} else { } else {
this.scanPopupGetFocus(); this.scanPopupGetFocus();
@ -298,7 +296,12 @@
}); });
} else { } else {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.handleQty = Number(result.label.qty); itemDetail.handleQty = Number(result.label.qty) > Number(result.balance
.qty) ? Number(result.balance.qty) : Number(result.label.qty);
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = result.balance.qty;
itemDetail.balance.stdPackQty = result.package.stdPackQty
itemDetail.balance.stdPackUnit = result.package.stdPackUnit
this.calcHandleQty(); this.calcHandleQty();
} }
} }
@ -322,10 +325,15 @@
}, },
commit() { commit() {
if (this.toLocationCode == "") { this.scanCount = getScanCount(this.subList);
this.showMessage("请先选择目标库位") if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
return; return;
} }
//
if (!this.checkLocation()) {
return
}
// //
if (this.scanCount == this.subList.length) { if (this.scanCount == this.subList.length) {
@ -347,7 +355,7 @@
} }
}, },
async submitJob() { submitJob() {
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
@ -357,19 +365,18 @@
itemCodes.push(item.itemCode) itemCodes.push(item.itemCode)
}) })
getManagementPrecisions(itemCodes,this.toLocationCode, res => { getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) { if (res.success) {
this.managementList = res.list; this.managementList = res.list;
var params = this.setParams() var params = this.setParams()
console.log("提交参数", JSON.stringify(params)); console.log("提交参数", JSON.stringify(params));
// deliverJobSubmit(this.id, params).then(res => {
// deliverJobSubmit(params).then(res => {
// uni.hideLoading() // uni.hideLoading()
// if (res.data) { // if (res.data) {
// var hint = res.data.Number; // this.showCommitSuccessMessage("<br>" + res.data, )
// this.showCommitSuccessMessage("" + hint)
// } else { // } else {
// this.showErrorMessage("") // this.showErrorMessage(""+res.msg)
// } // }
// }).catch(error => { // }).catch(error => {
// uni.hideLoading() // uni.hideLoading()
@ -384,7 +391,6 @@
}, },
setParams() { setParams() {
var subList = [] var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id var creator = this.$store.state.user.id
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
@ -399,11 +405,30 @@
}) })
}) })
this.jobContent.subList = subList this.jobContent.subList = subList
this.jobContent.createTime = createTime;
this.jobContent.creator = creator; this.jobContent.creator = creator;
return this.jobContent; return this.jobContent;
}, },
checkLocation() {
var isPass = true;
if (this.toLocationCode == "" || this.toLocationCode == null) {
this.showMessageHint('请扫描收货库位', callback => {
this.$refs.comScanLocation.showLocation();
})
return isPass = false;
}
return isPass;
},
showMessageHint(hint, callback) {
this.$refs.comMessage.showErrorMessage(hint, res => {
if (res) {
callback()
}
});
},
showMessage(message) { showMessage(message) {
setTimeout(r => { setTimeout(r => {
this.scanPopupLoseFocus(); this.scanPopupLoseFocus();
@ -448,28 +473,23 @@
afterCloseMessage() { afterCloseMessage() {
this.scanPopupGetFocus(); this.scanPopupGetFocus();
}, },
scanLocationCode(location, code) {
getToLocationCode(location, code) { this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
if (this.fromLocationCode == code) { this.toLocationCode = code
this.$refs.comMessage.showMessage('来源库位[' + this.fromLocationCode + '] 不能与目标库位[' + code + '] 一致 ', this.detailSource.forEach(item => {
res => { item.subList.forEach(detail => {
this.$refs.comScanLocation.showLocation(); detail.toLocationCode = code
}); })
} else { })
this.toLocationInfo = location; })
this.toLocationCode = code;
}
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
setTimeout(() => {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
})
uni.navigateTo({ uni.navigateTo({
url: './putawayJob' url: './deliverJob'
})
}) })
}, 3000)
}, },
} }
} }

51
pages/inventoryMove/coms/comInventoryDetailCard.vue

@ -28,36 +28,36 @@
</view> </view>
</uni-collapse-item> </uni-collapse-item>
</uni-collapse> </uni-collapse>
<balance-qty-edit ref="qtyEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm"> <balance-qty-edit ref="qtyEdit" :settingParam="settingParam" @confirm="confirm"></balance-qty-edit>
</balance-qty-edit> <win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
></win-scan-location>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup> <detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<com-message ref="message"></com-message> <com-message ref="message"></com-message>
</view> </view>
</template> </template>
<script> <script>
import location from '@/mycomponents/balance/location.vue'
import itemQty from '@/mycomponents/item/itemQty.vue' import itemQty from '@/mycomponents/item/itemQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue' import recommend from '@/mycomponents/recommend/recommend.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import detailInfoPopup from '@/pages/inventoryMove/coms/detailInfoPopup.vue' import detailInfoPopup from '@/pages/inventoryMove/coms/detailInfoPopup.vue'
import comMessage from '@/mycomponents/common/comMessage.vue' import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import { import {
getDetailOption, getDetailOption,
getDetailRemoveOption, getPurchaseReceiptOption
getDetailEditRemoveOption
} from '@/common/array.js'; } from '@/common/array.js';
export default { export default {
components: { components: {
location,
itemQty, itemQty,
recommend, recommend,
balanceQtyEdit, balanceQtyEdit,
detailInfoPopup, detailInfoPopup,
comMessage comMessage,
winScanLocation
}, },
data() { data() {
return { return {
@ -65,9 +65,7 @@
title: "推荐详情", title: "推荐详情",
showItem: {}, showItem: {},
editItem: { editItem: {
record: {
}
}, },
detailOptions: [], detailOptions: [],
scanOptions: [] scanOptions: []
@ -95,12 +93,8 @@
this.detailOptions = getDetailOption(); this.detailOptions = getDetailOption();
} }
if (this.scanOptions.length == 0) { if (this.scanOptions.length == 0) {
this.scanOptions = getDetailEditRemoveOption(); this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, this.settingParam
// if (this.dataContent.allowModifyQty == 1) { .allowModifyLocation)
// this.scanOptions = getDetailEditRemoveOption();
// } else {
// this.scanOptions = getDetailRemoveOption();
// }
} }
}, },
methods: { methods: {
@ -112,6 +106,8 @@
this.detail(item) this.detail(item)
} else if (e.content.text == "编辑") { } else if (e.content.text == "编辑") {
this.edit(item) this.edit(item)
} else if (e.content.text == "库位") {
this.showLocation(item)
} else if (e.content.text == "移除") { } else if (e.content.text == "移除") {
this.remove(item) this.remove(item)
} }
@ -119,13 +115,11 @@
edit(item) { edit(item) {
this.editItem = item; this.editItem = item;
this.$refs.qtyEdit.openEditPopup(item.balance, item.record.qty); this.$refs.qtyEdit.openEditPopup(item.balance, item.handleQty);
}, },
detail(item) { detail(item) {
this.showItem = item; this.$emit('openDetail', item);
// this.$refs.receiptHint.openScanPopup()
this.$refs.detailInfoPopup.openPopup(item)
}, },
remove(item) { remove(item) {
@ -133,19 +127,26 @@
res => { res => {
if (res) { if (res) {
item.scaned = false item.scaned = false
item.record = {}
item.balance = {} item.balance = {}
item.inventoryStatus = item.RecommendInventoryStatus; item.handleQty = 0;
// item.record.qty = 0;
this.$forceUpdate() this.$forceUpdate()
this.$emit('remove', item) this.$emit('remove', item)
} }
}); });
}, },
confirm(qty) { confirm(qty) {
this.editItem.record.qty = qty; this.editItem.qty = qty;
this.$emit('updateData', this.editItem) this.$emit('updateData')
} },
showLocation(item) {
this.locatonItem = item;
this.$refs.scanLocationCode.openScanPopup();
},
//
getLocation(location, code) {
this.locatonItem.toLocationCode =code;
this.$emit('updateData')
},
} }
} }
</script> </script>

248
pages/inventoryMove/job/inventoryMoveDetail.vue

@ -5,7 +5,7 @@
<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">
<view class=""> <view class="">
<comInventoryDetailCard :dataContent="item" :settingParam="jobContent" @remove="updateData" <comInventoryDetailCard :dataContent="item" :settingParam="jobContent" @remove="updateData"
@updateData='updateData'> @updateData='updateData' @openDetail="openDetail">
</comInventoryDetailCard> </comInventoryDetailCard>
</view> </view>
</view> </view>
@ -25,6 +25,7 @@
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location> <win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location>
<detailInfoPopup ref="jobDetailPopup"></detailInfoPopup>
<com-message ref="comMessage"></com-message> <com-message ref="comMessage"></com-message>
</view> </view>
</template> </template>
@ -40,6 +41,12 @@
import { import {
getManagementPrecisions getManagementPrecisions
} from '@/common/balance.js'; } from '@/common/balance.js';
import {
getDataSource,
getScanCount,
calcHandleQty
} from '@/common/detail.js';
import { import {
goHome, goHome,
updateTitle, updateTitle,
@ -54,6 +61,9 @@
import comInventoryDetailCard from '@/pages/inventoryMove/coms/comInventoryDetailCard.vue' import comInventoryDetailCard from '@/pages/inventoryMove/coms/comInventoryDetailCard.vue'
import comMessage from '@/mycomponents/common/comMessage.vue' import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import detailInfoPopup from '@/pages/inventoryMove/coms/detailInfoPopup.vue'
export default { export default {
name: 'returnDetail', name: 'returnDetail',
@ -63,7 +73,8 @@
comInventoryDetailCard, comInventoryDetailCard,
requiredLocation, requiredLocation,
comMessage, comMessage,
winScanPackAndLocation winScanPackAndLocation,
detailInfoPopup
}, },
data() { data() {
return { return {
@ -161,7 +172,7 @@
if (res.data.subList.length > 0) { if (res.data.subList.length > 0) {
that.jobContent = res.data; that.jobContent = res.data;
that.subList = res.data.subList; that.subList = res.data.subList;
that.detailSource = that.getDataSource(that.subList) that.detailSource = getDataSource(that.subList)
} else { } else {
that.showMessage('列表数据为0'); that.showMessage('列表数据为0');
} }
@ -173,75 +184,9 @@
}, },
getDataSource(subList) {
let items = [];
subList.forEach(detail => {
var item = items.find(r =>
r.itemCode == detail.itemCode)
if (item == undefined) {
item = this.createItemInfo(detail);
let newDetail = this.createDetailInfo(detail); //
item.subList.push(newDetail);
items.push(item)
} else {
item.qty += detail.qty
let newDetail = this.createDetailInfo(detail); //
item.subList.push(newDetail);
}
})
return items;
},
createItemInfo(res) {
let item = {
itemCode: res.itemCode,
itemName: res.itemName,
stdPackQty: res.stdPackQty,
stdPackUnit: res.stdPackUnit,
qty: res.qty,
handleQty: 0,
uom: res.uom,
subList: []
}
return item;
},
createDetailInfo(data) {
data.scaned = false;
// data.record = {};
let detail = data;
return detail;
},
calcScanCount(closeScan) {
let items = this.subList.filter(r => {
if (r.scaned) {
return r;
}
})
this.scanCount = items != null ? items.length : 0;
if (this.scanCount == this.subList.length) {
this.closeScanPopup();
}
},
calcHandleQty() {
for (let item of this.detailSource) {
item.handleQty = 0;
for (let detail of item.subList) {
if (detail.record != undefined) {
item.handleQty += Number(detail.record.qty)
}
}
}
this.continueScan()
this.$forceUpdate();
},
// //
continueScan() { continueScan() {
this.scanCount = this.getScanCount(); this.scanCount = getScanCount(this.subList);
if (this.scanCount == this.subList.length) { if (this.scanCount == this.subList.length) {
this.closeScanPopup(); this.closeScanPopup();
} else { } else {
@ -249,20 +194,21 @@
} }
}, },
getScanCount(closeScan) { openDetail(item) {
let items = this.subList.filter(r => { this.$refs.jobDetailPopup.openPopup(item)
if (r.scaned) {
return r;
}
})
let scanCount = items != null ? items.length : 0;
return scanCount;
}, },
updateData() { updateData() {
this.calcHandleQty(); this.calcHandleQty();
}, },
calcHandleQty() {
calcHandleQty(this.detailSource)
this.continueScan()
this.$forceUpdate();
},
openScanPopup() { openScanPopup() {
let fromlocationCode = ''; let fromlocationCode = '';
let fromlocationList = []; let fromlocationList = [];
@ -313,7 +259,12 @@
']不一致,是否继续上架?', res => { ']不一致,是否继续上架?', res => {
if (res) { if (res) {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.record = this.createRecordInfo(itemDetail, result.balance); itemDetail.handleQty = Number(result.label.qty) > Number(result.balance
.qty) ? Number(result.balance.qty) : Number(result.label.qty);
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = result.balance.qty;
itemDetail.balance.stdPackQty = result.package.stdPackQty
itemDetail.balance.stdPackUnit = result.package.stdPackUnit
this.calcHandleQty(); this.calcHandleQty();
} else { } else {
this.scanPopupGetFocus(); this.scanPopupGetFocus();
@ -321,7 +272,12 @@
}); });
} else { } else {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.record = this.createRecordInfo(itemDetail, result.balance); itemDetail.handleQty = Number(result.label.qty) > Number(result.balance
.qty) ? Number(result.balance.qty) : Number(result.label.qty);
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = result.balance.qty;
itemDetail.balance.stdPackQty = result.package.stdPackQty
itemDetail.balance.stdPackUnit = result.package.stdPackUnit
this.calcHandleQty(); this.calcHandleQty();
} }
} }
@ -333,20 +289,14 @@
} }
}, },
createRecordInfo(detail, balance) {
var record = {}
detail.scaned = true;
detail.balance = balance;
detail.recommendInventoryStatus = detail.inventoryStatus;
detail.inventoryStatus = balance.inventoryStatus;
// let record = JSON.parse(JSON.stringify(detail));
//
Object.assign(record, detail)
record.qty = Number(balance.qty);
return record;
},
async commit() { commit() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
// //
// //
if (this.scanCount == this.subList.length) { if (this.scanCount == this.subList.length) {
@ -369,109 +319,46 @@
} }
}, },
async submitJob() { submitJob() {
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
}); });
var itemCodes = []
this.detailSource.forEach(item => {
itemCodes.push(item.itemCode)
})
var param = {
itemCode: itemCodes,
locationCode: this.toLocationCode
}
var params = this.setParams(); var params = this.setParams();
console.log("提交" + JSON.stringify(params)) console.log("提交" + JSON.stringify(params))
inventoryMoveSubmit(this.id, params).then(res => {
uni.hideLoading()
if (res.data) {
var hint = res.data.Number;
this.showCommitSuccessMessage("提交成功" + hint, )
} else { // inventoryMoveSubmit(params).then(res => {
this.showErrorMessage("提交失败") // uni.hideLoading()
} // if (res.data) {
}).catch(error => { // this.showCommitSuccessMessage("<br>" + res.data)
uni.hideLoading() // } else {
this.showErrorMessage(error) // this.showErrorMessage(""+res.msg)
}) // }
// }).catch(error => {
// uni.hideLoading()
// this.showErrorMessage(error)
// })
}, },
setParams() { setParams() {
var params = { var subList = []
requestNumber: this.jobContent.requestNumber, var creator = this.$store.state.user.id
jobNumber: '',
asnNumber: this.jobContent.asnNumber,
ppNumber: this.jobContent.ppNumber,
supplierCode: this.jobContent.supplierCode,
carrierCode: this.jobContent.carrierCode,
transferMode: this.jobContent.transferMode,
vehiclePlateNumber: this.jobContent.vehiclePlateNumber,
fromWarehouseCode: this.jobContent.fromWarehouseCode,
fromLocationTypes: this.jobContent.fromLocationTypes,
fromAreaCodes: this.jobContent.fromAreaCodes,
toWarehouseCode: this.jobContent.toWarehouseCode,
toLocationTypes: this.jobContent.toLocationTypes,
status: this.jobContent.status,
toAreaCodes: this.jobContent.toAreaCodes,
executeTime: getCurrDateTime(),
activeDate: getCurrDateTime(),
available: 1, // 0,1
requestTime: this.jobContent.requestTime,
dueTime: getCurrDateTime(),
expiredTime: this.jobContent.expiredTime,
departmentCode: this.jobContent.departmentCode,
interfaceType: "jklxPURCHASE_RETURN", //
Number: this.jobContent.Number,
businessType: this.jobContent.businessType,
remark: this.jobContent.remark,
creationTime: this.jobContent.creationTime,
creatorId: this.jobContent.creatorId,
creatorName: this.jobContent.creatorName,
extraProperties: this.jobContent.extraProperties,
siteId: this.jobContent.siteId,
Code: "",
subList: [],
}
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
detail.record.fromPackingNumber = detail.record.packingNumber subList.push(detail)
detail.record.toPackingNumber = detail.record.packingNumber
detail.record.fromBatch = detail.record.batch
detail.record.ToBatch = detail.record.batch;
detail.record.FromContainerNumber = detail.record.ContainerNumber
detail.record.ToContainerNumber = ""
detail.record.FromLocationGroupCode = ""
detail.record.FromAreaCode = ""
detail.record.ToLocationGroupCode = "";
detail.record.ToAreaCode = "";
detail.record.VisualInspectResult = "",
detail.record.VisualInspectPhotos = "",
detail.record.FailedReason = ""
detail.record.SinglePrice = "",
detail.record.Amount = "",
detail.record.JobDetailID = detail.record.id,
detail.record.masterID = this.jobContent.id,
detail.record.projectCode = "",
detail.record.Code = ""
detail.record.interfaceType = "jklxPURCHASE_RETURN"
params.subList.push(detail.record)
} }
}) })
}) })
this.jobContent.subList = subList
return params; this.jobContent.creator = creator;
return this.jobContent;
}, },
getLocationInfo(locationCode) { getLocationInfo(locationCode) {
getBasicLocationByCode(locationCode).then(res => { getBasicLocationByCode(locationCode).then(res => {
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
@ -530,7 +417,7 @@
closeCommitMessage() { closeCommitMessage() {
setTimeout(() => { setTimeout(() => {
uni.navigateTo({ uni.navigateTo({
url: './receipt' url: './inventoryMoveJob'
}) })
}) })
// //
@ -540,13 +427,10 @@
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
})
setTimeout(() => {
uni.navigateTo({ uni.navigateTo({
url: './receiptJob' url: './inventoryMoveJob'
})
}) })
}, 3000)
}, },
} }

3
pages/issue/job/issueDetail.vue

@ -26,7 +26,7 @@
<script> <script>
import { import {
takeIssueJob takeIssueJob,
cancleTakeIssueJob, cancleTakeIssueJob,
getIssueJobDetail, getIssueJobDetail,
} from '@/api/request2.js'; } from '@/api/request2.js';
@ -134,7 +134,6 @@
mask: true mask: true
}); });
getIssueJobDetail(that.id).then(res => { getIssueJobDetail(that.id).then(res => {
debugger
uni.hideLoading(); uni.hideLoading();
if (res.data == null) { if (res.data == null) {
that.showMessage('未获取到详情'); that.showMessage('未获取到详情');

2
pages/productDismantle/job/productDismantleDetail.vue

@ -371,7 +371,6 @@
setParams() { setParams() {
var subList = [] var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id var creator = this.$store.state.user.id
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
@ -386,7 +385,6 @@
}) })
}) })
this.jobContent.subList = subList this.jobContent.subList = subList
this.jobContent.createTime = createTime;
this.jobContent.creator = creator; this.jobContent.creator = creator;
return this.jobContent; return this.jobContent;
}, },

2
pages/productReceipt/job/productReceiptDetail.vue

@ -213,6 +213,8 @@
}else { }else {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.handleQty = Number(result.label.qty); itemDetail.handleQty = Number(result.label.qty);
itemDetail.toLocationCode = this.toLocationCode;
itemDetail.labelQty = Number(result.label.qty);
this.calcHandleQty(); this.calcHandleQty();
} }

81
pages/productionReceipt/job/productionReceiptDetail.vue

@ -5,7 +5,8 @@
<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">
<view class=""> <view class="">
<com-detail-card :dataContent="item" :index="index" :settingParam="jobContent" <com-detail-card :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" @openDetail="openDetail"> @remove="updateData" @updateData="updateData" @openDetail="openDetail"
:locationTypeList='tolocationTypeList'>
</com-detail-card> </com-detail-card>
</view> </view>
<u-line /> <u-line />
@ -14,7 +15,7 @@
</view> </view>
<requiredLocation ref='comScanLocation' title="目标库位" :locationCode="toLocationCode" <requiredLocation ref='comScanLocation' title="目标库位" :locationCode="toLocationCode"
@getLocation='getToLocationCode' :isShowEdit="jobContent.allowModifyLocation == 1" @getLocation='scanLocationCode' :isShowEdit="jobContent.allowModifyLocation == 1"
:locationTypeList="tolocationTypeList"></requiredLocation> :locationTypeList="tolocationTypeList"></requiredLocation>
<view class="page-footer"> <view class="page-footer">
@ -244,7 +245,6 @@
}, },
getScanResult(result) { getScanResult(result) {
debugger
try { try {
var packingNumber = result.balance.packingNumber; var packingNumber = result.balance.packingNumber;
var batch = result.balance.batch; var batch = result.balance.batch;
@ -308,30 +308,58 @@
}, },
commit() { commit() {
if (this.toLocationCode == "") { this.scanCount = getScanCount(this.subList);
this.showMessage("请先选择目标库位") if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
return; return;
} }
//
if (!this.checkLocation()) {
return
}
// //
if (this.scanCount == this.subList.length) {
this.submitJob();
} else if (this.scanCount < this.subList.length) {
//
if (this.jobContent.allowPartialComplete == "TRUE") { if (this.jobContent.allowPartialComplete == "TRUE") {
//
this.submitJob(); this.submitJob();
} else { } else {
this.scanCount = this.getScanCount(); //
if (this.scanCount < this.subList.length) {
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交<br>' + "已经扫描[" + this.scanCount + this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交<br>' + "已经扫描[" + this.scanCount +
"]箱总共[" + this.subList.length + "]箱", res => { "]箱总共[" + this
.subList.length + "]箱", res => {
if (res) { if (res) {
this.openScanPopup(); this.openScanPopup();
} }
}); });
} else {
this.submitJob();
} }
} }
}, },
async submitJob() { checkLocation() {
var isPass = true;
if (this.toLocationCode == "" || this.toLocationCode == null) {
this.showMessageHint('请扫描目库位', callback => {
this.$refs.comScanLocation.showLocation();
})
return isPass = false;
}
return isPass;
},
showMessageHint(hint, callback) {
this.$refs.comMessage.showErrorMessage(hint, res => {
if (res) {
callback()
}
});
},
submitJob() {
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
@ -347,14 +375,12 @@
var params = this.setParams() var params = this.setParams()
console.log("提交参数",JSON.stringify(params)); console.log("提交参数",JSON.stringify(params));
// productionReceiptJobSubmit(this.id, params).then(res => { // productionReceiptJobSubmit(params).then(res => {
// uni.hideLoading() // uni.hideLoading()
// if (res.data) { // if (res.data) {
// var hint = res.data.Number; // this.showCommitSuccessMessage("<br>" + res.data)
// this.showCommitSuccessMessage("" + hint)
// } else { // } else {
// this.showErrorMessage("") // this.showErrorMessage(""+res.msg)
// } // }
// }).catch(error => { // }).catch(error => {
// uni.hideLoading() // uni.hideLoading()
@ -368,7 +394,6 @@
}, },
setParams() { setParams() {
var subList = [] var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id var creator = this.$store.state.user.id
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
@ -383,7 +408,6 @@
}) })
}) })
this.jobContent.subList = subList this.jobContent.subList = subList
this.jobContent.createTime = createTime;
this.jobContent.creator =creator; this.jobContent.creator =creator;
return this.jobContent; return this.jobContent;
}, },
@ -433,16 +457,15 @@
this.scanPopupGetFocus(); this.scanPopupGetFocus();
}, },
getToLocationCode(location, code) { scanLocationCode(location, code) {
if (this.fromLocationCode == code) { this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
this.$refs.comMessage.showMessage('来源库位[' + this.fromLocationCode + '] 不能与目标库位[' + code + '] 一致 ', this.toLocationCode = code
res => { this.detailSource.forEach(item => {
this.$refs.comScanLocation.showLocation(); item.subList.forEach(detail => {
}); detail.toLocationCode = code
} else { })
this.toLocationInfo = location; })
this.toLocationCode = code; })
}
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {

2
pages/productionReturn/job/returnDetail.vue

@ -379,7 +379,6 @@
setParams() { setParams() {
var subList = [] var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id var creator = this.$store.state.user.id
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
@ -394,7 +393,6 @@
}) })
}) })
this.jobContent.subList = subList this.jobContent.subList = subList
this.jobContent.createTime = createTime;
this.jobContent.creator =creator; this.jobContent.creator =creator;
return this.jobContent; return this.jobContent;
}, },

14
pages/repleinsh/job/repleinshDetail.vue

@ -401,7 +401,7 @@
checkLocation() { checkLocation() {
var isPass = true; var isPass = true;
if (this.toLocationCode == "" || this.toLocationCode == null) { if (this.toLocationCode == "" || this.toLocationCode == null) {
this.showMessageHint('请扫描收货库位', callback => { this.showMessageHint('请扫描目标库位', callback => {
this.$refs.comScanLocation.showLocation(); this.$refs.comScanLocation.showLocation();
}) })
@ -484,18 +484,6 @@
this.scanPopupGetFocus(); this.scanPopupGetFocus();
}, },
getToLocationCode(location, code) {
if (this.fromLocationCode == code) {
this.$refs.comMessage.showMessage('来源库位[' + this.fromLocationCode + '] 不能与目标库位[' + code + '] 一致 ',
res => {
this.$refs.comScanLocation.showLocation();
});
} else {
this.toLocationInfo = location;
this.toLocationCode = code;
}
},
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
uni.navigateTo({ uni.navigateTo({

Loading…
Cancel
Save