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
*/
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 任务状态

9
mycomponents/detail/comDetailCard.vue

@ -37,7 +37,7 @@
} from '@/common/array.js';
export default {
emits: ['openDetail'],
emits: ['openDetail',"updateData"],
components: {
itemCompareQty,
recommend,
@ -79,6 +79,7 @@
return {
option: [],
showItem: {},
locatonItem:{},
editItem: {},
detailOptions: [],
scanOptions: []
@ -101,6 +102,8 @@
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "库位") {
this.showLocation(item)
} else if (e.content.text == "移除") {
this.remove(item)
}
@ -131,6 +134,10 @@
this.editItem.qty = qty;
this.$emit('updateData')
},
showLocation(item) {
this.locatonItem = item;
this.$refs.scanLocationCode.openScanPopup();
},
//
getLocation(location, code) {
this.locatonItem.toLocationCode =code;

2
mycomponents/detail/comRequestDetailCard.vue

@ -15,7 +15,7 @@
<uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions">
<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>
<u-line />

2
mycomponents/job/jobcomDetailCard.vue

@ -12,7 +12,7 @@
<uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions">
<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>
</view>

2
pages/count/coms/comCountDetailCard.vue

@ -14,7 +14,7 @@
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)"
: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>
<u-line color="#D8D8D8"></u-line>

2
pages/count/job/countDetail.vue

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

10
pages/count/record/countRecord.vue

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

2
pages/deliver/coms/comDeliverDetailCard.vue

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

2
pages/inspect/coms/comInspectDetailCard.vue

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

4
pages/inspect/coms/inspectComDetailCard.vue

@ -14,8 +14,8 @@
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item,index)"
:right-options="item.scaned?scanOptions:detailOptions">
<recommend :detail="item" :record="item.record" :isShowPack="isShowPack"
:isShowBatch="isShowBatch" :isShowLocation="isShowLocation"></recommend>
<recommend :detail="item" :isShowPack="isShowPack"
: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 class="" >
不合格数量 {{item.failedQty}}

16
pages/inventoryMove/coms/comInventoryDetailCard.vue

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

1
pages/inventoryMove/job/inventoryMoveDetail.vue

@ -162,7 +162,6 @@
that.jobContent = res.data;
that.subList = res.data.subList;
that.detailSource = that.getDataSource(that.subList)
updateTitle(this.jobContent.number);
} else {
that.showMessage('列表数据为0');
}

2
pages/productDismantle/coms/comProductDetailCard.vue

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

11
pages/productDismantle/job/productDismantleDetail.vue

@ -201,7 +201,7 @@
//
continueScan() {
this.scanCount = this.getScanCount();
this.scanCount = getScanCount(this.subList);
if (this.scanCount == this.subList.length) {
this.closeScanPopup();
} 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() {
this.calcHandleQty();

13
pages/productDismantle/record/productDismantleRecord.vue

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

2
pages/productPutaway/coms/comProductDetailCard.vue

@ -10,7 +10,7 @@
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions">
<recommend :detail="item" :record="item.record"></recommend>
<recommend :detail="item" ></recommend>
</uni-swipe-action-item>
</uni-swipe-action>
</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="">
<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>
</view>
<u-line />
@ -15,7 +16,7 @@
</view>
<requiredLocation ref='comScanLocation' title="目标库位" :locationCode="toLocationCode"
@getLocation='getToLocationCode' :isShowEdit="jobContent.allowModifyLocation == 1"
@getLocation='scanLocationCode' :isShowEdit="jobContent.allowModifyLocation == 1"
:locationTypeList="tolocationTypeList"></requiredLocation>
<view class="page-footer">
@ -47,7 +48,7 @@
getBasicLocationByCode,
getProductPutawayJobDetail,
takeProductPutawayJob,
cancleProductPutawayJob,
cancleTakeProductPutawayJob,
productPutawayJobSubmit
} from '@/api/request2.js';
@ -64,7 +65,8 @@
import {
getDataSource,
createRecordInfo,
calcHandleQty
calcHandleQty,
getScanCount
} from '@/common/detail.js';
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(this.detailSource);
this.continueScan()
@ -234,7 +203,7 @@
//
continueScan() {
this.scanCount = this.getScanCount();
this.scanCount = getScanCount(this.subList);
if (this.scanCount == this.subList.length) {
this.closeScanPopup();
} 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() {
this.calcHandleQty();
},
@ -319,7 +278,12 @@
']不一致,是否继续上架?', res => {
if (res) {
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();
} else {
this.scanPopupGetFocus();
@ -327,7 +291,12 @@
});
} else {
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();
}
}
@ -350,30 +319,58 @@
},
commit() {
if (this.toLocationCode == "") {
this.showMessage("请先选择目标库位")
this.scanCount = getScanCount(this.subList);
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
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") {
//
this.submitJob();
} else {
this.scanCount = this.getScanCount();
if (this.scanCount < this.subList.length) {
//
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交<br>' + "已经扫描[" + this.scanCount +
"]箱总共[" + this.subList.length + "]箱", res => {
"]箱总共[" + this
.subList.length + "]箱", res => {
if (res) {
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({
title: "提交中....",
mask: true
@ -383,25 +380,23 @@
itemCodes.push(item.itemCode)
})
getManagementPrecisions(itemCodes,this.toLocationCode, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams();
console.log("提交" + JSON.stringify(params))
// productPutawayJobSubmit(this.id, params).then(res => {
// productPutawayJobSubmit(params).then(res => {
// uni.hideLoading()
// if (res.data) {
// var hint = res.data.Number;
// this.showCommitSuccessMessage("" + hint)
// this.showCommitSuccessMessage("<br>" + res.data)
// } else {
// this.showErrorMessage("")
// this.showErrorMessage(""+res.msg)
// }
// }).catch(error => {
// uni.hideLoading()
// this.showErrorMessage(error)
// })
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
@ -411,7 +406,6 @@
setParams() {
var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
@ -426,7 +420,6 @@
})
})
this.jobContent.subList = subList
this.jobContent.createTime = createTime;
this.jobContent.creator =creator;
return this.jobContent;
},
@ -476,27 +469,12 @@
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) {
setTimeout(() => {
this.$refs.comMessage.showSuccessMessage(hint, res => {
})
uni.navigateTo({
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="">
<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>
</view>
<u-line />
@ -14,7 +15,7 @@
</view>
<requiredLocation title="收货库位" :locationCode="toLocationCode" :isShowEdit="jobContent.allowModifyLocation=='TRUE'"
@getLocation='scanLocationCode' :locationTypeList="locationTypeList"></requiredLocation>
@getLocation='scanLocationCode' :locationTypeList="tolocationTypeList"></requiredLocation>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
@ -93,7 +94,7 @@
subList: [], //subList
detailSource: [], //
fromLocationTypeList: [],
locationTypeList: [],
toLocationTypeList: [],
toLocationInfo: {},
businessTypeInfo: {},
managementList: []
@ -176,8 +177,9 @@
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.subList = res.data.subList;
that.toLocationCode = that.subList[0].toLocationCode
that.fromLocationTypeList = getDirectoryItemArray(that.jobContent.fromLocationTypes);
that.locationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes)
that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes)
that.detailSource = getDataSource(that.subList)
} else {
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) {
let label = result.label;
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() {
this.calcHandleQty();
@ -293,13 +265,38 @@
})
},
async commit() {
if (this.toLocationCode == "") {
this.showMessage("请先选择收货库位")
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()
}
});
},
commit() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
return;
}
//
if (!this.checkLocation()) {
return
}
this.scanCount = this.getScanCount();
//
if(this.scanCount == this.subList.length){
this.submitJob();
@ -332,14 +329,12 @@
this.managementList = res.list;
var params = this.setParams();
console.log("提交参数",JSON.stringify(params));
// productReceiptJobsubmit(this.id, params).then(res => {
// productReceiptJobsubmit(params).then(res => {
// uni.hideLoading()
// if (res.data) {
// var hint = res.data.Number;
// this.showCommitSuccessMessage("" + hint, )
// this.showCommitSuccessMessage("<br>" + res.data, )
// } else {
// this.showErrorMessage("")
// this.showErrorMessage(""+res.msg)
// }
// }).catch(error => {
// uni.hideLoading()
@ -354,7 +349,6 @@
setParams() {
var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
@ -369,7 +363,6 @@
})
})
this.jobContent.subList = subList
this.jobContent.createTime = createTime;
this.jobContent.creator =creator;
return this.jobContent;
},
@ -407,13 +400,10 @@
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
})
setTimeout(() => {
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-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions">
<recommend :detail="item" :record="item.record"></recommend>
<recommend :detail="item" ></recommend>
</uni-swipe-action-item>
</uni-swipe-action>
</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="">
<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>
</view>
<u-line />
@ -266,7 +267,11 @@
']不一致,是否继续上架?', res => {
if (res) {
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();
} else {
this.scanPopupGetFocus();
@ -274,7 +279,11 @@
});
} else {
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();
}
}
@ -392,7 +401,7 @@
checkLocation() {
var isPass = true;
if (this.toLocationCode == "") {
if (this.toLocationCode == ""||this.toLocationCode == null) {
this.showMessageHint('请扫描收货库位', callback => {
this.$refs.comScanLocation.showLocation();
})

25
pages/purchaseReceipt/job/receiptDetail.vue

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

72
pages/purchaseReturn/job/returnDetail.vue

@ -313,91 +313,39 @@
title: "提交中....",
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 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)
var params =this.setParams()
console.log("提交参数", JSON.stringify(params));
// purchaseReturnJobsubmit( params).then(res => {
// purchaseReturnJobsubmit(params).then(res => {
// uni.hideLoading()
// if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data, )
// this.showCommitSuccessMessage("<br>退" + res.data, )
// } else {
// this.showErrorMessage(""+res.msg)
// }
// uni.hideLoading()
// }).catch(error => {
// uni.hideLoading()
// this.showErrorMessage(error)
// })
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
});
}
},
setParams(queryModel) {
setParams() {
var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var subItem = {};
Object.assign(subItem, detail)
if (queryModel) {
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
detail.packingNumber, detail.batch);
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)
// var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
// detail.packingNumber, detail.batch);
// detail.toPackingNumber = info.packingNumber;
// detail.toBatch = info.batch;
subList.push(detail)
}
})
})
this.jobContent.subList = subList
this.jobContent.createTime = createTime;
this.jobContent.creator = creator;
return this.jobContent;
},

3
pages/purchaseReturn/record/returnRecord.vue

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

95
pages/putaway/job/putawayDetail.vue

@ -6,7 +6,7 @@
<view class="">
<com-detail-card :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData" @openDetail="openDetail"
:locationTypeList='locationTypeList'>
:locationTypeList='tolocationTypeList'>
</com-detail-card>
</view>
<u-line />
@ -15,7 +15,7 @@
</view>
<requiredLocation ref='comScanLocation' title="目标库位" :locationCode="toLocationCode"
@getLocation='getToLocationCode' :isShowEdit="jobContent.allowModifyLocation == 'TRUE'"
@getLocation='scanLocationCode' :isShowEdit="jobContent.allowModifyLocation == 'TRUE'"
:locationTypeList="tolocationTypeList"></requiredLocation>
<view class="page-footer">
@ -285,11 +285,12 @@
']不一致,是否继续上架?', res => {
if (res) {
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.balanceQty = result.balance.qty;
itemDetail.balance.stdPackQty =result.package.stdPackQty
itemDetail.balance.stdPackUnit =result.package.stdPackUnit
itemDetail.balance.stdPackQty = result.package.stdPackQty
itemDetail.balance.stdPackUnit = result.package.stdPackUnit
this.calcHandleQty();
} else {
this.scanPopupGetFocus();
@ -297,11 +298,12 @@
});
} else {
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.balanceQty = result.balance.qty;
itemDetail.balance.stdPackQty =result.package.stdPackQty
itemDetail.balance.stdPackUnit =result.package.stdPackUnit
itemDetail.balance.stdPackQty = result.package.stdPackQty
itemDetail.balance.stdPackUnit = result.package.stdPackUnit
this.calcHandleQty();
}
}
@ -329,7 +331,7 @@
checkLocation() {
var isPass = true;
if (this.toLocationCode == "") {
if (this.toLocationCode == "" || this.toLocationCode == null) {
this.showMessageHint('请扫描收货库位', callback => {
this.$refs.comScanLocation.showLocation();
})
@ -384,41 +386,25 @@
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 = []
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)
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
// putawayJobSubmit( params).then(res => {
// putawayJobSubmit(params).then(res => {
// uni.hideLoading()
// if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data, )
// this.showCommitSuccessMessage("<br>" + res.data)
// } else {
// this.showErrorMessage(""+res.msg)
// this.showErrorMessage("" + res.msg)
// }
// uni.hideLoading()
// }).catch(error => {
// uni.hideLoading()
// this.showErrorMessage(error)
@ -428,46 +414,25 @@
this.showErrorMessage(res.message);
}
});
}
},
setParams(queryModel) {
setParams() {
var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var subItem = {};
Object.assign(subItem, detail)
if (queryModel) {
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
detail.packingNumber, detail.batch);
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)
detail.toPackingNumber = info.packingNumber;
detail.toBatch = info.batch;
subList.push(detail)
}
})
})
this.jobContent.subList = subList
this.jobContent.createTime = createTime;
this.jobContent.creator = creator;
return this.jobContent;
},
@ -518,27 +483,13 @@
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) {
setTimeout(() => {
this.$refs.comMessage.showSuccessMessage(hint, res => {
})
uni.navigateTo({
url: './putawayJob'
})
}, 3000)
})
},
}
}

33
pages/putaway/record/putawayRecord.vue

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

79
pages/repleinsh/job/repleinshDetail.vue

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

16
pages/scrap/coms/comScrapDetailCard.vue

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

194
pages/scrap/job/scrapJobDetail.vue

@ -13,10 +13,6 @@
</scroll-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="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
@ -29,7 +25,7 @@
</view>
<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>
</view>
</template>
@ -46,6 +42,7 @@
getCurrDateTime,
getPackingNumberAndBatch,
getDirectoryItemArray,
getInventoryStatusName,
} from '@/common/basic.js';
import {
@ -54,25 +51,23 @@
import {
getDataSource,
createRecordInfo,
calcHandleQty
calcHandleQty,
getScanCount
} from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import comScrapDetailCard from '@/pages/scrap/coms/comScrapDetailCard.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
export default {
name: 'receipt_detail',
components: {
winScanButton,
winScanPack,
comScrapDetailCard,
requiredLocation,
comMessage
comMessage,
winScanPackAndLocation
},
data() {
return {
@ -83,8 +78,6 @@
jobContent: {}, //
subList: [], //subList
detailSource: [], //
locationTypeList: [],
toLocationCode: '',
toLocationInfo: {},
businessTypeInfo: {},
managementList: []
@ -168,7 +161,6 @@
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.locationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes);
that.subList = res.data.subList;
that.detailSource = getDataSource(that.subList)
} else {
@ -184,49 +176,68 @@
getScanResult(result) {
try {
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var itemCode = result.label.itemCode;
var packingNumber = result.balance.packingNumber;
var batch = result.balance.batch;
var qty = result.balance.qty;
var itemCode = result.balance.itemCode;
var locationCode = result.balance.locationCode;
var inventoryStatus = result.balance.inventoryStatus;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showMessage("物料号【" + itemCode + "】不在列表中")
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} 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) {
this.showMessage("箱码【" + packingNumber + "】、批次【" + batch + "】不在列表中")
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]不在列表中")
} else {
if (itemDetail.scaned) {
this.showMessage("箱码" + packingNumber + "已经扫描")
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]已经扫描")
} 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.record = this.createRecordInfo(itemDetail, result.label);
calcHandleQty(this.detailSource);
this.continueScan()
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();
} 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) {
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() {
this.scanCount = this.getScanCount();
this.scanCount = getScanCount(this.subList);
if (this.scanCount == this.subList.length) {
this.closeScanPopup();
} 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() {
calcHandleQty(this.detailSource);
},
scanLocationCode(location, code) {
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
})
calcHandleQty() {
calcHandleQty(this.detailSource)
this.continueScan()
this.$forceUpdate();
},
async commit() {
if (this.toLocationCode == "") {
this.$refs.comMessage.showMessage('请扫描收货库位', res => {
if (res) {
this.$refs.requiredLocation.showLocation();
}
});
commit() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
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();
} else {
this.scanCount = this.getScanCount();
if (this.scanCount < this.subList.length) {
//
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交<br>' + "已经扫描[" + this.scanCount +
"]箱总共[" + this
.subList.length + "]箱", res => {
@ -281,69 +281,47 @@
this.openScanPopup();
}
});
} else {
this.submitJob();
}
}
},
async submitJob() {
submitJob() {
uni.showLoading({
title: "提交中....",
mask: true
});
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();
// scrapJobSubmit(this.id, params).then(res => {
//
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
// scrapJobSubmit(params).then(res => {
// uni.hideLoading()
// if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data.Number, )
// this.showCommitSuccessMessage("<br>" + res.data )
// } else {
// this.showErrorMessage("")
// this.showErrorMessage(""+res.msg)
// }
// }).catch(error => {
// uni.hideLoading()
// this.showErrorMessage(error)
// })
} else {
uni.hideLoading();
this.showErrorMessage('未获取到管理模式');
}
});
},
setParams() {
var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
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)
}
})
})
this.jobContent.subList = subList
this.jobContent.createTime = createTime;
this.jobContent.creator = creator;
return this.jobContent;
},
showMessage(message) {
setTimeout(r => {
this.scanPopupLoseFocus();
@ -367,7 +345,25 @@
},
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() {

2
pages/supplierDeliver/coms/comRecordDetailCard.vue

@ -10,7 +10,7 @@
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)"
: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>
<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="">
<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>
</view>
</view>
</scroll-view>
</view>
<requiredLocation ref='comScanLocation' title="目标库位" :locationCode="toLocationCode"
@getLocation='scanLocationCode' :isShowEdit="jobContent.allowModifyLocation == 'TRUE'"
:locationTypeList="tolocationTypeList"></requiredLocation>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
@ -45,13 +49,15 @@
goHome,
getCurrDateTime,
getPackingNumberAndBatch,
getInventoryStatusName
getInventoryStatusName,
getDirectoryItemArray
} from '@/common/basic.js';
import {
getDataSource,
createRecordInfo,
calcHandleQty
calcHandleQty,
getScanCount
} from '@/common/detail.js';
@ -80,6 +86,7 @@
jobContent: {}, //
subList: [], //subList
detailSource: [], //
toLocationCode: "",
toLocationInfo: {},
businessTypeInfo: {},
locationTypeList: [],
@ -168,6 +175,10 @@
that.jobContent = res.data;
that.subList = res.data.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 {
that.showMessage('列表数据为0');
}
@ -220,7 +231,7 @@
//
continueScan() {
this.scanCount = this.getScanCount();
this.scanCount = getScanCount(this.subList);
if (this.scanCount == this.subList.length) {
this.closeScanPopup();
} 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() {
this.calcHandleQty();
@ -296,7 +298,12 @@
']不一致,是否继续上架?', res => {
if (res) {
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();
} else {
this.scanPopupGetFocus();
@ -304,7 +311,12 @@
});
} else {
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();
}
}
@ -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) {
this.submitJob();
@ -338,7 +360,7 @@
}
},
async submitJob() {
submitJob() {
uni.showLoading({
title: "提交中....",
mask: true
@ -349,10 +371,6 @@
itemCodes.push(item.itemCode)
})
var param = {
itemCode: itemCodes,
locationCode: this.toLocationCode
}
//
getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) {
@ -362,7 +380,7 @@
// transferIssueJobSubmit(this.id, params).then(res => {
// if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data.Number, )
// this.showCommitSuccessMessage("<br>" + res.data.Number )
// } else {
// this.showErrorMessage("")
// }
@ -380,7 +398,6 @@
setParams() {
var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
@ -395,11 +412,41 @@
})
})
this.jobContent.subList = subList
this.jobContent.createTime = createTime;
this.jobContent.creator = creator;
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) {
getBasicLocationByCode(locationCode).then(res => {
@ -468,13 +515,10 @@
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
})
setTimeout(() => {
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="">
<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>
</view>
</view>
</scroll-view>
</view>
<requiredLocation ref='comScanLocation' title="目标库位" :locationCode="toLocationCode"
@getLocation='scanLocationCode' :isShowEdit="jobContent.allowModifyLocation == 'TRUE'"
:locationTypeList="tolocationTypeList"></requiredLocation>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
@ -43,7 +47,8 @@
goHome,
getCurrDateTime,
getPackingNumberAndBatch,
getInventoryStatusName
getInventoryStatusName,
getDirectoryItemArray
} from '@/common/basic.js';
import {
@ -53,7 +58,8 @@
import {
getDataSource,
createRecordInfo,
calcHandleQty
calcHandleQty,
getScanCount
} from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
@ -81,6 +87,7 @@
jobContent: {}, //
subList: [], //subList
detailSource: [], //
toLocationCode: "",
toLocationInfo: {},
businessTypeInfo: {},
locationTypeList: [],
@ -170,6 +177,10 @@
that.jobContent = res.data;
that.subList = res.data.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 {
that.showMessage('列表数据为0');
}
@ -190,7 +201,7 @@
//
continueScan() {
this.scanCount = this.getScanCount();
this.scanCount = getScanCount(this.subList);
if (this.scanCount == this.subList.length) {
this.closeScanPopup();
} 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() {
this.calcHandleQty();
@ -266,7 +268,12 @@
']不一致,是否继续上架?', res => {
if (res) {
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();
} else {
this.scanPopupGetFocus();
@ -274,7 +281,12 @@
});
} else {
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();
}
}
@ -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) {
@ -311,7 +332,7 @@
},
async submitJob() {
submitJob() {
uni.showLoading({
title: "提交中....",
mask: true
@ -333,7 +354,6 @@
this.managementList = res.list;
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
// var params = this.getParams();
// transferReceiptJobSubmit(this.id, params).then(res => {
// if (res.data) {
@ -355,7 +375,6 @@
},
setParams() {
var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
@ -370,11 +389,30 @@
})
})
this.jobContent.subList = subList
this.jobContent.createTime = createTime;
this.jobContent.creator = creator;
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) {
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) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
@ -441,18 +490,15 @@
uni.hideLoading();
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
})
setTimeout(() => {
uni.navigateTo({
url: './receiptJob'
})
}, 3000)
})
},
}
}
</script>

2
pages/unPlanned/coms/comIssueDetailCard.vue

@ -10,7 +10,7 @@
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)"
: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>
<u-line color="#D8D8D8"></u-line>

54
pages/unPlanned/coms/comReceiptDetailCard.vue

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

133
pages/unPlanned/job/issueJobDetail.vue

@ -46,7 +46,8 @@
goHome,
getCurrDateTime,
getPackingNumberAndBatch,
getDirectoryItemArray
getDirectoryItemArray,
getInventoryStatusName,
} from '@/common/basic.js';
import {
@ -57,7 +58,6 @@
} from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue"
@ -69,7 +69,6 @@
winScanButton,
winScanPackAndLocation,
comMessage,
requiredLocation,
comDetailCard,
detailInfoPopup
},
@ -81,7 +80,6 @@
jobContent: {}, //
subList: [], //subList
detailSource: [], //
locationTypeList: [],
businessTypeInfo: {},
managementList: []
};
@ -125,10 +123,10 @@
}
},
// onPullDownRefresh() {
// this.getDetail();
// uni.stopPullDownRefresh();
// },
onPullDownRefresh() {
this.getDetail();
uni.stopPullDownRefresh();
},
mounted() {
@ -158,10 +156,8 @@
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.locationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes);
that.subList = res.data.subList;
that.detailSource = getDataSource(that.subList)
} else {
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() {
this.scanCount = getScanCount(this.subList);
@ -220,35 +195,69 @@
getScanResult(result) {
try {
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var itemCode = result.label.itemCode;
var packingNumber = result.balance.packingNumber;
var batch = result.balance.batch;
var qty = result.balance.qty;
var itemCode = result.balance.itemCode;
var locationCode = result.balance.locationCode;
var inventoryStatus = result.balance.inventoryStatus;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showMessage("物料号【" + itemCode + "】不在列表中")
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} 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) {
this.showMessage("箱码【" + packingNumber + "】不在列表中")
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]不在列表中")
} else {
if (itemDetail.scaned) {
this.showMessage("箱码" + packingNumber + "已经扫描")
this.showErrorMessage("箱码[" + packingNumber + "]" + "批次[" + batch + "]已经扫描")
} 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.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();
} 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) {
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) {
this.submitJob();
@ -271,57 +280,40 @@
},
async submitJob() {
submitJob() {
uni.showLoading({
title: "提交中....",
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()
console.log("提交参数", JSON.stringify(params));
// unPlannedIssueJobSubmit(this.id, params).then(res => {
// unPlannedIssueJobSubmit(params).then(res => {
// uni.hideLoading()
// if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data.Number, )
// this.showCommitSuccessMessage("<br>" + res.data )
// } else {
// this.showErrorMessage("")
// this.showErrorMessage(""+res.msg)
// }
// uni.hideLoading()
// }).catch(error => {
// uni.hideLoading()
// this.showErrorMessage(error)
// })
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
});
},
setParams() {
var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
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)
}
})
})
this.jobContent.subList = subList
this.jobContent.createTime = createTime;
this.jobContent.creator = creator;
return this.jobContent;
},
@ -400,13 +392,10 @@
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
})
setTimeout(() => {
uni.navigateTo({
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="">
<com-receipt-detail-card :dataContent="item" :index="index" :settingParam="jobContent"
@remove="updateData" @updateData="updateData">
@remove="updateData" @updateData="updateData" :locationTypeList='toLocationTypeList'>
</com-receipt-detail-card>
</view>
<u-line />
</view>
</scroll-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="uni-flex u-col-center space-between padding_10"
@ -38,7 +42,7 @@
import {
getUnPlannedReceiptJobDetail,
cancleTakeUnPlannedReceiptJob,
takeUnPlannedReceiptJob
takeUnPlannedReceiptJob,
unPlannedReceiptJobSubmit
} from '@/api/request2.js';
import {
@ -48,6 +52,13 @@
getDirectoryItemArray
} from '@/common/basic.js';
import {
getDataSource,
createRecordInfo,
calcHandleQty,
getScanCount
} from '@/common/detail.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
@ -72,7 +83,7 @@
jobContent: {}, //
subList: [], //subList
detailSource: [], //
locationTypeList: [],
toLocationTypeList: [],
toLocationCode: '',
toLocationInfo: {},
businessTypeInfo: {},
@ -147,10 +158,10 @@
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
// that.toLocationCode=that.jobContent.toLocationCode;
that.locationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes);
that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes);
that.subList = res.data.subList;
that.detailSource = that.getDataSource(that.subList)
this.toLocationCode = that.subList[0].toLocationCode
that.detailSource = getDataSource(that.subList)
} else {
that.showErrorMessage('列表数据为0');
}
@ -161,59 +172,22 @@
})
},
getDataSource(subList) {
let items = [];
subList.forEach(detail => {
var item = items.find(r =>
r.itemCode == detail.itemCode)
if (item == undefined) {
item = this.createItemInfo(detail);
let newDetail = this.createDetailInfo(detail); //
item.subList.push(newDetail);
items.push(item)
} else {
item.qty += detail.qty
let newDetail = this.createDetailInfo(detail); //
item.subList.push(newDetail);
}
scanLocationCode(location, code) {
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
})
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() {
this.scanCount = this.getScanCount();
this.scanCount = getScanCount(this.subList);
if (this.scanCount == this.subList.length) {
this.closeScanPopup();
} 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() {
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) {
try {
@ -269,9 +220,11 @@
this.showMessage("箱码【" + packingNumber + "】已经扫描")
} else {
itemDetail.scaned = true;
itemDetail.record = this.createRecordInfo(itemDetail, result.label);
this.calcHandleQty();
itemDetail.handleQty = Number(result.label.qty);
itemDetail.toLocationCode = this.toLocationCode;
itemDetail.labelQty = Number(result.label.qty);
calcHandleQty(this.detailSource);
this.continueScan()
}
}
}
@ -281,18 +234,16 @@
}
},
scanLocationCode(location, code) {
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
})
},
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) {
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({
title: "提交中....",
mask: true
@ -325,14 +296,14 @@
itemCodes.push(item.itemCode)
})
getManagementPrecisions(itemCodes,"", res => {
getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
// unPlannedReceiptJobSubmit(this.id, params).then(res => {
// unPlannedReceiptJobSubmit(params).then(res => {
// if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data.Number, )
// this.showCommitSuccessMessage("<br>" + res.data)
// } else {
// this.showErrorMessage("")
// }
@ -350,7 +321,6 @@
setParams() {
var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
@ -365,7 +335,6 @@
})
})
this.jobContent.subList = subList
this.jobContent.createTime = createTime;
this.jobContent.creator = creator;
return this.jobContent;
},

Loading…
Cancel
Save