Browse Source

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

# Conflicts:
#	mycomponents/qty/qty.vue
wms3.0_pda
niexiting 11 months ago
parent
commit
1292761007
  1. 33
      api/request2.js
  2. 32
      common/balance.js
  3. 48
      common/basic.js
  4. 17
      common/label.js
  5. 3
      common/record.js
  6. 2
      mycomponents/balance/purchaseLabel.vue
  7. 2
      mycomponents/package/packageTarget.vue
  8. 4
      mycomponents/production/productionInfo.vue
  9. 6
      mycomponents/scan/winComScan.vue
  10. 2
      mycomponents/scan/winScanLocation.vue
  11. 6
      mycomponents/scan/winScanPack.vue
  12. 111
      pages/inventoryMove/job/inventoryMoveDetail.vue
  13. 151
      pages/productPutaway/record/productPutawayRecord.vue
  14. 11
      pages/productReceipt/coms/comProductRecord.vue
  15. 2
      pages/productReceipt/job/productReceiptDetail.vue
  16. 253
      pages/productReceipt/record/productReceiptRecord.vue
  17. 106
      pages/scrap/record/scrapRecord.vue
  18. 189
      pages/transfer/coms/comTransferRecord.vue
  19. 2
      pages/unPlanned/coms/comReceiptRecord.vue
  20. 56
      pages/unPlanned/record/issueRecord.vue
  21. 168
      pages/unPlanned/record/receiptRecord.vue

33
api/request2.js

@ -1056,8 +1056,8 @@ export function productionReceiptJobSubmit(params) {
*/ */
export function productionReceiptRecordSubmit(params) { export function productionReceiptRecordSubmit(params) {
return request({ return request({
url: baseApi + "/magic-api/pda/job/putaway/jobSubmit", url: baseApi + "/wms/productreceipt-record-main/create",
method: "put", method: "post",
data: params, data: params,
}); });
} }
@ -1349,7 +1349,7 @@ export function unPlannedReceiptRequestHandle(id) {
*/ */
export function unPlannedReceiptRecordbSubmit(id, params) { export function unPlannedReceiptRecordbSubmit(id, params) {
return request({ return request({
url: baseApi + "/magic-api/pda/job/purchasereturn/jobSubmit?id=" + id, url: baseApi + "/wms/unplannedreceipt-record-main/create",
method: "post", method: "post",
data: params, data: params,
}); });
@ -2081,8 +2081,8 @@ export function transferReceiptJobSubmit(params) {
*/ */
export function transferReceiptRecordSubmit(params) { export function transferReceiptRecordSubmit(params) {
return request({ return request({
url: baseApi + "/magic-api/pda/job/purchasereceipt/jobSubmit", url: baseApi + "/wms/transferreceipt-record-main/create",
method: "put", method: "post",
data: params, data: params,
}); });
} }
@ -2162,8 +2162,8 @@ export function transferIssueJobSubmit(params) {
*/ */
export function transferIssueRecordSubmit(params) { export function transferIssueRecordSubmit(params) {
return request({ return request({
url: baseApi + "/magic-api/pda/job/purchasereceipt/jobSubmit", url: baseApi + "/wms/transferissue-record-main/create",
method: "put", method: "post",
data: params, data: params,
}); });
} }
@ -2819,8 +2819,8 @@ export function scrapRequestHandle(id) {
*/ */
export function scrapRecordSubmit(params) { export function scrapRecordSubmit(params) {
return request({ return request({
url: baseApi + "/wms/purchasereturn-request-main/submit", url: baseApi + "/wms/scrap-record-main/create",
method: "put", method: "post",
data: params, data: params,
}); });
} }
@ -3012,6 +3012,21 @@ export function getBalanceByFilter(param) {
}); });
} }
/**
* 查询管理精度多个零件多个库位
* @param {*}
*
*/
export function getPrecisionStrategy(param) {
return request({
url: baseApi + "/wms/rule/getPrecisionStrategy",
method: "post",
data: param,
});
}
/** /**
* 删除文件 * 删除文件

32
common/balance.js

@ -1,8 +1,40 @@
import { import {
getManagementPrecision, getManagementPrecision,
getPrecisionStrategy,
getBalanceByFilter getBalanceByFilter
} from '@/api/request2.js'; } from '@/api/request2.js';
/**
* "itemCode": [],
"locationCode":"INSPECT"
管理精度策略
* @param {*}
*
*/
export function getPrecisionStrategyList(itemList, callback) {
// let jsonParem = JSON.stringify(param)
let result = {
list: [],
success: true,
message: ''
};
getPrecisionStrategy(itemList).then(res => {
if (res.data == null) {
result.success = false
result.message = '未查询到管理精度信息'
} else {
result.list = res.data;
}
callback(result);
}).catch(error => {
result.success = false;
result.message = error;
callback(result);
})
}
/** /**
* "itemCode": [], * "itemCode": [],
"locationCode":"INSPECT" "locationCode":"INSPECT"

48
common/basic.js

@ -320,17 +320,6 @@ export function getUnPlannedIssuseReasonList(value) {
return unplannedIissueReason return unplannedIissueReason
} }
//获取报废出库原因
export function getScarpReasonList(value) {
if (scrapReasonList.length == 0) {
scrapReasonList = getDirectoryInfo("scrap_reason")
}
scrapReasonList.forEach(res => {
res.text = res.label;
res.value = res.code
})
return scrapReasonList
}
//获取检验不合格原因 //获取检验不合格原因
export function getInspectReasonList(value) { export function getInspectReasonList(value) {
@ -606,6 +595,43 @@ export function getInspectReasonList(value) {
// else return 'Other' // else return 'Other'
// } // }
export function getPackingNumberAndBatchByList(managementList, itemCode, packingNumber,locationCode, batch) {
var itemInfo = {
packingNumber: "",
batch: ""
}
var manageType = queryManageModelByList(managementList, itemCode,locationCode)
if (manageType == "BY_QUANTITY") {
itemInfo.packingNumber = ""
itemInfo.batch = ""
} else if (manageType == "BY_BATCH") {
itemInfo.packingNumber = ""
itemInfo.batch = batch
} else if (manageType == "BY_PACKAGING") {
itemInfo.packingNumber = packingNumber
itemInfo.batch = batch
} else if (manageType == "BY_UNIQUE_ID") {
itemInfo.packingNumber = packingNumber
itemInfo.batch = batch
}
return itemInfo;
}
export function queryManageModelByList(managementList, itemCode,locationCode) {
var result = managementList.filter(res => {
if (res.itemCode == itemCode&&res.locationCode==locationCode) {
return res.ManagementPrecision
}
})
if (result != undefined) {
return result[0].ManagementPrecision
} else {
return ""
}
}
// 获取业务类型字典项 // 获取业务类型字典项
export function getBusinessTypeDesc(type) { export function getBusinessTypeDesc(type) {

17
common/label.js

@ -6,7 +6,7 @@ import {
} from '@/api/request2.js'; } from '@/api/request2.js';
export function getLabelInfo(scanMsg, callBack) { export function getLabelInfo(scanMsg,headerType, callBack) {
console.log('扫描信息:', scanMsg); console.log('扫描信息:', scanMsg);
if (scanMsg.length == 0) { if (scanMsg.length == 0) {
return null return null
@ -15,6 +15,21 @@ export function getLabelInfo(scanMsg, callBack) {
let header = items[0]; let header = items[0];
let version = items[1]; let version = items[1];
if ((header != undefined) && (version!=undefined)) { if ((header != undefined) && (version!=undefined)) {
if(header!=headerType){
let labelResult = {
label: {
labelType: "",
barType: '',
code:""
},
package: null,
success: false,
message: '请输入'+headerType+"开始的标签",
}
callBack(labelResult);
return;
}
//解析扫描的是一维码还是二维码 //解析扫描的是一维码还是二维码
let type = header.substring(header.length - 1, header.length); let type = header.substring(header.length - 1, header.length);
if (type == 'Q') //qrcode if (type == 'Q') //qrcode

3
common/record.js

@ -26,8 +26,9 @@ export function createDetailInfo(data, pack) {
Object.assign(detail, data) Object.assign(detail, data)
detail.balanceQty = Number(detail.qty) detail.balanceQty = Number(detail.qty)
detail.stdPackQty = Number(pack.stdPackQty) detail.stdPackQty = Number(pack.stdPackQty)
detail.stdPackUnit =pack.stdPackUnit detail.stdPackUnit = pack.stdPackUnit
detail.package = pack; detail.package = pack;
return detail; return detail;
} }

2
mycomponents/balance/purchaseLabel.vue

@ -2,7 +2,7 @@
<view :class="dataContent.scaned?'scan_view':''"> <view :class="dataContent.scaned?'scan_view':''">
<balance :dataContent="dataContent" :isShowStdPack="false" :isShowPack="isShowPack" <balance :dataContent="dataContent" :isShowStdPack="false" :isShowPack="isShowPack"
:isShowLocation="isShowLocation"></balance> :isShowLocation="isShowLocation"></balance>
<purchase-info :dataContent="packageContent"></purchase-info> <!-- <purchase-info :dataContent="packageContent"></purchase-info> -->
</view> </view>
</template> </template>

2
mycomponents/package/packageTarget.vue

@ -11,7 +11,7 @@
<image v-if="isShowEdit" style="width: 45rpx;height: 45rpx;" src="/static/icons/icons_edit.svg" <image v-if="isShowEdit" style="width: 45rpx;height: 45rpx;" src="/static/icons/icons_edit.svg"
></image> ></image>
</view> </view>
<win-scan-pack ref="scanPopup" @getResultult='getScanResult'></win-scan-pack> <win-scan-pack ref="scanPopup" @getResultult='getScanResult' headerType="HPQ"></win-scan-pack>
</view> </view>
</template> </template>

4
mycomponents/production/productionInfo.vue

@ -1,11 +1,11 @@
<template> <template>
<view class="pack_view uni-inline-item"> <view class="pack_view uni-inline-item">
<text style="color: #606266;font-size: 13px;">生产线</text> <text style="color: #606266;font-size: 13px;">生产线</text>
<text style="color: #606266;font-size: 13px;">{{dataContent.ProductionLineCode}}</text> <text style="color: #606266;font-size: 13px;">{{dataContent.productionLineCode}}</text>
</view> </view>
<view class="pack_view uni-inline-item"> <view class="pack_view uni-inline-item">
<text style="color: #606266;font-size: 13px;">生产日期</text> <text style="color: #606266;font-size: 13px;">生产日期</text>
<text style="color: #606266;font-size: 13px;">{{dataContent.ProduceDate}}</text> <text style="color: #606266;font-size: 13px;">{{dataContent.produceDate}}</text>
</view> </view>
</template> </template>

6
mycomponents/scan/winComScan.vue

@ -84,9 +84,9 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
labelType:{ headerType:{
type: String, type: String,
default: 'PurchaseLabel' //PurchaseLabel LocationLabel MakeLabel ContainerLabel default: 'HPQ' //HLB HMQ HCQ HPQ
} }
}, },
data() { data() {
@ -154,7 +154,7 @@
if (that.isShowHistory) { if (that.isShowHistory) {
that.scanList.unshift(content); that.scanList.unshift(content);
} }
getLabelInfo(content, callback => { getLabelInfo(content,this.headerType, callback => {
let scanResult = callback; let scanResult = callback;
if (scanResult.success) { if (scanResult.success) {
that.clear(); that.clear();

2
mycomponents/scan/winScanLocation.vue

@ -13,7 +13,7 @@
<view class=""> <view class="">
<view class=""> <view class="">
<win-com-scan ref="scan" labelType="LocationLabel" @getResult="getScanResult" :placeholder='title' :clearResult="false" <win-com-scan ref="scan" labelType="LocationLabel" @getResult="getScanResult" :placeholder='title' :clearResult="false"
:boxFocus="true" :isShowHistory="isShowHistory"> :boxFocus="true" :isShowHistory="isShowHistory" headerType="HLB">
</win-com-scan> </win-com-scan>
</view> </view>
</view> </view>

6
mycomponents/scan/winScanPack.vue

@ -14,7 +14,7 @@
</view> </view>
<view class=""> <view class="">
<view class=""> <view class="">
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult" <win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult" :headerType="headerType"
:isShowHistory="isShowHistory" :clearResult="true"></win-com-scan> :isShowHistory="isShowHistory" :clearResult="true"></win-com-scan>
</view> </view>
</view> </view>
@ -45,6 +45,10 @@
isShowHistory: { isShowHistory: {
type: Boolean, type: Boolean,
default: true default: true
},
headerType:{
type: String,
default: 'HPQ'
} }
}, },
data() { data() {

111
pages/inventoryMove/job/inventoryMoveDetail.vue

@ -48,7 +48,8 @@
inventoryMoveSubmit inventoryMoveSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
getManagementPrecisions getManagementPrecisions,
getPrecisionStrategyList
} from '@/common/balance.js'; } from '@/common/balance.js';
import { import {
@ -61,7 +62,7 @@
updateTitle, updateTitle,
navigateBack, navigateBack,
getCurrDateTime, getCurrDateTime,
getPackingNumberAndBatch, getPackingNumberAndBatchByList,
getInventoryStatusName getInventoryStatusName
} from '@/common/basic.js'; } from '@/common/basic.js';
@ -264,16 +265,17 @@
} else { } else {
let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus); let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus); let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
if (itemDetail.inventoryStatus != result.balance.inventoryStatus){ if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
if(this.jobContent.allowModifyInventoryStatus=="TRUE"){ if (this.jobContent.allowModifyInventoryStatus == "TRUE") {
this.showQuestionMessage('任务中允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + this.showQuestionMessage('任务中允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,是否继续转移?', res => { ']不一致,是否继续转移?', res => {
if (res) { if (res) {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.handleQty = Number(result.balance.qty) ; itemDetail.handleQty = Number(result.balance.qty);
itemDetail.toInventoryStatus = result.balance.inventoryStatus; itemDetail.toInventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance; itemDetail.balance = result.balance;
itemDetail.balance.balanceQty =Number(result.balance.qty) ; itemDetail.balance.balanceQty = Number(result.balance.qty);
itemDetail.balance.stdPackQty = Number(result.package.stdPackQty) itemDetail.balance.stdPackQty = Number(result.package.stdPackQty)
itemDetail.balance.stdPackUnit = result.package.stdPackUnit itemDetail.balance.stdPackUnit = result.package.stdPackUnit
this.calcHandleQty(); this.calcHandleQty();
@ -281,15 +283,16 @@
this.scanPopupGetFocus(); this.scanPopupGetFocus();
} }
}); });
}else { } else {
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,不允许转移!', res => { ']不一致,不允许转移!', res => {
this.scanPopupGetFocus(); this.scanPopupGetFocus();
}); });
} }
}else { } else {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.handleQty = Number(result.balance.qty) ; itemDetail.handleQty = Number(result.balance.qty);
itemDetail.toInventoryStatus = result.balance.inventoryStatus; itemDetail.toInventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance; itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = Number(result.balance.qty); itemDetail.balance.balanceQty = Number(result.balance.qty);
@ -297,27 +300,6 @@
itemDetail.balance.stdPackUnit = result.package.stdPackUnit itemDetail.balance.stdPackUnit = result.package.stdPackUnit
this.calcHandleQty(); this.calcHandleQty();
} }
// if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
// this.showQuestionMessage('[' + balanceStatus + '][' + itemStatus +
// '],?', res => {
// if (res) {
// itemDetail.scaned = true;
// itemDetail.handleQty = Number(result.balance.qty) ;
// itemDetail.toInventoryStatus = result.balance.inventoryStatus;
// 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 {
// }
} }
} }
} }
@ -362,24 +344,16 @@
title: "提交中....", title: "提交中....",
mask: true mask: true
}); });
this.managementList = [];
// //
// this.detailSource.forEach(item => { this.managementList = [];
// item.subList.forEach(detail => { var precisionStrategParams = this.setPrecisionStrategParams()
// if (detail.scaned) { getPrecisionStrategyList(precisionStrategParams, res => {
// getManagementPrecisions(item.itemCode,detail.toLocationCode,res=>{ if (res.success) {
// if (res.success) { this.managementList = res.list;
// this.managementList = this.managementList.concat(res.list)
// }
// })
// }
// })
// })
var params = this.setParams();
console.log("提交" + JSON.stringify(params))
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
inventoryMoveSubmit(params).then(res => { inventoryMoveSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
@ -391,6 +365,39 @@
uni.hideLoading() uni.hideLoading()
this.showErrorMessage(error) this.showErrorMessage(error)
}) })
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
})
},
setPrecisionStrategParams(){
var itemList = []
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode
&&res.locationCode == detail.toLocationCode) {
return res
}
})
//
if(filterResult.length==0){
var result = {
itemCode: item.itemCode,
locationCode: detail.toLocationCode
}
itemList.push(result)
}
}
})
})
return itemList;
}, },
setParams() { setParams() {
@ -400,10 +407,10 @@
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, var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
// detail.packingNumber, detail.batch); detail.packingNumber, detail.toLocationCode, detail.batch);
detail.toPackingNumber = detail.packingNumber; detail.toPackingNumber = info.packingNumber;
detail.toBatch = detail.batch; detail.toBatch = info.batch;
detail.toContainerNumber = ''; detail.toContainerNumber = '';
detail.toLocationCode = detail.toLocationCode; detail.toLocationCode = detail.toLocationCode;

151
pages/productPutaway/record/productPutawayRecord.vue

@ -18,13 +18,14 @@
</scroll-view> </scroll-view>
</view> </view>
<requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
: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"
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationTypeList="tolocationTypeList"></requiredLocation>
</view> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> <button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
@ -44,15 +45,14 @@
<script> <script>
import { import {
productPutawayRequestSubmit,
productPutawayRecordSubmit productPutawayRecordSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
goHome, goHome,
getPackingNumberAndBatch getPackingNumberAndBatchByList
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
getManagementPrecisions getPrecisionStrategyList
} from '@/common/balance.js'; } from '@/common/balance.js';
import { import {
@ -93,28 +93,19 @@
data() { data() {
return { return {
id: '', id: '',
receiptJob: {},
received: false,
isShowPackingCode: true,
scanCount: 0, scanCount: 0,
dataContent: {}, // dataContent: {}, //
subList: [], //subList subList: [], //subList
detailSource: [], // detailSource: [], //
locationTypeList: [], locationTypeList: [],
toLocationInfo: {},
businessTypeInfo: {},
fromLocationInfo: {},
fromLocationCode: "", fromLocationCode: "",
toLocationInfo: {},
toLocationCode: "", toLocationCode: "",
isShowLocation: false,
fromlocationTypeList: [], fromlocationTypeList: [],
tolocationTypeList: [], tolocationTypeList: [],
allowModifyLocation: false,
inInventoryStatus: "", // inInventoryStatus: "", //
outInventoryStatus: "", // outInventoryStatus: "", //
businessType: {}, businessType: {},
showToLoaction:true managementList:[]
}; };
}, },
onLoad(option) { onLoad(option) {
@ -126,7 +117,7 @@
this.tolocationTypeList = res.tolocationTypeList; this.tolocationTypeList = res.tolocationTypeList;
this.showFromLocationPopup(); this.showFromLocationPopup();
} else { } else {
this.$refs.comMessage.showBreakMessage(res.message ); this.showErrorMessage(res.message)
} }
}); });
@ -243,81 +234,116 @@
}, },
commit() { commit() {
if (this.showToLoaction &&this.toLocationCode == "") { if (this.toLocationCode == "") {
this.showMessage("请先选择目标库位") this.showMessage("请先选择目标库位")
return; return;
} }
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
//
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
}); });
this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams()
// getPrecisionStrategyList(precisionStrategParams, res => {
var itemCodes = []
this.detailSource.forEach(item => {
itemCodes.push(item.itemCode)
})
//
getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) { if (res.success) {
this.managementList = res.list; this.managementList = res.list;
var params = this.setRecordParams(true) var params = this.setParams()
console.log("提交参数", JSON.stringify(params)); console.log("提交" + JSON.stringify(params))
productPutawayRecordSubmit(params).then(res => {
// productPutawayRecordSubmit(params).then(res => { uni.hideLoading()
// uni.hideLoading() if (res.data) {
// if (res.data) { this.showCommitSuccessMessage("提交成功<br>生成制品上架记录<br>" + res.data)
// this.showCommitSuccessMessage("<br>" + res.data ) } else {
// } else { this.showErrorMessage("提交失败[" + res.msg + "]")
// 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);
} }
});
})
} else {
this.showErrorMessage("没有要提交的数据,请先扫描")
}
},
setPrecisionStrategParams() {
var itemList = []
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.toLocationCode = this.toLocationCode;
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode &&
detail.toLocationCode == res.locationCode) {
return res
}
})
//
if (filterResult.length == 0) {
var result = {
itemCode: item.itemCode,
locationCode: detail.toLocationCode
}
itemList.push(result)
}
}
})
})
return itemList;
}, },
setRecordParams(queryModel) { setParams() {
var subList = [] var subList = []
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 = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
// Object.assign(subItem, detail) detail.packingNumber, detail.toLocationCode, detail.batch);
if (queryModel) { detail.itemCode = detail.itemCode;
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, detail.itemName = detail.package.itemName;
detail.packingNumber, detail.batch); detail.itemDesc1 = detail.package.itemDesc1;
detail.toPackingNumber = info.packingNumber;; detail.itemDesc2 = detail.package.itemDesc2;
detail.inventoryStatus = detail.inventoryStatus;
detail.fromPackingNumber = info.packingNumber;
detail.toPackingNumber = info.packingNumber;
detail.fromContainerNumber = detail.containerNumber;
detail.toContainerNumber = detail.containerNumber detail.toContainerNumber = detail.containerNumber
detail.fromBatch = info.batch;
detail.toBatch = info.batch; detail.toBatch = info.batch;
detail.toInventoryStatus = detail.inventoryStatus
detail.toLocationCode = this.toLocationCode detail.fromLocationCode = detail.locationCode;
} else { detail.toLocationCode = detail.toLocationCode;
detail.toPackingNumber = detail.packingNumber;
detail.toContainerNumber = detail.containerNumber
detail.toBatch = detail.toBatch;
detail.toInventoryStatus = detail.inventoryStatus
detail.toLocationCode = ""
}
subList.push(detail) subList.push(detail)
} }
}) })
}) })
this.dataContent.subList = subList this.dataContent.subList = subList;
this.dataContent.creator = creator; this.dataContent.creator = creator;
return this.dataContent; return this.dataContent;
}, },
showMessage(message) { showMessage(message) {
this.$refs.comMessage.showMessage(message, res => { this.$refs.comMessage.showMessage(message, res => {
if (res) {} if (res) {}
@ -346,25 +372,20 @@
this.getFromLocationCode(location, code) this.getFromLocationCode(location, code)
}, },
getFromLocationCode(location, code) { getFromLocationCode(location, code) {
this.fromLocationInfo = location;
this.fromLocationCode = code; this.fromLocationCode = code;
this.openScanPopup(); this.openScanPopup();
}, },
getToLocationCode(location, code) { getToLocationCode(location, code) {
if (this.fromLocationCode == code) {
uni.showToast({
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致",
duration: 2000
})
return
}
this.ToLocationCodeInfo = location;
this.toLocationCode = code; this.toLocationCode = code;
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
this.fromLocationCode = ''; this.fromLocationCode = '';
this.subList = [];
this.detailSource = [];
this.toLocationCode = '';
this.dataContent = {}
}) })
}, },

11
pages/productReceipt/coms/comProductRecord.vue

@ -16,9 +16,12 @@
<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">
<production-label :dataContent="item" :packageContent="item.package" <balance :dataContent="item" :isShowStdPack="false" :isShowStatus="true"
:isShowPack="true" :isShowLocation="false"></balance>
<!-- <production-label :dataContent="item" :packageContent="item.package"
:isShowLocation="false"> :isShowLocation="false">
</production-label> </production-label> -->
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
</view> </view>
@ -40,6 +43,7 @@
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue' import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
import comMessage from '@/mycomponents/common/comMessage.vue' import comMessage from '@/mycomponents/common/comMessage.vue'
import packageDetailPopup from '@/mycomponents/package/packageDetailPopup.vue' import packageDetailPopup from '@/mycomponents/package/packageDetailPopup.vue'
import balance from '@/mycomponents/balance/balance.vue'
import { import {
getDetailOption, getDetailOption,
@ -54,7 +58,8 @@
productionLabel, productionLabel,
recommendQtyEdit, recommendQtyEdit,
record, record,
comMessage comMessage,
balance
}, },
props: { props: {
dataContent: { dataContent: {

2
pages/productReceipt/job/productReceiptDetail.vue

@ -37,7 +37,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' :title="'制品便签'"></win-scan-pack> <win-scan-pack ref="scanPopup" @getResult='getScanResult' :title="'制品标签'" headerType="HMQ"></win-scan-pack>
<com-message ref="comMessage"></com-message> <com-message ref="comMessage"></com-message>
</view> </view>
</template> </template>

253
pages/productReceipt/record/productReceiptRecord.vue

@ -8,7 +8,7 @@
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<com-product-record :dataContent="item" :index="index" :settingParam="jobContent" <com-product-record :dataContent="item" :index="index"
@removeItem="removeItem(index,item)" @updateData="updateData" @removePack="removePack"> @removeItem="removeItem(index,item)" @updateData="updateData" @removePack="removePack">
</com-product-record> </com-product-record>
</view> </view>
@ -17,13 +17,21 @@
</scroll-view> </scroll-view>
</view> </view>
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
: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"
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<view class="uni-flex uni-row u-col-center">
<text style="font-size: 32rpx;">位置 : </text>
<view class="uni-flex u-col-center uni-row" @click="showSelect">
<view class="" style="margin-left: 20rpx;">
{{positionInfo}}
</view>
<u-select v-model="show" mode="mutil-column-auto" :list="positionList"
@confirm="confirmSelect"></u-select>
</view>
</view>
</view> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> <button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
@ -33,18 +41,23 @@
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
</view> </view>
<win-scan-pack ref="scanPopup" @getResult='getScanResult' title="制品标签"></win-scan-pack> <win-scan-pack ref="scanPopup" @getResult='getScanResult' title="制品标签" headerType="HMQ"></win-scan-pack>
<com-message ref="comMessage"></com-message> <com-message ref="comMessage"></com-message>
</view> </view>
</template> </template>
<script> <script>
import { import {
productionReceiptRecordSubmit productionReceiptRecordSubmit,
getWorkShopLineStation
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
goHome getPrecisionStrategyList
} from '@/common/balance.js';
import {
goHome,
getPackingNumberAndBatchByList
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
@ -74,15 +87,26 @@
}, },
data() { data() {
return { return {
jobContent: {}, //
detailSource: [], // detailSource: [], //
toLocationTypeList: [], toLocationTypeList: [],
toLocationInfo: {}, toLocationInfo: {},
toLocationCode: "", toLocationCode: "",
fromLocationTypeList: [], fromLocationTypeList: [],
fromLocationInfo: {},
fromLocationCode: "", fromLocationCode: "",
businessType: {}, businessType: {},
dataContent:{},
managementList:[],
show:false,
positionInfo:"请选择位置",
positionList:[],
productionLineCode:'',
rawLocationCode:"",
fgLocationCode:"",
workshopCode :"",
workStationCode :"",
workShopName :"",
productionLineName :"",
workStationName :"",
}; };
}, },
onLoad(option) { onLoad(option) {
@ -94,9 +118,14 @@
this.tolocationTypeList = res.tolocationTypeList; this.tolocationTypeList = res.tolocationTypeList;
this.openScanPopup(); this.openScanPopup();
} else { } else {
this.$refs.comMessage.showBreakMessage(res.message); this.showErrorMessage(res.message)
} }
}); });
getWorkShopLineStation().then(res => {
this.positionList = res.data
}).catch(error => {
})
}, },
// //
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
@ -129,9 +158,7 @@
} else { } else {
var detail = item.subList.find(r => { var detail = item.subList.find(r => {
if (r.packingNumber == label.packingNumber && if (r.packingNumber == label.packingNumber &&
r.batch == label.batch && r.batch == label.batch) {
r.locationCode == label.locationCode &&
r.inventoryStatus == label.inventoryStatus) {
return r; return r;
} }
}) })
@ -141,7 +168,7 @@
item.subList.push(newDetail); item.subList.push(newDetail);
} else { } else {
if (detail.scaned == true) { if (detail.scaned == true) {
this.showErrorMessage("箱码[" + label.packingNumber + "批次[" + balance.batch + "]已经在列表中") this.showErrorMessage("箱码[" + label.packingNumber + "批次[" + label.batch + "]已经在列表中")
} }
} }
} }
@ -167,7 +194,7 @@
Object.assign(detail, label) Object.assign(detail, label)
detail.scaned = true; detail.scaned = true;
detail.qty = Number(label.qty); detail.qty = Number(label.qty);
detail.inventoryStatus = "kcztOK" detail.inventoryStatus = "OK"
detail.stdPackQty = pack.stdPackQty; detail.stdPackQty = pack.stdPackQty;
detail.stdPackUnit = pack.stdPackUnit; detail.stdPackUnit = pack.stdPackUnit;
@ -194,71 +221,117 @@
this.calcHandleQty(); this.calcHandleQty();
}, },
openScanPopup() { openScanPopup() {
// if (this.fromLocationCode == "") {
// this.showFromLocationPopup();
// return
// }
this.$refs.scanPopup.openScanPopup(); this.$refs.scanPopup.openScanPopup();
}, },
// showFromLocationPopup() {
// this.$nextTick(() => {
// this.$refs.scanLocationCode.openScanPopup();
// })
// },
scanLocationCode(location, code) {
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
})
},
commit() { commit() {
if (this.toLocationCode == "") { if (this.positionInfo == "请选择位置") {
this.showMessage("请先选择目标库位") this.showMessage("请先选择位置")
return; return;
} }
//
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
//
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
}); });
this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams()
var params = this.setParams(); getPrecisionStrategyList(precisionStrategParams, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交" + JSON.stringify(params)) console.log("提交" + JSON.stringify(params))
// productionReceiptRecordSubmit(params).then(res => { productionReceiptRecordSubmit(params).then(res => {
// uni.hideLoading() uni.hideLoading()
// if (res.data) { if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data, ) this.showCommitSuccessMessage("提交成功<br>生成制品收货记录<br>" + res.data)
// } else { } else {
// this.showErrorMessage("[" + res.msg + "]") this.showErrorMessage("提交失败[" + res.msg + "]")
// } }
// }).catch(error => { }).catch(error => {
// uni.hideLoading() uni.hideLoading()
// this.showErrorMessage(error) this.showErrorMessage(error)
// }) })
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
})
} else {
this.showErrorMessage("没有要提交的数据,请先扫描")
}
}, },
setPrecisionStrategParams() {
var itemList = []
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.toLocationCode = this.fgLocationCode;
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode &&
detail.toLocationCode == res.locationCode) {
return res
}
})
//
if (filterResult.length == 0) {
var result = {
itemCode: item.itemCode,
locationCode: detail.toLocationCode
}
itemList.push(result)
}
}
})
})
return itemList;
},
setParams() { setParams() {
var subList = [] var subList = []
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, var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
// detail.packingNumber, detail.batch); detail.packingNumber, detail.toLocationCode, detail.batch);
// detail.toPackingNumber =info.packingNumber; detail.itemCode = detail.itemCode;
// detail.toBatch =info.batch; detail.itemName = detail.package.itemName;
detail.itemDesc1 = detail.package.itemDesc1;
detail.itemDesc2 = detail.package.itemDesc2;
detail.inventoryStatus = detail.inventoryStatus;
detail.fromPackingNumber = info.packingNumber;
detail.toPackingNumber = info.packingNumber;
detail.fromContainerNumber = detail.containerNumber;
detail.toContainerNumber = detail.containerNumber
detail.fromBatch = info.batch;
detail.toBatch = info.batch;
detail.fromLocationCode = detail.locationCode;
detail.toLocationCode = detail.toLocationCode;
detail.productionlineCode = this.productionLineCode;
detail.workStationCode = this.workStationCode;
subList.push(detail) subList.push(detail)
} }
}) })
}) })
return subList; this.dataContent.subList = subList;
this.dataContent.creator = creator;
this.dataContent.workshopCode = this.workshopCode;
return this.dataContent;
}, },
@ -303,36 +376,17 @@
closeScanMessage() { closeScanMessage() {
this.scanPopupGetFocus(); this.scanPopupGetFocus();
}, },
getLocation(location, code) {
this.getFromLocationCode(location, code)
},
getFromLocationCode(location, code) {
this.fromLocationInfo = location;
this.fromLocationCode = code;
this.openScanPopup();
},
getToLocationCode(location, code) {
if (this.fromLocationCode == code) {
uni.showToast({
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致",
duration: 2000
})
return
}
this.ToLocationCodeInfo = location;
this.toLocationCode = code;
},
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
this.subList = [];
this.detailSource = [];
this.toLocationCode = '';
this.dataContent = {};
this.positionInfo= "请选择位置";
this.fgLocationCode =""
}) })
setTimeout(() => {
// uni.navigateTo({
// url: './receiptJob'
// })
}, 3000)
}, },
removePack() { removePack() {
for (var i = 0; i < this.detailSource.length; i++) { for (var i = 0; i < this.detailSource.length; i++) {
@ -350,6 +404,39 @@
updateData() { updateData() {
this.calcHandleQty(); this.calcHandleQty();
}, },
showSelect() {
this.show = !this.show
},
confirmSelect(e) {
this.positionInfo = e[0].label + "-" + e[1].label + "-" + e[2].label
console.log("位置", this.positionInfo)
this.workshopCode = e[0].value
this.productionLineCode = e[1].value
this.workStationCode = e[2].value
this.workShopName = e[0].label
this.productionLineName = e[1].label
this.workStationName = e[2].label
let shop = this.positionList.find(shop => shop.value == this.workshopCode);
if (shop != undefined && shop.children != undefined) {
let prodLine = shop.children.find(line => line.value == this.productionLineCode);
if (prodLine != undefined && prodLine.children != undefined) {
let station = prodLine.children.find(r => r.value == this.workStationCode);
if (station.rawLocationCode == '' && station.rawLocationCode == null) {
this.showErrorMessage(this.workStationName + "的原材料库位为空,请重新选择")
return;
} else {
this.rawLocationCode = station.rawLocationCode;
this.fgLocationCode = station.fgLocationCode;
}
} else {
this.showErrorMessage("生产线-工位基础信息维护错误")
}
} else {
this.showErrorMessage("车间-生产线基础信息维护错误")
}
},
} }
} }
</script> </script>

106
pages/scrap/record/scrapRecord.vue

@ -10,7 +10,7 @@
</view> </view>
<uni-data-picker v-if="detailSource.length>0" style="padding: 20rpx; background-color:#fff;" <uni-data-picker v-if="detailSource.length>0" style="padding: 20rpx; background-color:#fff;"
class='uni-data-picker' placeholder="请选择原因" popup-title="选择报废原因" :localdata="reasonList" class='uni-data-picker' placeholder="请选择原因" popup-title="选择报废原因" :localdata="reasonList"
v-model="reason"> @change="reasonChange">
</uni-data-picker> </uni-data-picker>
</view> </view>
<view class="page-main"> <view class="page-main">
@ -56,12 +56,12 @@
import { import {
goHome, goHome,
updateTitle, updateTitle,
getScarpReasonList
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
getInventoryStatusDesc, getInventoryStatusDesc,
getDirectoryItemArray, getDirectoryItemArray,
getScarpReasonList
} from '@/common/directory.js'; } from '@/common/directory.js';
import { import {
@ -94,27 +94,19 @@
data() { data() {
return { return {
id: '', id: '',
receiptJob: {},
received: false,
isShowPackingCode: true,
scanCount: 0,
dataContent: {}, // dataContent: {}, //
subList: [], //subList subList: [], //subList
detailSource: [], // detailSource: [], //
locationTypeList: [], locationTypeList: [],
toLocationInfo: {},
businessTypeInfo: {},
fromLocationInfo: {},
fromLocationCode: "", fromLocationCode: "",
isShowLocation: false,
fromlocationTypeList: [], fromlocationTypeList: [],
tolocationTypeList: [], tolocationTypeList: [],
allowModifyLocation: false,
inInventoryStatus: "", // inInventoryStatus: "", //
outInventoryStatus: "", // outInventoryStatus: "", //
businessType: {}, businessType: {},
reasonList: [], reasonList: [],
reason: "", reasonText: "",
reasonCode:"",
}; };
}, },
onLoad(option) { onLoad(option) {
@ -249,7 +241,7 @@
commit() { commit() {
if(this.reason==""){ if(this.reasonText==""){
this.showMessage("请先选择报废原因") this.showMessage("请先选择报废原因")
return; return;
} }
@ -259,18 +251,17 @@
mask: true mask: true
}); });
scrapRecordSubmit(params).then(res => {
// scrapRecordSubmit(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 + "]") }
// } }).catch(error => {
// }).catch(error => { uni.hideLoading()
// uni.hideLoading() this.showErrorMessage(error)
// this.showErrorMessage(error) })
// })
}, },
@ -279,10 +270,26 @@
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.itemCode = detail.itemCode;
// detail.packingNumber, detail.batch); detail.itemName = detail.package.itemName;
// detail.toPackingNumber =info.packingNumber; detail.itemDesc1 = detail.package.itemDesc1;
// detail.toBatch =info.batch; detail.itemDesc2 = detail.package.itemDesc2;
detail.inventoryStatus = detail.inventoryStatus;
detail.fromPackingNumber = detail.packingNumber;
detail.toPackingNumber = detail.packingNumber;
detail.fromContainerNumber = detail.containerNumber;
detail.toContainerNumber = detail.containerNumber
detail.fromBatch = detail.batch;
detail.toBatch = detail.batch;
detail.fromLocationCode = detail.locationCode;
detail.toLocationCode = "";
detail.reason = this.reasonCode;
subList.push(detail) subList.push(detail)
} }
}) })
@ -290,31 +297,7 @@
return subList; return subList;
}, },
setRequestParams(){
var subList = []
var supplierCode=""
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
if(supplierCode==""){
supplierCode = detail.package.supplierCode
}
subList.push(detail)
}
})
})
this.dataContent.subList = subList
this.dataContent.supplierCode = supplierCode
this.dataContent.businessType = "PurchasePutaway"
this.dataContent.departmentCode= "研发部门";
this.dataContent.status= 1 ;
this.dataContent.autoCommit = "FALSE";
this.dataContent.autoAgree = "FALSE";
this.dataContent.autoExecute = "FALSE";
this.dataContent.directCreateRecord = "FALSE";
return this.dataContent;
},
showMessage(message) { showMessage(message) {
@ -345,14 +328,18 @@
this.getFromLocationCode(location, code) this.getFromLocationCode(location, code)
}, },
getFromLocationCode(location, code) { getFromLocationCode(location, code) {
this.fromLocationInfo = location;
this.fromLocationCode = code; this.fromLocationCode = code;
this.openScanPopup(); this.openScanPopup();
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
this.fromLocationCode = ''; this.reasonCode = ""
this.reasonText = "";
this.detailSource = [];
this.subList =[];
this.managementList =[];
this.dataContent ={}
}) })
}, },
@ -365,6 +352,15 @@
this.detailSource.splice(i, 1) this.detailSource.splice(i, 1)
} }
} }
},
reasonChange(e) {
if (e.detail.value.length == 0) {
this.reasonCode = ""
this.reasonText = ""
} else {
this.reasonCode = e.detail.value[0].value
this.reasonText = e.detail.value[0].text
}
} }
} }
} }

189
pages/transfer/coms/comTransferRecord.vue

@ -1,16 +1,15 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<view class=""> <view class="">
<com-blank-view @goScan='getLocation' v-if="fromLocationCode==''"></com-blank-view> <com-blank-view @goScan='showFromLocationPopup' v-if="fromLocationCode==''"></com-blank-view>
</view> </view>
<view class="page-wraper" v-if="fromLocationCode!=''"> <view class="page-wraper" v-if="fromLocationCode!=''">
<view class="page-main"> <view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="jobContent" <record-com-detail-card :dataContent="item" :index="index" :isShowLocation="true"
:isShowLocation="true" @removeItem="removeItem(index,item)" @updateData="updateData" @removeItem="removeItem(index,item)" @updateData="updateData" @removePack="removePack">
@removePack="removePack">
</record-com-detail-card> </record-com-detail-card>
</view> </view>
<u-line /> <u-line />
@ -18,8 +17,6 @@
</scroll-view> </scroll-view>
</view> </view>
<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%; ">
@ -44,14 +41,17 @@
</template> </template>
<script> <script>
import { import {
transferIssueRecordSubmit, transferIssueRecordSubmit,
transferReceiptRecordSubmit transferReceiptRecordSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
getPrecisionStrategyList
} from '@/common/balance.js';
import { import {
goHome, goHome,
getPackingNumberAndBatchByList
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
@ -95,34 +95,27 @@
data() { data() {
return { return {
id: '', id: '',
receiptJob: {},
received: false,
isShowPackingCode: true,
scanCount: 0,
jobContent: {}, //
subList: [], //subList subList: [], //subList
detailSource: [], // detailSource: [], //
locationTypeList: [], locationTypeList: [],
toLocationInfo: {},
businessTypeInfo: {},
fromLocationInfo: {},
fromLocationCode: "", fromLocationCode: "",
toLocationInfo: {},
toLocationCode: "", toLocationCode: "",
isShowLocation: false,
fromlocationTypeList: [], fromlocationTypeList: [],
tolocationTypeList: [], tolocationTypeList: [],
allowModifyLocation: false,
inInventoryStatus: "", // inInventoryStatus: "", //
outInventoryStatus: "", // outInventoryStatus: "", //
businessType: {}, businessType: {},
managementList: [],
dataContent: {},
toWarehouseCode:''
}; };
}, },
mounted(option) { mounted(option) {
var typeCode ="" var typeCode = ""
if(this.transferType=="TransferDeliver"){ if (this.transferType == "TransferDeliver") {
typeCode = "TransferDeliver" typeCode = "TransferDeliver"
}else if(this.transferType=="TransferReceipt"){ } else if (this.transferType == "TransferReceipt") {
typeCode = "TransferReceipt" typeCode = "TransferReceipt"
} }
@ -133,7 +126,7 @@
this.tolocationTypeList = res.tolocationTypeList; this.tolocationTypeList = res.tolocationTypeList;
this.showFromLocationPopup(); this.showFromLocationPopup();
} else { } else {
this.$refs.comMessage.showBreakMessage(res.message ); this.showErrorMessage(res.message)
} }
}); });
@ -247,61 +240,129 @@
}, },
commit() { commit() {
if (this.toLocationCode == "") { if (this.toLocationCode == "") {
this.showMessage("请先选择目标库位") this.showMessage("请先选择目标库位")
return; return;
} }
// if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
//
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
}); });
this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams()
var params = this.setParams(); getPrecisionStrategyList(precisionStrategParams, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交" + JSON.stringify(params)) console.log("提交" + JSON.stringify(params))
if(this.transferType=="transferIssue"){ if (this.transferType == "TransferDeliver") {
// transferIssueRecordSubmit(params).then(res => { transferIssueRecordSubmit(params).then(res => {
// uni.hideLoading() uni.hideLoading()
// if (res.data) { if (res.data) {
// this.showCommitSuccessMessage("<br>" + res.data, ) this.showCommitSuccessMessage("提交成功<br>生成调拨出库记录<br>" + res.data)
// } else { } else {
// this.showErrorMessage("[" + res.msg + "]") this.showErrorMessage("提交失败[" + res.msg + "]")
// } }
// }).catch(error => { }).catch(error => {
// uni.hideLoading() uni.hideLoading()
// this.showErrorMessage(error) this.showErrorMessage(error)
// }) })
} else if (this.transferType == "TransferReceipt") {
transferReceiptRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成调拨入库记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
}
}else if(this.transferType=="transferReceipt"){ } else {
// transferReceiptRecordSubmit(params).then(res => { uni.hideLoading();
// uni.hideLoading() this.showErrorMessage(res.message);
// if (res.data) { }
// this.showCommitSuccessMessage("<br>" + res.data, )
// } else {
// this.showErrorMessage("[" + res.msg + "]")
// }
// }).catch(error => {
// uni.hideLoading()
// this.showErrorMessage(error)
// })
})
} else {
this.showErrorMessage("没有要提交的数据,请先扫描")
} }
},
setPrecisionStrategParams() {
var itemList = []
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.toLocationCode = this.toLocationCode;
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode &&
detail.toLocationCode == res.locationCode) {
return res
}
})
//
if (filterResult.length == 0) {
var result = {
itemCode: item.itemCode,
locationCode: detail.toLocationCode
}
itemList.push(result)
}
}
})
})
return itemList;
}, },
setParams() { setParams() {
var subList = [] var subList = []
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, var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
// detail.packingNumber, detail.batch); detail.packingNumber, detail.toLocationCode, detail.batch);
// detail.toPackingNumber =info.packingNumber; detail.itemCode = detail.itemCode;
// detail.toBatch =info.batch; detail.itemName = detail.package.itemName;
detail.itemDesc1 = detail.package.itemDesc1;
detail.itemDesc2 = detail.package.itemDesc2;
detail.inventoryStatus = detail.inventoryStatus;
detail.fromPackingNumber = info.packingNumber;
detail.toPackingNumber = info.packingNumber;
detail.fromContainerNumber = detail.containerNumber;
detail.toContainerNumber = detail.containerNumber
detail.fromBatch = info.batch;
detail.toBatch = info.batch;
detail.fromLocationCode = detail.locationCode;
detail.toLocationCode = detail.toLocationCode;
subList.push(detail) subList.push(detail)
} }
}) })
}) })
return subList; this.dataContent.subList = subList;
this.dataContent.creator = creator;
this.dataContent.fromWarehouseCode = this.detailSource[0].subList[0].warehouseCode;
this.dataContent.toWarehouseCode = this.toWarehouseCode;
return this.dataContent;
}, },
@ -333,25 +394,29 @@
this.getFromLocationCode(location, code) this.getFromLocationCode(location, code)
}, },
getFromLocationCode(location, code) { getFromLocationCode(location, code) {
this.fromLocationInfo = location;
this.fromLocationCode = code; this.fromLocationCode = code;
this.openScanPopup(); this.openScanPopup();
}, },
getToLocationCode(location, code) { getToLocationCode(location, code) {
if (this.fromLocationCode == code) { this.toWarehouseCode =location.warehouseCode
uni.showToast({ // if (this.fromLocationCode == code) {
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致", // uni.showToast({
duration: 2000 // title: "[" + this.fromLocationCode + "][" + code + "]",
}) // duration: 2000
return // })
} // return
this.ToLocationCodeInfo = location; // }
this.toLocationCode = code; this.toLocationCode = code;
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
this.fromLocationCode = ''; this.fromLocationCode = '';
this.subList = [];
this.detailSource = [];
this.toLocationCode = '';
this.dataContent = {}
this.toWarehouseCode = ""
}) })
}, },

2
pages/unPlanned/coms/comReceiptRecord.vue

@ -21,7 +21,7 @@
</purchase-label> </purchase-label>
</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>

56
pages/unPlanned/record/issueRecord.vue

@ -7,7 +7,7 @@
<view class="page-main"> <view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<uni-data-picker style="padding: 20rpx; background-color:#fff;" class='uni-data-picker' <uni-data-picker style="padding: 20rpx; background-color:#fff;" class='uni-data-picker'
placeholder="请选择出库原因" popup-title="出库原因" :localdata="reasonList" v-model="reason"> placeholder="请选择出库原因" popup-title="出库原因" :localdata="reasonList" @change="reasonChange">
</uni-data-picker> </uni-data-picker>
<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="">
@ -93,19 +93,20 @@
data() { data() {
return { return {
fromLocationCode: "", fromLocationCode: "",
fromLocationInfo: {},
fromLocationTypeArray: [], fromLocationTypeArray: [],
fromInventoryStatus: [], fromInventoryStatus: [],
toInventoryStatus: [], toInventoryStatus: [],
businessType: {}, // businessType: {}, //
detailSource: [], // detailSource: [], //
reason: "", reasonText: "",
reasonCode:"",
reasonList: [], reasonList: [],
dataContent:{} dataContent:{}
} }
}, },
mounted() { mounted() {
this.reasonList = getUnPlannedIssuseReasonList();
var typeCode = "UnplannedDeliver" var typeCode = "UnplannedDeliver"
getBusinessType(typeCode, res => { getBusinessType(typeCode, res => {
if (res.success) { if (res.success) {
@ -113,7 +114,7 @@
this.fromLocationTypeArray = res.fromlocationTypeList; this.fromLocationTypeArray = res.fromlocationTypeList;
this.showFromLocationPopup(); this.showFromLocationPopup();
} else { } else {
this.$refs.comMessage.showBreakMessage(res.message); this.showErrorMessage(res.message)
} }
}); });
}, },
@ -139,7 +140,6 @@
this.getfromLocationCode(location) this.getfromLocationCode(location)
}, },
getfromLocationCode(location) { getfromLocationCode(location) {
this.fromLocationInfo = location;
this.fromLocationCode = location.code; this.fromLocationCode = location.code;
this.openScanPopup(); this.openScanPopup();
}, },
@ -211,11 +211,12 @@
this.detailSource.splice(index, 1) this.detailSource.splice(index, 1)
}, },
commit() { commit() {
if (this.reason == '') { if (this.reasonText == '') {
this.showErrorMessage("请选择出库原因") this.showErrorMessage("请选择出库原因")
return; return;
} }
var params =this.setParams() var params =this.setParams()
console.log("提交" + JSON.stringify(params))
// unPlannedIssueRecordSubmit(params).then(res => { // unPlannedIssueRecordSubmit(params).then(res => {
// uni.hideLoading() // uni.hideLoading()
// if (res.data) { // if (res.data) {
@ -234,10 +235,26 @@
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.itemCode = detail.itemCode;
// detail.packingNumber, detail.batch); detail.itemName = detail.package.itemName;
// detail.toPackingNumber =info.packingNumber; detail.itemDesc1 = detail.package.itemDesc1;
// detail.toBatch =info.batch; detail.itemDesc2 = detail.package.itemDesc2;
detail.inventoryStatus = detail.inventoryStatus;
detail.fromPackingNumber = detail.packingNumber;
detail.toPackingNumber = detail.packingNumber;
detail.fromContainerNumber = detail.containerNumber;
detail.toContainerNumber = detail.containerNumber
detail.fromBatch = detail.batch;
detail.toBatch = detail.batch;
detail.fromLocationCode = detail.locationCode;
detail.toLocationCode = "";
detail.reason = this.reasonCode;
subList.push(detail) subList.push(detail)
} }
}) })
@ -245,6 +262,25 @@
return subList; return subList;
}, },
reasonChange(e) {
if (e.detail.value.length == 0) {
this.reasonCode = ""
this.reasonText = ""
} else {
this.reasonCode = e.detail.value[0].value
this.reasonText = e.detail.value[0].text
}
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.reasonCode = ""
this.reasonText = "";
this.detailSource = [];
this.managementList =[];
this.dataContent ={}
})
},
} }
} }
</script> </script>

168
pages/unPlanned/record/receiptRecord.vue

@ -8,7 +8,7 @@
<view class="page-main"> <view class="page-main">
<uni-data-picker v-if="detailSource.length>0" style="padding: 20rpx; background-color:#fff;" <uni-data-picker v-if="detailSource.length>0" style="padding: 20rpx; background-color:#fff;"
class='uni-data-picker' placeholder="请选择入库原因" popup-title="入库原因" :localdata="reasonList" class='uni-data-picker' placeholder="请选择入库原因" popup-title="入库原因" :localdata="reasonList"
v-model="reason"> @change="reasonChange">
</uni-data-picker> </uni-data-picker>
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
@ -22,12 +22,13 @@
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
: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"
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationTypeList="tolocationTypeList"></requiredLocation>
</view> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> <button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
@ -66,11 +67,11 @@
import { import {
goHome, goHome,
updateTitle, updateTitle,
getPackingNumberAndBatch getPackingNumberAndBatchByList
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
getManagementPrecisions getPrecisionStrategyList
} from '@/common/balance.js'; } from '@/common/balance.js';
@ -91,15 +92,15 @@
data() { data() {
return { return {
toLocationCode: "", toLocationCode: "",
toLocationInfo: {},
toInventoryStatus: [], toInventoryStatus: [],
businessType: {}, // businessType: {}, //
detailSource: [], // detailSource: [], //
businessTypeCode: "UnplannedReceipt", businessTypeCode: "UnplannedReceipt",
reason: "", reasonText: "",
reasonCode:"",
reasonList: [], reasonList: [],
showToLoaction:true, dataContent:{},
dataContent:{} managementList:[]
} }
}, },
@ -112,7 +113,7 @@
this.tolocationTypeList = res.tolocationTypeList; this.tolocationTypeList = res.tolocationTypeList;
this.openScanPopup(); this.openScanPopup();
} else { } else {
this.$refs.comMessage.showBreakMessage(res.message); this.showErrorMessage(res.message)
} }
}); });
}, },
@ -125,7 +126,6 @@
this.$refs.scanPopup.openScanPopup(); this.$refs.scanPopup.openScanPopup();
}, },
getToLocationCode(location, code) { getToLocationCode(location, code) {
this.toLocationCodeInfo = location;
this.toLocationCode = code; this.toLocationCode = code;
}, },
getScanResult(result) { getScanResult(result) {
@ -188,6 +188,7 @@
label.inventoryStatus = "OK"; label.inventoryStatus = "OK";
detail.package = pack; detail.package = pack;
detail.label = label; detail.label = label;
detail.label.scaned = true
return detail; return detail;
}, },
@ -227,77 +228,138 @@
this.detailSource.splice(index, 1) this.detailSource.splice(index, 1)
}, },
commit() { commit() {
if (this.showToLoaction &&this.toLocationCode == "") { if (this.toLocationCode == "") {
this.showErrorMessage("请先选择目标库位") this.showErrorMessage("请先选择目标库位")
return; return;
} }
if (this.reason == '') { if (this.reasonText == '') {
this.showErrorMessage("请选择入库原因") this.showErrorMessage("请选择入库原因")
return; return;
} }
//
var itemCodes = [] if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
this.detailSource.forEach(item => { //
itemCodes.push(item.itemCode) uni.showLoading({
}) title: "提交中....",
// mask: true
getManagementPrecisions(itemCodes, this.toLocationCode, res => { });
this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams()
getPrecisionStrategyList(precisionStrategParams, 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))
unPlannedReceiptRecordbSubmit(params).then(res => {
// unPlannedReceiptRecordbSubmit(params).then(res => { uni.hideLoading()
// uni.hideLoading() if (res.data) {
// if (res.data) { this.showCommitSuccessMessage("提交成功<br>生成计划外入库记录<br>" + res.data)
// this.showCommitSuccessMessage("<br>" + res.data, ) } else {
// } else { this.showErrorMessage("提交失败[" + res.msg + "]")
// 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);
} }
});
})
}else {
this.showErrorMessage("没有要提交的数据,请先扫描")
}
}, },
setParams(queryModel) { setPrecisionStrategParams() {
var itemList = []
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.toLocationCode = this.toLocationCode;
var filterResult = itemList.filter(res => {
if (res.itemCode == item.itemCode &&
detail.toLocationCode == res.locationCode) {
return res
}
})
//
if (filterResult.length == 0) {
var result = {
itemCode: item.itemCode,
locationCode: detail.toLocationCode
}
itemList.push(result)
}
}
})
})
return itemList;
},
setParams() {
var subList = [] var subList = []
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 = getPackingNumberAndBatchByList(this.managementList, detail.label.itemCode,
// Object.assign(subItem, detail) detail.label.packingNumber, detail.toLocationCode, detail.label.batch);
if (queryModel) {
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, detail.itemCode = detail.package.itemCode;
detail.packingNumber, detail.batch); detail.itemName = detail.package.itemName;
detail.toPackingNumber = info.packingNumber;; detail.itemDesc1 = detail.package.itemDesc1;
detail.toContainerNumber = detail.containerNumber detail.itemDesc2 = detail.package.itemDesc2;
detail.inventoryStatus = detail.inventoryStatus;
detail.fromPackingNumber = info.packingNumber;
detail.toPackingNumber = info.packingNumber;
// detail.fromContainerNumber = detail.containerNumber;
// detail.toContainerNumber = detail.containerNumber
detail.fromBatch = info.batch;
detail.toBatch = info.batch; detail.toBatch = info.batch;
detail.toInventoryStatus = detail.inventoryStatus
detail.toLocationCode = this.toLocationCode detail.fromLocationCode = "";
} else { detail.toLocationCode = detail.toLocationCode;
detail.toPackingNumber = detail.packingNumber;
detail.toContainerNumber = detail.containerNumber detail.reason = this.reasonCode;
detail.toBatch = detail.toBatch;
detail.toInventoryStatus = detail.inventoryStatus
detail.toLocationCode = ""
}
subList.push(detail) subList.push(detail)
} }
}) })
}) })
this.dataContent.subList = subList this.dataContent.subList = subList;
this.dataContent.creator = creator; this.dataContent.creator = creator;
return this.dataContent; return this.dataContent;
}, },
reasonChange(e) {
if (e.detail.value.length == 0) {
this.reasonCode = ""
this.reasonText = ""
} else {
this.reasonCode = e.detail.value[0].value
this.reasonText = e.detail.value[0].text
}
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.reasonCode = ""
this.reasonText = "";
this.detailSource = [];
this.managementList=[];
this.dataContent ={}
this.toLocationCode =""
})
},
} }
} }

Loading…
Cancel
Save