Browse Source

Merge branch 'master' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-uniapp

# Conflicts:
#	mycomponents/recommend/recommend.vue
wms3.0_pda
niexiting 1 year ago
parent
commit
de32199ca5
  1. 15
      api/request2.js
  2. 9
      mycomponents/detail/comDetailCard.vue
  3. 2
      mycomponents/detail/comRequestDetailCard.vue
  4. 2
      mycomponents/job/jobcomDetailCard.vue
  5. 2
      pages/count/coms/comCountDetailCard.vue
  6. 2
      pages/count/job/countDetail.vue
  7. 10
      pages/count/record/countRecord.vue
  8. 2
      pages/deliver/coms/comDeliverDetailCard.vue
  9. 2
      pages/inspect/coms/comInspectDetailCard.vue
  10. 4
      pages/inspect/coms/inspectComDetailCard.vue
  11. 16
      pages/inventoryMove/coms/comInventoryDetailCard.vue
  12. 1
      pages/inventoryMove/job/inventoryMoveDetail.vue
  13. 2
      pages/productDismantle/coms/comProductDetailCard.vue
  14. 11
      pages/productDismantle/job/productDismantleDetail.vue
  15. 13
      pages/productDismantle/record/productDismantleRecord.vue
  16. 2
      pages/productPutaway/coms/comProductDetailCard.vue
  17. 144
      pages/productPutaway/job/productPutawayDetail.vue
  18. 90
      pages/productReceipt/job/productReceiptDetail.vue
  19. 2
      pages/productionReceipt/coms/comProductionDetailCard.vue
  20. 17
      pages/productionReturn/job/returnDetail.vue
  21. 25
      pages/purchaseReceipt/job/receiptDetail.vue
  22. 72
      pages/purchaseReturn/job/returnDetail.vue
  23. 3
      pages/purchaseReturn/record/returnRecord.vue
  24. 95
      pages/putaway/job/putawayDetail.vue
  25. 33
      pages/putaway/record/putawayRecord.vue
  26. 79
      pages/repleinsh/job/repleinshDetail.vue
  27. 16
      pages/scrap/coms/comScrapDetailCard.vue
  28. 194
      pages/scrap/job/scrapJobDetail.vue
  29. 2
      pages/supplierDeliver/coms/comRecordDetailCard.vue
  30. 102
      pages/transfer/job/issueDetail.vue
  31. 96
      pages/transfer/job/receiptDetail.vue
  32. 2
      pages/unPlanned/coms/comIssueDetailCard.vue
  33. 54
      pages/unPlanned/coms/comReceiptDetailCard.vue
  34. 133
      pages/unPlanned/job/issueJobDetail.vue
  35. 163
      pages/unPlanned/job/receiptJobDetail.vue

15
api/request2.js

@ -856,7 +856,7 @@ export function cancleTakeProductionReceiptJob(id) {
/** /**
* 生产收料 提交 * 生产收料任务 提交
* @param {*} params * @param {*} params
*/ */
export function productionReceiptJobSubmit(params) { export function productionReceiptJobSubmit(params) {
@ -1422,6 +1422,19 @@ export function productDismantleJobSubmit(params) {
}); });
} }
/**
* 制品拆解 任务提交
* @param {*} 任务id
*
*/
export function productDismantleRecordSubmit(params) {
return request({
url: baseApi + "/wms/purchasereceipt-job-main/abandon",
method: "put",
data: params,
});
}
/** /**
* 制品发货 任务 * 制品发货 任务
* status 任务状态 * status 任务状态

9
mycomponents/detail/comDetailCard.vue

@ -37,7 +37,7 @@
} from '@/common/array.js'; } from '@/common/array.js';
export default { export default {
emits: ['openDetail'], emits: ['openDetail',"updateData"],
components: { components: {
itemCompareQty, itemCompareQty,
recommend, recommend,
@ -79,6 +79,7 @@
return { return {
option: [], option: [],
showItem: {}, showItem: {},
locatonItem:{},
editItem: {}, editItem: {},
detailOptions: [], detailOptions: [],
scanOptions: [] scanOptions: []
@ -101,6 +102,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)
} }
@ -131,6 +134,10 @@
this.editItem.qty = qty; this.editItem.qty = qty;
this.$emit('updateData') this.$emit('updateData')
}, },
showLocation(item) {
this.locatonItem = item;
this.$refs.scanLocationCode.openScanPopup();
},
// //
getLocation(location, code) { getLocation(location, code) {
this.locatonItem.toLocationCode =code; this.locatonItem.toLocationCode =code;

2
mycomponents/detail/comRequestDetailCard.vue

@ -15,7 +15,7 @@
<uni-swipe-action-item @click="swipeClick($event,item)" <uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions"> :right-options="item.scaned?scanOptions:detailOptions">
<recommend :detail="item" :record="item.record" :isShowPack="isShowPack" <recommend :detail="item" :record="item.record" :isShowPack="isShowPack"
:isShowBatch="isShowBatch" :isShowLocation="isShowLocation"></recommend> :isShowBatch="isShowBatch" :isShowFromLocation="isShowLocation"></recommend>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
<u-line /> <u-line />

2
mycomponents/job/jobcomDetailCard.vue

@ -12,7 +12,7 @@
<uni-swipe-action-item @click="swipeClick($event,item)" <uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions"> :right-options="item.scaned?scanOptions:detailOptions">
<recommend :detail="item" :record="item.record" :isShowPack="isShowPack" <recommend :detail="item" :record="item.record" :isShowPack="isShowPack"
:isShowBatch="isShowBatch" :isShowLocation="isShowLocation"></recommend> :isShowBatch="isShowBatch" :isShowFromLocation="isShowLocation"></recommend>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
</view> </view>

2
pages/count/coms/comCountDetailCard.vue

@ -14,7 +14,7 @@
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)" <uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions"> :right-options="item.scaned?scanOptions:detailOptions">
<recommend :detail="item" :record="item.record" :isShowLocation="false"></recommend> <recommend :detail="item" :isShowFromLocation="false"></recommend>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
<u-line color="#D8D8D8"></u-line> <u-line color="#D8D8D8"></u-line>

2
pages/count/job/countDetail.vue

@ -39,7 +39,7 @@
<script> <script>
import { import {
getCountJobDetail, getCountJobDetail,
takeCountJob takeCountJob,
cancleTakeCountJob, cancleTakeCountJob,
countJobSubmit countJobSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';

10
pages/count/record/countRecord.vue

@ -45,17 +45,15 @@
</template> </template>
<script> <script>
import {
getCountJobDetail,
getJobDetailStaging,
getBalanceByUniquecode,
} from '@/api/request.js';
import { import {
goHome, goHome,
getDirectoryItemArray,
getDataSource getDataSource
} from '@/common/basic.js'; } from '@/common/basic.js';
import {
getDirectoryItemArray
} from '@/common/directory.js';
import { import {
getBusinessType, getBusinessType,
} from '@/common/record.js'; } from '@/common/record.js';

2
pages/deliver/coms/comDeliverDetailCard.vue

@ -10,7 +10,7 @@
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)" <uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions"> :right-options="item.scaned?scanOptions:detailOptions">
<recommend :detail="item" :record="item.record"></recommend> <recommend :detail="item" ></recommend>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
</view> </view>

2
pages/inspect/coms/comInspectDetailCard.vue

@ -10,7 +10,7 @@
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item :right-options="item.scaned?scanOptions:detailOptions" <uni-swipe-action-item :right-options="item.scaned?scanOptions:detailOptions"
@click="swipeClick($event,item)"> @click="swipeClick($event,item)">
<recommend :detail="item" :record="item.record"></recommend> <recommend :detail="item" ></recommend>
<view :class="item.scaned?'scan_view':'' "> <view :class="item.scaned?'scan_view':'' ">
<view class="" style="font-size: 30rpx;"> <view class="" style="font-size: 30rpx;">
不合格数量 : {{item.FailedQty}} 不合格数量 : {{item.FailedQty}}

4
pages/inspect/coms/inspectComDetailCard.vue

@ -14,8 +14,8 @@
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item,index)" <uni-swipe-action-item @click="swipeClick($event,item,index)"
:right-options="item.scaned?scanOptions:detailOptions"> :right-options="item.scaned?scanOptions:detailOptions">
<recommend :detail="item" :record="item.record" :isShowPack="isShowPack" <recommend :detail="item" :isShowPack="isShowPack"
:isShowBatch="isShowBatch" :isShowLocation="isShowLocation"></recommend> :isShowBatch="isShowBatch" :isShowFromLocation="isShowLocation"></recommend>
<view v-if="item.failedQty>0||item.crackQty>0" :class="item.scaned?'scan_view':''" style="font-size: 32rpx;padding-left: 3rpx;"> <view v-if="item.failedQty>0||item.crackQty>0" :class="item.scaned?'scan_view':''" style="font-size: 32rpx;padding-left: 3rpx;">
<view class="" > <view class="" >
不合格数量 {{item.failedQty}} 不合格数量 {{item.failedQty}}

16
pages/inventoryMove/coms/comInventoryDetailCard.vue

@ -10,25 +10,17 @@
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item :right-options="item.scaned?scanOptions:detailOptions" <uni-swipe-action-item :right-options="item.scaned?scanOptions:detailOptions"
@click="swipeClick($event,item)"> @click="swipeClick($event,item)">
<!-- <view class="uni-row"> <!-- <view class="uni-row ">
<view class="location_view uni-inline-item">
<text class="card_location">库位</text>
<text style="margin-left: 10px">{{item.FromLocationCode}}</text>
<text class="card_location"> </text>
<text>{{item.toLocationCode}}</text>
</view>
</view> -->
<view class="uni-row ">
<view class="location_view uni-inline-item"> <view class="location_view uni-inline-item">
<text class="card_location">来源库位</text> <text class="card_location">来源库位</text>
<text style="margin-left: 10px">{{item.FromLocationCode}}</text> <text style="margin-left: 10px">{{item.fromLocationCode}}</text>
</view> </view>
<view class="location_view uni-inline-item"> <view class="location_view uni-inline-item">
<text class="card_location">目标库位</text> <text class="card_location">目标库位</text>
<text style="margin-right: 10px">{{item.toLocationCode}}</text> <text style="margin-right: 10px">{{item.toLocationCode}}</text>
</view> </view>
</view> </view> -->
<recommend :detail="item" :record="item.record" :isShowLocation="false"></recommend> <recommend :detail="item" :isShowFromLocation="true" :isShowToLocation="true"></recommend>
<u-line /> <u-line />
</uni-swipe-action-item> </uni-swipe-action-item>

1
pages/inventoryMove/job/inventoryMoveDetail.vue

@ -162,7 +162,6 @@
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 = that.getDataSource(that.subList)
updateTitle(this.jobContent.number);
} else { } else {
that.showMessage('列表数据为0'); that.showMessage('列表数据为0');
} }

2
pages/productDismantle/coms/comProductDetailCard.vue

@ -10,7 +10,7 @@
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)" <uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions"> :right-options="item.scaned?scanOptions:detailOptions">
<recommend :detail="item" :record="item.record"></recommend> <recommend :detail="item" ></recommend>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
</view> </view>

11
pages/productDismantle/job/productDismantleDetail.vue

@ -201,7 +201,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 {
@ -209,15 +209,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();

13
pages/productDismantle/record/productDismantleRecord.vue

@ -43,7 +43,7 @@
<script> <script>
import { import {
productDismantleRecordSubmit, productDismantleRecordSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
goHome, goHome,
@ -92,7 +92,7 @@
isShowPackingCode: true, isShowPackingCode: true,
scanCount: 0, scanCount: 0,
jobContent: {}, // jobContent: {}, //
subList: [], //subList detailList: [], //subList
detailSource: [], // detailSource: [], //
locationTypeList: [], locationTypeList: [],
toLocationInfo: {}, toLocationInfo: {},
@ -137,6 +137,7 @@
mounted() {}, mounted() {},
methods: { methods: {
getScanResult(result) { getScanResult(result) {
debugger
let balance = result.balance; let balance = result.balance;
let label = result.label; let label = result.label;
let pack = result.package; let pack = result.package;
@ -222,14 +223,8 @@
}, },
scanLocationCode(location, code) { scanLocationCode(location, code) {
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
this.toLocationCode = code this.toLocationCode = code
this.detailSource.forEach(item => { this.toLocationCode = location;
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
})
}, },

2
pages/productPutaway/coms/comProductDetailCard.vue

@ -10,7 +10,7 @@
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)" <uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions"> :right-options="item.scaned?scanOptions:detailOptions">
<recommend :detail="item" :record="item.record"></recommend> <recommend :detail="item" ></recommend>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
</view> </view>

144
pages/productPutaway/job/productPutawayDetail.vue

@ -6,7 +6,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 />
@ -15,7 +16,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">
@ -47,7 +48,7 @@
getBasicLocationByCode, getBasicLocationByCode,
getProductPutawayJobDetail, getProductPutawayJobDetail,
takeProductPutawayJob, takeProductPutawayJob,
cancleProductPutawayJob, cancleTakeProductPutawayJob,
productPutawayJobSubmit productPutawayJobSubmit
} 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'
@ -193,39 +195,6 @@
} }
}, },
createItemInfo(res) {
let item = {
itemCode: res.itemCode,
itemName: res.itemName,
stdPackQty: res.stdPackQty,
stdPackUnit: res.uom,
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() { calcHandleQty() {
calcHandleQty(this.detailSource); calcHandleQty(this.detailSource);
this.continueScan() this.continueScan()
@ -234,7 +203,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 {
@ -242,16 +211,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();
}, },
@ -319,7 +278,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();
@ -327,7 +291,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();
} }
} }
@ -350,30 +319,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
@ -383,25 +380,23 @@
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))
// productPutawayJobSubmit(this.id, params).then(res => { // productPutawayJobSubmit(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()
// this.showErrorMessage(error) // this.showErrorMessage(error)
// }) // })
} else { } else {
uni.hideLoading(); uni.hideLoading();
this.showErrorMessage(res.message); this.showErrorMessage(res.message);
@ -411,7 +406,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 => {
@ -426,7 +420,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;
}, },
@ -476,27 +469,12 @@
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) {
setTimeout(() => {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
})
uni.navigateTo({ uni.navigateTo({
url: './putawayJob' url: './putawayJob'
}) })
}, 3000) })
}, },
} }
} }

90
pages/productReceipt/job/productReceiptDetail.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="true" <com-detail-card :dataContent="item" :settingParam="jobContent" :isShowLocation="true"
@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 title="收货库位" :locationCode="toLocationCode" :isShowEdit="jobContent.allowModifyLocation=='TRUE'" <requiredLocation title="收货库位" :locationCode="toLocationCode" :isShowEdit="jobContent.allowModifyLocation=='TRUE'"
@getLocation='scanLocationCode' :locationTypeList="locationTypeList"></requiredLocation> @getLocation='scanLocationCode' :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"
@ -93,7 +94,7 @@
subList: [], //subList subList: [], //subList
detailSource: [], // detailSource: [], //
fromLocationTypeList: [], fromLocationTypeList: [],
locationTypeList: [], toLocationTypeList: [],
toLocationInfo: {}, toLocationInfo: {},
businessTypeInfo: {}, businessTypeInfo: {},
managementList: [] managementList: []
@ -176,8 +177,9 @@
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.toLocationCode = that.subList[0].toLocationCode
that.fromLocationTypeList = getDirectoryItemArray(that.jobContent.fromLocationTypes); that.fromLocationTypeList = getDirectoryItemArray(that.jobContent.fromLocationTypes);
that.locationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes) that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes)
that.detailSource = getDataSource(that.subList) that.detailSource = getDataSource(that.subList)
} else { } else {
that.showMessage('列表数据为0'); that.showMessage('列表数据为0');
@ -189,27 +191,6 @@
}) })
}, },
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;
},
getScanResult(result) { getScanResult(result) {
let label = result.label; let label = result.label;
var packingNumber = label.packingNumber; var packingNumber = label.packingNumber;
@ -255,15 +236,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();
@ -293,13 +265,38 @@
}) })
}, },
async commit() { checkLocation() {
if (this.toLocationCode == "") { var isPass = true;
this.showMessage("请先选择收货库位") 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()
}
});
},
commit() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
return; return;
} }
//
if (!this.checkLocation()) {
return
}
this.scanCount = this.getScanCount();
// //
if(this.scanCount == this.subList.length){ if(this.scanCount == this.subList.length){
this.submitJob(); this.submitJob();
@ -332,14 +329,12 @@
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));
// productReceiptJobsubmit(this.id, params).then(res => { // productReceiptJobsubmit(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()
@ -354,7 +349,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 => {
@ -369,7 +363,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;
}, },
@ -407,13 +400,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: './productReceiptJob'
})
}) })
}, 3000)
}, },
} }
} }

2
pages/productionReceipt/coms/comProductionDetailCard.vue

@ -10,7 +10,7 @@
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)" <uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions"> :right-options="item.scaned?scanOptions:detailOptions">
<recommend :detail="item" :record="item.record"></recommend> <recommend :detail="item" ></recommend>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
</view> </view>

17
pages/productionReturn/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" :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 />
@ -266,7 +267,11 @@
']不一致,是否继续上架?', 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();
@ -274,7 +279,11 @@
}); });
} 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();
} }
} }
@ -392,7 +401,7 @@
checkLocation() { checkLocation() {
var isPass = true; var isPass = true;
if (this.toLocationCode == "") { if (this.toLocationCode == ""||this.toLocationCode == null) {
this.showMessageHint('请扫描收货库位', callback => { this.showMessageHint('请扫描收货库位', callback => {
this.$refs.comScanLocation.showLocation(); this.$refs.comScanLocation.showLocation();
}) })

25
pages/purchaseReceipt/job/receiptDetail.vue

@ -60,7 +60,8 @@
import { import {
getDataSource, getDataSource,
createRecordInfo, createRecordInfo,
calcHandleQty calcHandleQty,
getScanCount
} from '@/common/detail.js'; } from '@/common/detail.js';
@ -225,7 +226,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 {
@ -233,16 +234,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() {
calcHandleQty(this.detailSource); calcHandleQty(this.detailSource);
}, },
@ -259,8 +250,8 @@
}, },
commit() { commit() {
this.scanCount = this.getScanCount(); this.scanCount = getScanCount(this.subList);
if (this.scanCount == 0) { if( this.scanCount==0){
this.showErrorMessage("扫描数为0,请先扫描") this.showErrorMessage("扫描数为0,请先扫描")
return; return;
} }
@ -313,7 +304,7 @@
purchaseReceiptJobSubmit(params).then(res => { purchaseReceiptJobSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成采购收货记录" + res.data, ) this.showCommitSuccessMessage("提交成功<br>生成采购收货记录" + res.data)
} else { } else {
this.showErrorMessage("提交失败" + res.msg) this.showErrorMessage("提交失败" + res.msg)
} }
@ -353,7 +344,7 @@
checkLocation() { checkLocation() {
var isPass = true; var isPass = true;
if (this.toLocationCode == "") { if (this.toLocationCode == ""||this.toLocationCode ==null) {
this.$refs.comMessage.showMessage('请扫描收货库位', res => { this.$refs.comMessage.showMessage('请扫描收货库位', res => {
if (res) { if (res) {
this.$refs.requiredLocation.showLocation(); this.$refs.requiredLocation.showLocation();
@ -436,11 +427,9 @@
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
setTimeout(() => {
uni.navigateTo({ uni.navigateTo({
url: './receiptJob' url: './receiptJob'
}) })
}, 3000)
}) })
}, },
} }

72
pages/purchaseReturn/job/returnDetail.vue

@ -313,91 +313,39 @@
title: "提交中....", title: "提交中....",
mask: true mask: true
}); });
//null,,
if (this.toLocationCode == null||this.toLocationCode == "") {
var params = this.setParams(false)
console.log("提交参数", JSON.stringify(params));
// purchaseReturnJobsubmit( params).then(res => {
// if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data, )
// } else {
// this.showErrorMessage(""+res.msg)
// }
// uni.hideLoading()
// }).catch(error => {
// uni.hideLoading()
// this.showErrorMessage(error)
// })
} else { var params =this.setParams()
var itemCodes = []
this.detailSource.forEach(item => {
itemCodes.push(item.itemCode)
})
//
getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams(true)
console.log("提交参数", JSON.stringify(params)); console.log("提交参数", JSON.stringify(params));
// purchaseReturnJobsubmit(params).then(res => {
// purchaseReturnJobsubmit( params).then(res => { // uni.hideLoading()
// if (res.data) { // if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data, ) // this.showCommitSuccessMessage("<br>退" + res.data, )
// } else { // } else {
// this.showErrorMessage(""+res.msg) // this.showErrorMessage(""+res.msg)
// } // }
// uni.hideLoading()
// }).catch(error => { // }).catch(error => {
// uni.hideLoading() // uni.hideLoading()
// this.showErrorMessage(error) // this.showErrorMessage(error)
// }) // })
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
});
}
}, },
setParams(queryModel) { 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 => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
var subItem = {}; // var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
Object.assign(subItem, detail) // detail.packingNumber, detail.batch);
if (queryModel) { // detail.toPackingNumber = info.packingNumber;
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, // detail.toBatch = info.batch;
detail.packingNumber, detail.batch); subList.push(detail)
subItem.package ="" ;
subItem.balance ="" ;
subItem.toPackingNumber = info.packingNumber;;
subItem.toContainerNumber = subItem.containerNumber
subItem.toBatch = info.batch;
subItem.toInventoryStatus = subItem.inventoryStatus
subItem.toLocationCode = this.toLocationCode
} else {
subItem.package ="" ;
subItem.balance ="" ;
subItem.toPackingNumber = subItem.packingNumber;
subItem.toContainerNumber = subItem.containerNumber
subItem.toBatch = subItem.toBatch;
subItem.toInventoryStatus = subItem.inventoryStatus
subItem.toLocationCode = ""
}
subList.push(subItem)
} }
}) })
}) })
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;
}, },

3
pages/purchaseReturn/record/returnRecord.vue

@ -81,8 +81,6 @@
fromLocationCode: "", fromLocationCode: "",
fromLocationInfo: {}, fromLocationInfo: {},
fromlocationTypeList: [], fromlocationTypeList: [],
toLocationCode: "",
toLocationInfo: {},
tolocationTypeList: [], tolocationTypeList: [],
inInventoryStatus: "", // inInventoryStatus: "", //
outInventoryStatus: "", // outInventoryStatus: "", //
@ -324,7 +322,6 @@
this.subList = []; this.subList = [];
this.detailSource = []; this.detailSource = [];
this.toLocationInfo = {} this.toLocationInfo = {}
this.toLocationCode = ''
}) })
} }
} }

95
pages/putaway/job/putawayDetail.vue

@ -6,7 +6,7 @@
<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='locationTypeList'> :locationTypeList='tolocationTypeList'>
</com-detail-card> </com-detail-card>
</view> </view>
<u-line /> <u-line />
@ -15,7 +15,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">
@ -285,11 +285,12 @@
']不一致,是否继续上架?', res => { ']不一致,是否继续上架?', res => {
if (res) { if (res) {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.handleQty = Number(result.label.qty)>Number(result.balance.qty)?Number(result.balance.qty):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 = result.balance;
itemDetail.balance.balanceQty = result.balance.qty; itemDetail.balance.balanceQty = result.balance.qty;
itemDetail.balance.stdPackQty =result.package.stdPackQty itemDetail.balance.stdPackQty = result.package.stdPackQty
itemDetail.balance.stdPackUnit =result.package.stdPackUnit itemDetail.balance.stdPackUnit = result.package.stdPackUnit
this.calcHandleQty(); this.calcHandleQty();
} else { } else {
this.scanPopupGetFocus(); this.scanPopupGetFocus();
@ -297,11 +298,12 @@
}); });
} else { } else {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.handleQty = Number(result.label.qty)>Number(result.balance.qty)?Number(result.balance.qty):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 = result.balance;
itemDetail.balance.balanceQty = result.balance.qty; itemDetail.balance.balanceQty = result.balance.qty;
itemDetail.balance.stdPackQty =result.package.stdPackQty itemDetail.balance.stdPackQty = result.package.stdPackQty
itemDetail.balance.stdPackUnit =result.package.stdPackUnit itemDetail.balance.stdPackUnit = result.package.stdPackUnit
this.calcHandleQty(); this.calcHandleQty();
} }
} }
@ -329,7 +331,7 @@
checkLocation() { checkLocation() {
var isPass = true; var isPass = true;
if (this.toLocationCode == "") { if (this.toLocationCode == "" || this.toLocationCode == null) {
this.showMessageHint('请扫描收货库位', callback => { this.showMessageHint('请扫描收货库位', callback => {
this.$refs.comScanLocation.showLocation(); this.$refs.comScanLocation.showLocation();
}) })
@ -384,41 +386,25 @@
mask: true mask: true
}); });
//null,,
if (this.toLocationCode == null || this.toLocationCode == "") {
var params = this.setParams(false)
console.log("提交参数", JSON.stringify(params));
// putawayJobSubmit( params).then(res => {
// if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data, )
// } else {
// this.showErrorMessage(""+res.msg)
// }
// uni.hideLoading()
// }).catch(error => {
// uni.hideLoading()
// this.showErrorMessage(error)
// })
} else {
var itemCodes = [] var itemCodes = []
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
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(true) var params = this.setParams()
console.log("提交参数", JSON.stringify(params)); console.log("提交参数", JSON.stringify(params));
// putawayJobSubmit( params).then(res => { // putawayJobSubmit(params).then(res => {
// uni.hideLoading()
// if (res.data) { // if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data, ) // this.showCommitSuccessMessage("<br>" + res.data)
// } else { // } else {
// this.showErrorMessage(""+res.msg) // this.showErrorMessage("" + res.msg)
// } // }
// uni.hideLoading()
// }).catch(error => { // }).catch(error => {
// uni.hideLoading() // uni.hideLoading()
// this.showErrorMessage(error) // this.showErrorMessage(error)
@ -428,46 +414,25 @@
this.showErrorMessage(res.message); this.showErrorMessage(res.message);
} }
}); });
}
}, },
setParams() {
setParams(queryModel) {
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 => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
var subItem = {};
Object.assign(subItem, detail)
if (queryModel) {
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
detail.packingNumber, detail.batch); detail.packingNumber, detail.batch);
subItem.package ="" ; detail.toPackingNumber = info.packingNumber;
subItem.balance ="" ; detail.toBatch = info.batch;
subItem.toPackingNumber = info.packingNumber;; subList.push(detail)
subItem.toContainerNumber = subItem.containerNumber
subItem.toBatch = info.batch;
subItem.toInventoryStatus = subItem.inventoryStatus
subItem.toLocationCode = this.toLocationCode
} else {
subItem.package ="" ;
subItem.balance ="" ;
subItem.toPackingNumber = subItem.packingNumber;
subItem.toContainerNumber = subItem.containerNumber
subItem.toBatch = subItem.toBatch;
subItem.toInventoryStatus = subItem.inventoryStatus
subItem.toLocationCode = ""
}
subList.push(subItem)
} }
}) })
}) })
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;
}, },
@ -518,27 +483,13 @@
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) {
setTimeout(() => {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
})
uni.navigateTo({ uni.navigateTo({
url: './putawayJob' url: './putawayJob'
}) })
}, 3000) })
}, },
} }
} }

33
pages/putaway/record/putawayRecord.vue

@ -304,39 +304,33 @@
setParams(queryModel) { setParams(queryModel) {
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 => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
var subItem = {}; // var subItem = {};
Object.assign(subItem, detail) // Object.assign(subItem, detail)
if (queryModel) { if (queryModel) {
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
detail.packingNumber, detail.batch); detail.packingNumber, detail.batch);
subItem.package ="" ; detail.toPackingNumber = info.packingNumber;;
subItem.balance ="" ; detail.toContainerNumber = detail.containerNumber
subItem.toPackingNumber = info.packingNumber;; detail.toBatch = info.batch;
subItem.toContainerNumber = subItem.containerNumber detail.toInventoryStatus = detail.inventoryStatus
subItem.toBatch = info.batch; detail.toLocationCode = this.toLocationCode
subItem.toInventoryStatus = subItem.inventoryStatus
subItem.toLocationCode = this.toLocationCode
} else { } else {
subItem.package ="" ; detail.toPackingNumber = detail.packingNumber;
subItem.balance ="" ; detail.toContainerNumber = detail.containerNumber
subItem.toPackingNumber = subItem.packingNumber; detail.toBatch = detail.toBatch;
subItem.toContainerNumber = subItem.containerNumber detail.toInventoryStatus = detail.inventoryStatus
subItem.toBatch = subItem.toBatch; detail.toLocationCode = ""
subItem.toInventoryStatus = subItem.inventoryStatus
subItem.toLocationCode = ""
} }
subList.push(subItem) subList.push(detail)
} }
}) })
}) })
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;
}, },
@ -382,7 +376,6 @@
}) })
return return
} }
this.ToLocationCodeInfo = location;
this.toLocationCode = code; this.toLocationCode = code;
}, },

79
pages/repleinsh/job/repleinshDetail.vue

@ -38,7 +38,6 @@
</template> </template>
<script> <script>
import { import {
getManagementPrecisions getManagementPrecisions
} from '@/common/balance.js'; } from '@/common/balance.js';
@ -286,11 +285,12 @@
']不一致,是否继续上架?', res => { ']不一致,是否继续上架?', res => {
if (res) { if (res) {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.handleQty = Number(result.label.qty)>Number(result.balance.qty)?Number(result.balance.qty):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 = result.balance;
itemDetail.balance.balanceQty = result.balance.qty; itemDetail.balance.balanceQty = result.balance.qty;
itemDetail.balance.stdPackQty =result.package.stdPackQty itemDetail.balance.stdPackQty = result.package.stdPackQty
itemDetail.balance.stdPackUnit =result.package.stdPackUnit itemDetail.balance.stdPackUnit = result.package.stdPackUnit
this.calcHandleQty(); this.calcHandleQty();
} else { } else {
this.scanPopupGetFocus(); this.scanPopupGetFocus();
@ -298,11 +298,12 @@
}); });
} else { } else {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.handleQty = Number(result.label.qty)>Number(result.balance.qty)?Number(result.balance.qty):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 = result.balance;
itemDetail.balance.balanceQty = result.balance.qty; itemDetail.balance.balanceQty = result.balance.qty;
itemDetail.balance.stdPackQty =result.package.stdPackQty itemDetail.balance.stdPackQty = result.package.stdPackQty
itemDetail.balance.stdPackUnit =result.package.stdPackUnit itemDetail.balance.stdPackUnit = result.package.stdPackUnit
this.calcHandleQty(); this.calcHandleQty();
} }
} }
@ -314,7 +315,7 @@
}, },
scanLocationCode(location, code) { scanLocationCode(location, code) {
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位["+code+"]", res => { this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
this.toLocationCode = code this.toLocationCode = code
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
@ -365,42 +366,25 @@
title: "提交中....", title: "提交中....",
mask: true mask: true
}); });
//null,,
if (this.toLocationCode == null || this.toLocationCode == "") {
var params = this.setParams(false)
console.log("提交参数", JSON.stringify(params));
// repleinshJobSubmit( params).then(res => {
// if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data, )
// } else {
// this.showErrorMessage(""+res.msg)
// }
// uni.hideLoading()
// }).catch(error => {
// uni.hideLoading()
// this.showErrorMessage(error)
// })
} else {
var itemCodes = [] var itemCodes = []
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
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(true) var params = this.setParams()
console.log("提交参数", JSON.stringify(params)); console.log("提交参数", JSON.stringify(params));
// repleinshJobSubmit( params).then(res => { // repleinshJobSubmit(params).then(res => {
// uni.hideLoading()
// if (res.data) { // if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data, ) // this.showCommitSuccessMessage("<br>" + res.data, )
// } else { // } else {
// this.showErrorMessage(""+res.msg) // this.showErrorMessage(""+res.msg)
// } // }
// uni.hideLoading()
// }).catch(error => { // }).catch(error => {
// uni.hideLoading() // uni.hideLoading()
// this.showErrorMessage(error) // this.showErrorMessage(error)
@ -410,13 +394,13 @@
this.showErrorMessage(res.message); this.showErrorMessage(res.message);
} }
}); });
}
}, },
checkLocation() { checkLocation() {
var isPass = true; var isPass = true;
if (this.toLocationCode == "") { if (this.toLocationCode == "" || this.toLocationCode == null) {
this.showMessageHint('请扫描收货库位', callback => { this.showMessageHint('请扫描收货库位', callback => {
this.$refs.comScanLocation.showLocation(); this.$refs.comScanLocation.showLocation();
}) })
@ -435,42 +419,22 @@
}, },
setParams(queryModel) { 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 => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
var subItem = {};
Object.assign(subItem, detail)
if (queryModel) {
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
detail.packingNumber, detail.batch); detail.packingNumber, detail.batch);
subItem.package ="" ; detail.toPackingNumber = info.packingNumber;
subItem.balance ="" ; detail.toBatch = info.batch;
subItem.toPackingNumber = info.packingNumber;; subList.push(detail)
subItem.toContainerNumber = subItem.containerNumber
subItem.toBatch = info.batch;
subItem.toInventoryStatus = subItem.inventoryStatus
subItem.toLocationCode = this.toLocationCode
} else {
subItem.package ="" ;
subItem.balance ="" ;
subItem.toPackingNumber = subItem.packingNumber;
subItem.toContainerNumber = subItem.containerNumber
subItem.toBatch = subItem.toBatch;
subItem.toInventoryStatus = subItem.inventoryStatus
subItem.toLocationCode = ""
}
subList.push(subItem)
} }
}) })
}) })
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;
}, },
@ -533,14 +497,11 @@
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
setTimeout(() => {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
})
uni.navigateTo({ uni.navigateTo({
url: './repleinshJob' url: './repleinshJob'
}) })
}, 3000) })
}, },
} }
} }

16
pages/scrap/coms/comScrapDetailCard.vue

@ -10,7 +10,7 @@
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)" <uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions"> :right-options="item.scaned?scanOptions:detailOptions">
<recommend :detail="item" :record="item.record" ></recommend> <recommend :detail="item" ></recommend>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
<u-line color="#D8D8D8"></u-line> <u-line color="#D8D8D8"></u-line>
@ -18,9 +18,7 @@
</uni-collapse-item> </uni-collapse-item>
</uni-collapse> </uni-collapse>
<recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam" <balance-qty-edit ref="qtyEdit" :settingParam="settingParam" @confirm="confirm"></balance-qty-edit>
:handleQty="editItem.record.qty" @confirm="confirm">
</recommend-qty-edit>
<scrap-detail-info-popup ref="jobDetailPopup" :dataContent="showItem"></scrap-detail-info-popup> <scrap-detail-info-popup ref="jobDetailPopup" :dataContent="showItem"></scrap-detail-info-popup>
<com-message ref="message"></com-message> <com-message ref="message"></com-message>
</view> </view>
@ -29,10 +27,10 @@
<script> <script>
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 recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
import jobDetailPopup from '@/mycomponents/detail/jobDetailPopup.vue' import jobDetailPopup from '@/mycomponents/detail/jobDetailPopup.vue'
import comMessage from '@/mycomponents/common/comMessage.vue' import comMessage from '@/mycomponents/common/comMessage.vue'
import scrapDetailInfoPopup from '@/pages/scrap/coms/scrapDetailInfoPopup.vue' import scrapDetailInfoPopup from '@/pages/scrap/coms/scrapDetailInfoPopup.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import { import {
getDetailOption, getDetailOption,
@ -44,10 +42,10 @@
components: { components: {
itemQty, itemQty,
recommend, recommend,
recommendQtyEdit,
jobDetailPopup, jobDetailPopup,
comMessage, comMessage,
scrapDetailInfoPopup scrapDetailInfoPopup,
balanceQtyEdit
}, },
props: { props: {
dataContent: { dataContent: {
@ -81,7 +79,7 @@
this.detailOptions = getDetailOption(); this.detailOptions = getDetailOption();
} }
if (this.scanOptions.length == 0) { if (this.scanOptions.length == 0) {
if (this.dataContent.allowModifyQty == 1) { if (this.settingParam.allowModifyQty == "TRUE") {
this.scanOptions = getDetailEditRemoveOption(); this.scanOptions = getDetailEditRemoveOption();
} else { } else {
this.scanOptions = getDetailRemoveOption(); this.scanOptions = getDetailRemoveOption();
@ -101,7 +99,7 @@
}, },
edit(item) { edit(item) {
this.editItem = item; this.editItem = item;
this.$refs.receiptEdit.openTaskEditPopup(item.qty, item.record.label.qty); this.$refs.qtyEdit.openEditPopup(item.balance, item.handleQty);
}, },
detail(item) { detail(item) {

194
pages/scrap/job/scrapJobDetail.vue

@ -13,10 +13,6 @@
</scroll-view> </scroll-view>
</view> </view>
<required-location ref="requiredLocation" title="目标库位" :locationCode="toLocationCode"
:isShowEdit="jobContent.allowModifyLocation=='TRUE'" @getLocation='scanLocationCode'
:locationTypeList="locationTypeList"></required-location>
<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"
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
@ -29,7 +25,7 @@
</view> </view>
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-pack ref="scanPopup" @getResult='getScanResult'></win-scan-pack> <win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location>
<com-message ref="comMessage"></com-message> <com-message ref="comMessage"></com-message>
</view> </view>
</template> </template>
@ -46,6 +42,7 @@
getCurrDateTime, getCurrDateTime,
getPackingNumberAndBatch, getPackingNumberAndBatch,
getDirectoryItemArray, getDirectoryItemArray,
getInventoryStatusName,
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
@ -54,25 +51,23 @@
import { import {
getDataSource, getDataSource,
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'
import winScanPack from '@/mycomponents/scan/winScanPack.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comMessage from '@/mycomponents/common/comMessage.vue' import comMessage from '@/mycomponents/common/comMessage.vue'
import comScrapDetailCard from '@/pages/scrap/coms/comScrapDetailCard.vue' import comScrapDetailCard from '@/pages/scrap/coms/comScrapDetailCard.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
export default { export default {
name: 'receipt_detail', name: 'receipt_detail',
components: { components: {
winScanButton, winScanButton,
winScanPack, winScanPack,
comScrapDetailCard, comScrapDetailCard,
requiredLocation, comMessage,
comMessage winScanPackAndLocation
}, },
data() { data() {
return { return {
@ -83,8 +78,6 @@
jobContent: {}, // jobContent: {}, //
subList: [], //subList subList: [], //subList
detailSource: [], // detailSource: [], //
locationTypeList: [],
toLocationCode: '',
toLocationInfo: {}, toLocationInfo: {},
businessTypeInfo: {}, businessTypeInfo: {},
managementList: [] managementList: []
@ -168,7 +161,6 @@
} else { } else {
if (res.data.subList.length > 0) { if (res.data.subList.length > 0) {
that.jobContent = res.data; that.jobContent = res.data;
that.locationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes);
that.subList = res.data.subList; that.subList = res.data.subList;
that.detailSource = getDataSource(that.subList) that.detailSource = getDataSource(that.subList)
} else { } else {
@ -184,49 +176,68 @@
getScanResult(result) { getScanResult(result) {
try { try {
var packingNumber = result.label.packingNumber; var packingNumber = result.balance.packingNumber;
var batch = result.label.batch; var batch = result.balance.batch;
var qty = result.label.qty; var qty = result.balance.qty;
var itemCode = result.label.itemCode; var itemCode = result.balance.itemCode;
var locationCode = result.balance.locationCode;
var inventoryStatus = result.balance.inventoryStatus;
var detail = this.detailSource.find(r => r.itemCode == itemCode); var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) { if (detail == undefined) {
this.showMessage("物料号【" + itemCode + "】不在列表中") this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else { } else {
var itemDetail = detail.subList.find(r => r.packingNumber == packingNumber && r.batch == batch); var itemDetail = detail.subList.find(r => {
return r.packingNumber == packingNumber &&
r.batch == batch
})
if (itemDetail == undefined) { if (itemDetail == undefined) {
this.showMessage("箱码【" + packingNumber + "】、批次【" + batch + "】不在列表中") this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]不在列表中")
} else { } else {
if (itemDetail.scaned) { if (itemDetail.scaned) {
this.showMessage("箱码" + packingNumber + "已经扫描") this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]已经扫描")
} else { } else {
let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus +
']不一致,是否继续上架?', res => {
if (res) {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.record = this.createRecordInfo(itemDetail, result.label); itemDetail.handleQty = Number(result.label.qty) > Number(result.balance
calcHandleQty(this.detailSource); .qty) ? Number(result.balance.qty) : Number(result.label.qty);
this.continueScan() itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = result.balance.qty;
itemDetail.balance.stdPackQty = result.package.stdPackQty
itemDetail.balance.stdPackUnit = result.package.stdPackUnit
this.calcHandleQty();
} else {
this.scanPopupGetFocus();
}
});
} else {
itemDetail.scaned = true;
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();
}
} }
} }
} }
} catch (e) { } catch (e) {
this.showErrorMessage(e.message) this.showMessage(e.message)
} }
}, },
createRecordInfo(detail, label) {
var record = {}
detail.scaned = true;
// let record = JSON.parse(JSON.stringify(detail));
//
Object.assign(record, detail)
record.qty = Number(label.qty);
record.toLocationCode = this.toLocationCode;
return record;
},
// //
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 {
@ -234,46 +245,35 @@
} }
}, },
getScanCount(closeScan) {
let items = this.subList.filter(r => {
if (r.scaned) {
return r;
}
})
let scanCount = items != null ? items.length : 0;
return scanCount;
},
updateData() { updateData() {
calcHandleQty(this.detailSource); calcHandleQty(this.detailSource);
}, },
scanLocationCode(location, code) { calcHandleQty() {
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => { calcHandleQty(this.detailSource)
this.toLocationCode = code this.continueScan()
this.detailSource.forEach(item => { this.$forceUpdate();
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
})
}, },
async commit() {
if (this.toLocationCode == "") { commit() {
this.$refs.comMessage.showMessage('请扫描收货库位', res => {
if (res) { this.scanCount = getScanCount(this.subList);
this.$refs.requiredLocation.showLocation(); if (this.scanCount == 0) {
} this.showErrorMessage("扫描数为0,请先扫描")
});
return; return;
} }
// //
if (this.jobContent.AllowPartialComplete == 1) { if (this.scanCount == this.subList.length) {
this.submitJob();
} else if (this.scanCount < this.subList.length) {
//
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 "]箱总共[" + this
.subList.length + "]箱", res => { .subList.length + "]箱", res => {
@ -281,69 +281,47 @@
this.openScanPopup(); this.openScanPopup();
} }
}); });
} else {
this.submitJob();
} }
} }
}, },
async submitJob() { submitJob() {
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
}); });
var itemCodes = [] //
this.detailSource.forEach(item => { var params = this.setParams()
itemCodes.push(item.itemCode) console.log("提交参数", JSON.stringify(params));
}) // scrapJobSubmit(params).then(res => {
getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) {
this.managementList = res.List;
var params = this.setParams();
// scrapJobSubmit(this.id, params).then(res => {
// uni.hideLoading() // uni.hideLoading()
// if (res.data) { // if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data.Number, ) // this.showCommitSuccessMessage("<br>" + res.data )
// } else { // } else {
// this.showErrorMessage("") // this.showErrorMessage(""+res.msg)
// } // }
// }).catch(error => { // }).catch(error => {
// uni.hideLoading() // uni.hideLoading()
// this.showErrorMessage(error) // this.showErrorMessage(error)
// }) // })
} else {
uni.hideLoading();
this.showErrorMessage('未获取到管理模式');
}
});
}, },
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 => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
detail.packingNumber, detail.batch);
detail.toPackingNumber = info.packingNumber;
detail.toBatch = info.batch;
subList.push(detail) subList.push(detail)
} }
}) })
}) })
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;
}, },
showMessage(message) { showMessage(message) {
setTimeout(r => { setTimeout(r => {
this.scanPopupLoseFocus(); this.scanPopupLoseFocus();
@ -367,7 +345,25 @@
}, },
openScanPopup() { openScanPopup() {
this.$refs.scanPopup.openScanPopup(); let fromlocationCode = '';
let fromlocationList = [];
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
item.subList.forEach(l => {
//
var location = fromlocationList.filter(res => res.fromLocationCode != l.fromLocationCode)
if (location.length == 0) {
fromlocationList.push(l.fromLocationCode);
}
//
if (fromlocationCode == '') {
if (!l.scaned) {
fromlocationCode = l.fromLocationCode;
}
}
})
}
this.$refs.scanPopup.openScanPopupForJob(fromlocationCode, fromlocationList, this.jobContent);
}, },
closeScanPopup() { closeScanPopup() {

2
pages/supplierDeliver/coms/comRecordDetailCard.vue

@ -10,7 +10,7 @@
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)" <uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="detailOptions"> :right-options="detailOptions">
<recommend :detail="item" :record="item.record" :isShowLocation="false"></recommend> <recommend :detail="item" :isShowFromLocation="false"></recommend>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
<u-line color="#D8D8D8"></u-line> <u-line color="#D8D8D8"></u-line>

102
pages/transfer/job/issueDetail.vue

@ -5,12 +5,16 @@
<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>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<requiredLocation ref='comScanLocation' title="目标库位" :locationCode="toLocationCode"
@getLocation='scanLocationCode' :isShowEdit="jobContent.allowModifyLocation == 'TRUE'"
: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"
@ -45,13 +49,15 @@
goHome, goHome,
getCurrDateTime, getCurrDateTime,
getPackingNumberAndBatch, getPackingNumberAndBatch,
getInventoryStatusName getInventoryStatusName,
getDirectoryItemArray
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
getDataSource, getDataSource,
createRecordInfo, createRecordInfo,
calcHandleQty calcHandleQty,
getScanCount
} from '@/common/detail.js'; } from '@/common/detail.js';
@ -80,6 +86,7 @@
jobContent: {}, // jobContent: {}, //
subList: [], //subList subList: [], //subList
detailSource: [], // detailSource: [], //
toLocationCode: "",
toLocationInfo: {}, toLocationInfo: {},
businessTypeInfo: {}, businessTypeInfo: {},
locationTypeList: [], locationTypeList: [],
@ -168,6 +175,10 @@
that.jobContent = res.data; that.jobContent = res.data;
that.subList = res.data.subList; that.subList = res.data.subList;
that.detailSource = getDataSource(that.subList) that.detailSource = getDataSource(that.subList)
that.fromLocationCode = that.subList[0].fromLocationCode
that.toLocationCode = that.subList[0].toLocationCode
that.tolocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes)
that.getLocationInfo(that.toLocationCode);
} else { } else {
that.showMessage('列表数据为0'); that.showMessage('列表数据为0');
} }
@ -220,7 +231,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 {
@ -228,15 +239,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();
@ -296,7 +298,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();
@ -304,7 +311,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,7 +328,17 @@
} }
}, },
async commit() { commit() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
//
if (!this.checkLocation()) {
return
}
// //
if (this.scanCount == this.subList.length) { if (this.scanCount == this.subList.length) {
this.submitJob(); this.submitJob();
@ -338,7 +360,7 @@
} }
}, },
async submitJob() { submitJob() {
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
@ -349,10 +371,6 @@
itemCodes.push(item.itemCode) itemCodes.push(item.itemCode)
}) })
var param = {
itemCode: itemCodes,
locationCode: this.toLocationCode
}
// //
getManagementPrecisions(itemCodes, this.toLocationCode, res => { getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) { if (res.success) {
@ -362,7 +380,7 @@
// transferIssueJobSubmit(this.id, params).then(res => { // transferIssueJobSubmit(this.id, params).then(res => {
// if (res.data) { // if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data.Number, ) // this.showCommitSuccessMessage("<br>" + res.data.Number )
// } else { // } else {
// this.showErrorMessage("") // this.showErrorMessage("")
// } // }
@ -380,7 +398,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 => {
@ -395,11 +412,41 @@
}) })
}) })
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()
}
});
},
scanLocationCode(location, code) {
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
})
},
getLocationInfo(locationCode) { getLocationInfo(locationCode) {
getBasicLocationByCode(locationCode).then(res => { getBasicLocationByCode(locationCode).then(res => {
@ -468,13 +515,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: './issueJob'
})
}) })
}, 3000)
}, },
} }

96
pages/transfer/job/receiptDetail.vue

@ -5,12 +5,16 @@
<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>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<requiredLocation ref='comScanLocation' title="目标库位" :locationCode="toLocationCode"
@getLocation='scanLocationCode' :isShowEdit="jobContent.allowModifyLocation == 'TRUE'"
: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"
@ -43,7 +47,8 @@
goHome, goHome,
getCurrDateTime, getCurrDateTime,
getPackingNumberAndBatch, getPackingNumberAndBatch,
getInventoryStatusName getInventoryStatusName,
getDirectoryItemArray
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
@ -53,7 +58,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'
@ -81,6 +87,7 @@
jobContent: {}, // jobContent: {}, //
subList: [], //subList subList: [], //subList
detailSource: [], // detailSource: [], //
toLocationCode: "",
toLocationInfo: {}, toLocationInfo: {},
businessTypeInfo: {}, businessTypeInfo: {},
locationTypeList: [], locationTypeList: [],
@ -170,6 +177,10 @@
that.jobContent = res.data; that.jobContent = res.data;
that.subList = res.data.subList; that.subList = res.data.subList;
that.detailSource = getDataSource(that.subList) that.detailSource = getDataSource(that.subList)
that.fromLocationCode = that.subList[0].fromLocationCode
that.toLocationCode = that.subList[0].toLocationCode
that.tolocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes)
that.getLocationInfo(that.toLocationCode);
} else { } else {
that.showMessage('列表数据为0'); that.showMessage('列表数据为0');
} }
@ -190,7 +201,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 {
@ -198,15 +209,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();
@ -266,7 +268,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();
@ -274,7 +281,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();
} }
} }
@ -286,8 +298,17 @@
} }
}, },
async commit() { commit() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
//
if (!this.checkLocation()) {
return
}
// //
if (this.scanCount == this.subList.length) { if (this.scanCount == this.subList.length) {
@ -311,7 +332,7 @@
}, },
async submitJob() { submitJob() {
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
@ -333,7 +354,6 @@
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));
// var params = this.getParams();
// transferReceiptJobSubmit(this.id, params).then(res => { // transferReceiptJobSubmit(this.id, params).then(res => {
// if (res.data) { // if (res.data) {
@ -355,7 +375,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 => {
@ -370,11 +389,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()
}
});
},
getLocationInfo(locationCode) { getLocationInfo(locationCode) {
getBasicLocationByCode(locationCode).then(res => { getBasicLocationByCode(locationCode).then(res => {
@ -384,6 +422,17 @@
}) })
}, },
scanLocationCode(location, code) {
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
})
},
showMessage(message) { showMessage(message) {
this.$refs.comMessage.showMessage(message, res => { this.$refs.comMessage.showMessage(message, res => {
if (res) { if (res) {
@ -441,18 +490,15 @@
uni.hideLoading(); uni.hideLoading();
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
})
setTimeout(() => {
uni.navigateTo({ uni.navigateTo({
url: './receiptJob' url: './receiptJob'
}) })
}, 3000) })
}, },
} }
} }
</script> </script>

2
pages/unPlanned/coms/comIssueDetailCard.vue

@ -10,7 +10,7 @@
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)" <uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions"> :right-options="item.scaned?scanOptions:detailOptions">
<recommend :detail="item" :record="item.record" :isShowLocation="isShowLocation"></recommend> <recommend :detail="item" :isShowFromLocation="isShowLocation"></recommend>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
<u-line color="#D8D8D8"></u-line> <u-line color="#D8D8D8"></u-line>

54
pages/unPlanned/coms/comReceiptDetailCard.vue

@ -10,23 +10,19 @@
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)" <uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions"> :right-options="item.scaned?scanOptions:detailOptions">
<recommend :detail="item" :record="item.record" :isShowLocation="false"> <recommend :detail="item" :isShowFromLocation="false" :isShowToLocation="true">
</recommend> </recommend>
<view :class="item.scaned?'scan_view':''">
<view class="location_view uni-inline-item">
<text class="card_location">入库库位</text>
<text>{{item.toLocationCode}}</text>
</view>
</view>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
<u-line color="#D8D8D8"></u-line> <u-line color="#D8D8D8"></u-line>
</view> </view>
</uni-collapse-item> </uni-collapse-item>
</uni-collapse> </uni-collapse>
<recommend-qty-edit ref="qtyEdit" :dataContent="editItem" :settingParam="settingParam" <recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam"
:handleQty="editItem.record.qty" @confirm="confirm"> @confirm="confirm">
</recommend-qty-edit> </recommend-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
:locationTypeList="locationTypeList"></win-scan-location>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup> <detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<comMessage ref="message"></comMessage> <comMessage ref="message"></comMessage>
</view> </view>
@ -39,11 +35,11 @@
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue' import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import comMessage from '@/mycomponents/common/comMessage.vue' import comMessage from '@/mycomponents/common/comMessage.vue'
import detailInfoPopup from '@/pages/unPlanned/coms/detailInfoPopup.vue' import detailInfoPopup from '@/pages/unPlanned/coms/detailInfoPopup.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 {
@ -52,7 +48,8 @@
recommend, recommend,
recommendQtyEdit, recommendQtyEdit,
detailInfoPopup, detailInfoPopup,
comMessage comMessage,
winScanLocation
}, },
props: { props: {
dataContent: { dataContent: {
@ -66,7 +63,11 @@
isShowLocation: { isShowLocation: {
type: Boolean, type: Boolean,
default: false default: false
} },
locationTypeList: {
type: Object,
default: {}
},
}, },
watch: { watch: {
@ -90,11 +91,7 @@
this.detailOptions = getDetailOption(); this.detailOptions = getDetailOption();
} }
if (this.scanOptions.length == 0) { if (this.scanOptions.length == 0) {
if (this.settingParam.allowModifyQty == 1) { this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty,this.settingParam.allowModifyLocation)
this.scanOptions = getDetailEditRemoveOption();
} else {
this.scanOptions = getDetailRemoveOption();
}
} }
}, },
@ -104,34 +101,43 @@
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)
} }
}, },
edit(item) { edit(item) {
this.editItem = item; this.editItem = item;
this.$refs.qtyEdit.openTaskEditPopup(item.qty, item.record.label.qty); this.$refs.receiptEdit.openTaskEditPopup(item.qty, item.handleQty,item.labelQty);
},
showLocation(item) {
this.locatonItem =item;
this.$refs.scanLocationCode.openScanPopup();
},
//
getLocation(location, code) {
this.locatonItem.toLocationCode =code;
this.$emit('updateData')
}, },
detail(item) { detail(item) {
this.showItem = item; this.showItem = item;
this.$refs.detailInfoPopup.openPopup(item); this.$refs.detailInfoPopup.openPopup(item)
}, },
remove(item) { remove(item) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?", this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => { res => {
if (res) { if (res) {
item.scaned = false item.scaned = false
item.record = {} item.handleQty = null
// 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.handleQty = qty;
this.$emit('updateData') this.$emit('updateData')
} }
} }

133
pages/unPlanned/job/issueJobDetail.vue

@ -46,7 +46,8 @@
goHome, goHome,
getCurrDateTime, getCurrDateTime,
getPackingNumberAndBatch, getPackingNumberAndBatch,
getDirectoryItemArray getDirectoryItemArray,
getInventoryStatusName,
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
@ -57,7 +58,6 @@
} from '@/common/detail.js'; } from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.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 comDetailCard from "@/mycomponents/detail/comDetailCard.vue" import comDetailCard from "@/mycomponents/detail/comDetailCard.vue"
@ -69,7 +69,6 @@
winScanButton, winScanButton,
winScanPackAndLocation, winScanPackAndLocation,
comMessage, comMessage,
requiredLocation,
comDetailCard, comDetailCard,
detailInfoPopup detailInfoPopup
}, },
@ -81,7 +80,6 @@
jobContent: {}, // jobContent: {}, //
subList: [], //subList subList: [], //subList
detailSource: [], // detailSource: [], //
locationTypeList: [],
businessTypeInfo: {}, businessTypeInfo: {},
managementList: [] managementList: []
}; };
@ -125,10 +123,10 @@
} }
}, },
// onPullDownRefresh() { onPullDownRefresh() {
// this.getDetail(); this.getDetail();
// uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
// }, },
mounted() { mounted() {
@ -158,10 +156,8 @@
} else { } else {
if (res.data.subList.length > 0) { if (res.data.subList.length > 0) {
that.jobContent = res.data; that.jobContent = res.data;
that.locationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes);
that.subList = res.data.subList; that.subList = res.data.subList;
that.detailSource = getDataSource(that.subList) that.detailSource = getDataSource(that.subList)
} else { } else {
that.showErrorMessage('列表数据为0'); that.showErrorMessage('列表数据为0');
} }
@ -173,27 +169,6 @@
}) })
}, },
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;
},
// //
continueScan() { continueScan() {
this.scanCount = getScanCount(this.subList); this.scanCount = getScanCount(this.subList);
@ -220,35 +195,69 @@
getScanResult(result) { getScanResult(result) {
try { try {
var packingNumber = result.label.packingNumber; var packingNumber = result.balance.packingNumber;
var batch = result.label.batch; var batch = result.balance.batch;
var qty = result.label.qty; var qty = result.balance.qty;
var itemCode = result.label.itemCode; var itemCode = result.balance.itemCode;
var locationCode = result.balance.locationCode;
var inventoryStatus = result.balance.inventoryStatus;
var detail = this.detailSource.find(r => r.itemCode == itemCode); var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) { if (detail == undefined) {
this.showMessage("物料号【" + itemCode + "】不在列表中") this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else { } else {
var itemDetail = detail.subList.find(r => r.packingNumber == packingNumber); var itemDetail = detail.subList.find(r => {
return r.packingNumber == packingNumber &&
r.batch == batch
})
if (itemDetail == undefined) { if (itemDetail == undefined) {
this.showMessage("箱码【" + packingNumber + "】不在列表中") this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]不在列表中")
} else { } else {
if (itemDetail.scaned) { if (itemDetail.scaned) {
this.showMessage("箱码" + packingNumber + "已经扫描") this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]已经扫描")
} else { } else {
let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus +
']不一致,是否继续上架?', 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 {
this.scanPopupGetFocus();
}
});
} else {
itemDetail.scaned = true;
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();
}
} }
} }
} }
} catch (e) { } catch (e) {
this.showErrorMessage(e.message) this.showMessage(e.message)
} }
}, },
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) {
this.submitJob(); this.submitJob();
@ -271,57 +280,40 @@
}, },
async submitJob() { submitJob() {
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
}); });
var itemCodes = [] //
this.detailSource.forEach(item => {
itemCodes.push(item.itemCode)
})
getManagementPrecisions(itemCodes,"", res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams() var params = this.setParams()
console.log("提交参数", JSON.stringify(params)); console.log("提交参数", JSON.stringify(params));
// unPlannedIssueJobSubmit(this.id, params).then(res => { // unPlannedIssueJobSubmit(params).then(res => {
// uni.hideLoading()
// if (res.data) { // if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data.Number, ) // this.showCommitSuccessMessage("<br>" + res.data )
// } else { // } else {
// this.showErrorMessage("") // this.showErrorMessage(""+res.msg)
// } // }
// uni.hideLoading()
// }).catch(error => { // }).catch(error => {
// uni.hideLoading() // uni.hideLoading()
// this.showErrorMessage(error) // this.showErrorMessage(error)
// }) // })
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
});
}, },
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 => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
detail.packingNumber, detail.batch);
detail.toPackingNumber = info.packingNumber;
detail.toBatch = info.batch;
subList.push(detail) subList.push(detail)
} }
}) })
}) })
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;
}, },
@ -400,13 +392,10 @@
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
})
setTimeout(() => {
uni.navigateTo({ uni.navigateTo({
url: './issueJob' url: './issueJob'
}) })
}, 3000) })
}, },
} }
} }

163
pages/unPlanned/job/receiptJobDetail.vue

@ -5,13 +5,17 @@
<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-receipt-detail-card :dataContent="item" :index="index" :settingParam="jobContent" <com-receipt-detail-card :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData"> @remove="updateData" @updateData="updateData" :locationTypeList='toLocationTypeList'>
</com-receipt-detail-card> </com-receipt-detail-card>
</view> </view>
<u-line /> <u-line />
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<required-location ref="requiredLocation" title="目标库位" :locationCode="toLocationCode"
:isShowEdit="jobContent.allowModifyLocation=='TRUE'" @getLocation='scanLocationCode'
:locationTypeList="toLocationTypeList"></required-location>
<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"
@ -38,7 +42,7 @@
import { import {
getUnPlannedReceiptJobDetail, getUnPlannedReceiptJobDetail,
cancleTakeUnPlannedReceiptJob, cancleTakeUnPlannedReceiptJob,
takeUnPlannedReceiptJob takeUnPlannedReceiptJob,
unPlannedReceiptJobSubmit unPlannedReceiptJobSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
@ -48,6 +52,13 @@
getDirectoryItemArray getDirectoryItemArray
} from '@/common/basic.js'; } from '@/common/basic.js';
import {
getDataSource,
createRecordInfo,
calcHandleQty,
getScanCount
} from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
@ -72,7 +83,7 @@
jobContent: {}, // jobContent: {}, //
subList: [], //subList subList: [], //subList
detailSource: [], // detailSource: [], //
locationTypeList: [], toLocationTypeList: [],
toLocationCode: '', toLocationCode: '',
toLocationInfo: {}, toLocationInfo: {},
businessTypeInfo: {}, businessTypeInfo: {},
@ -147,10 +158,10 @@
} else { } else {
if (res.data.subList.length > 0) { if (res.data.subList.length > 0) {
that.jobContent = res.data; that.jobContent = res.data;
// that.toLocationCode=that.jobContent.toLocationCode; that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes);
that.locationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes);
that.subList = res.data.subList; that.subList = res.data.subList;
that.detailSource = that.getDataSource(that.subList) this.toLocationCode = that.subList[0].toLocationCode
that.detailSource = getDataSource(that.subList)
} else { } else {
that.showErrorMessage('列表数据为0'); that.showErrorMessage('列表数据为0');
} }
@ -161,59 +172,22 @@
}) })
}, },
getDataSource(subList) { scanLocationCode(location, code) {
let items = []; this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
subList.forEach(detail => { this.toLocationCode = code
var item = items.find(r => this.detailSource.forEach(item => {
r.itemCode == detail.itemCode) item.subList.forEach(detail => {
if (item == undefined) { detail.toLocationCode = code
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;
},
getScanCount(closeScan) {
let items = this.subList.filter(r => {
if (r.scaned) {
return r;
}
})
let scanCount = items != null ? items.length : 0;
return scanCount;
},
// //
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 {
@ -221,34 +195,11 @@
} }
}, },
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();
},
updateData() { updateData() {
this.calcHandleQty(); calcHandleQty(this.detailSource);
}, },
createRecordInfo(detail, label) {
var record = {}
detail.scaned = true;
// let record = JSON.parse(JSON.stringify(detail));
//
Object.assign(record, detail)
record.qty = Number(label.qty);
record.toLocationCode = this.toLocationCode;
record.label = label;
return record;
},
getScanResult(result) { getScanResult(result) {
try { try {
@ -269,9 +220,11 @@
this.showMessage("箱码【" + packingNumber + "】已经扫描") this.showMessage("箱码【" + packingNumber + "】已经扫描")
} else { } else {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.record = this.createRecordInfo(itemDetail, result.label); itemDetail.handleQty = Number(result.label.qty);
itemDetail.toLocationCode = this.toLocationCode;
this.calcHandleQty(); itemDetail.labelQty = Number(result.label.qty);
calcHandleQty(this.detailSource);
this.continueScan()
} }
} }
} }
@ -281,18 +234,16 @@
} }
}, },
scanLocationCode(location, code) { commit() {
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => { this.scanCount = getScanCount(this.subList);
this.toLocationCode = code if( this.scanCount==0){
this.detailSource.forEach(item => { this.showErrorMessage("扫描数为0,请先扫描")
item.subList.forEach(detail => { return;
detail.toLocationCode = code }
}) //
}) if (!this.checkLocation()) {
}) return
}, }
async commit() {
// //
if (this.scanCount == this.subList.length) { if (this.scanCount == this.subList.length) {
this.submitJob(); this.submitJob();
@ -314,8 +265,28 @@
} }
}, },
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()
}
});
},
async submitJob() { submitJob() {
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
@ -325,14 +296,14 @@
itemCodes.push(item.itemCode) itemCodes.push(item.itemCode)
}) })
getManagementPrecisions(itemCodes,"", 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));
// unPlannedReceiptJobSubmit(this.id, params).then(res => { // unPlannedReceiptJobSubmit(params).then(res => {
// if (res.data) { // if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data.Number, ) // this.showCommitSuccessMessage("<br>" + res.data)
// } else { // } else {
// this.showErrorMessage("") // this.showErrorMessage("")
// } // }
@ -350,7 +321,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 => {
@ -365,7 +335,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;
}, },

Loading…
Cancel
Save