diff --git a/common/calc.js b/common/calc.js
index 358252ee..2b48e481 100644
--- a/common/calc.js
+++ b/common/calc.js
@@ -2,16 +2,16 @@
import { Decimal } from 'decimal.js';//引入
class Calc {
add(num1,num2) {
- return new Decimal(num1).add(new Decimal(num2))
+ return new Decimal(num1).add(new Decimal(num2)).toNumber()
}
sub(num1,num2) {
- return new Decimal(num1).sub(new Decimal(num2))
+ return new Decimal(num1).sub(new Decimal(num2)).toNumber()
}
mul(num1,num2) {
- return new Decimal(num1).mul(new Decimal(num2))
+ return new Decimal(num1).mul(new Decimal(num2)).toNumber()
}
div(num1,num2) {
- return new Decimal(num1).div(new Decimal(num2))
+ return new Decimal(num1).div(new Decimal(num2)).toNumber()
}
}
export const calc = new Calc();
\ No newline at end of file
diff --git a/common/record.js b/common/record.js
index 2e457395..db2b1110 100644
--- a/common/record.js
+++ b/common/record.js
@@ -6,6 +6,10 @@ import {
getDirectoryItemArray,
} from '@/common/directory.js';
import { calc } from '@/common/calc'
+import { Decimal } from 'decimal.js';//引入
+ import {
+ deepCopyData
+ } from '@/common/basic.js';
export function createItemInfo(balance, pack) {
let item = {
@@ -13,25 +17,24 @@ export function createItemInfo(balance, pack) {
itemName: pack.itemName,
stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit,
- qty: Number(balance.qty),
- handleQty: 0,
+ qty: new Decimal(balance.qty).toNumber(),
+ handleQty:new Decimal(0).toNumber(),
uom: pack.uom,
subList: []
}
return item;
}
-export function createDetailInfo(data, pack) {
- data.scaned = true;
+export function createDetailInfo(balance, pack) {
+ balance.scaned = true;
// data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus;
// data.inventoryStatus = data.inventoryStatus;
- let detail = {};
- Object.assign(detail, data)
- detail.balanceQty = Number(detail.qty)
- detail.qty = Number(detail.qty);
- detail.stdPackQty = Number(pack.stdPackQty)
+ let detail = deepCopyData(balance);
+ detail.balanceQty = new Decimal(detail.qty).toNumber()
+ detail.qty = new Decimal(detail.qty).toNumber();
+ detail.stdPackQty = new Decimal(pack.stdPackQty).toNumber()
detail.stdPackUnit = pack.stdPackUnit
- detail.handleQty =0;
+ detail.handleQty = new Decimal(detail.qty).toNumber() ;
detail.package = pack;
return detail;
@@ -40,10 +43,10 @@ export function createDetailInfo(data, pack) {
//计算实际数量
export function calcHandleQty(detailSource) {
for (let item of detailSource) {
- item.qty = 0;
+ item.handleQty = new Decimal(0).toNumber();
for (let detail of item.subList) {
if (detail != undefined && detail.scaned) {
- item.qty = calc.add(item.qty,detail.qty);
+ item.handleQty = calc.add(item.handleQty,detail.handleQty);
}
}
}
diff --git a/mycomponents/item/itemQty.vue b/mycomponents/item/itemQty.vue
index 7eb84b5d..12da2d8a 100644
--- a/mycomponents/item/itemQty.vue
+++ b/mycomponents/item/itemQty.vue
@@ -4,9 +4,9 @@
-
+
+ :handleQty="dataContent.handleQty" :isShowStatus="false">
-
+
diff --git a/pages/container/record/containerUnBindRecord.vue b/pages/container/record/containerUnBindRecord.vue
index cad024aa..881a7fe6 100644
--- a/pages/container/record/containerUnBindRecord.vue
+++ b/pages/container/record/containerUnBindRecord.vue
@@ -301,7 +301,7 @@
detail.itemCode = detail.itemCode;
detail.batch = detail.batch;
detail.inventoryStatus = detail.inventoryStatus;
-
+ detail.qty =detail.handleQty;
detail.package = null;
subList.push(detail)
}
diff --git a/pages/count/job/countDetail.vue b/pages/count/job/countDetail.vue
index bd732f71..38fd4f7b 100644
--- a/pages/count/job/countDetail.vue
+++ b/pages/count/job/countDetail.vue
@@ -106,7 +106,6 @@
return {
id: '',
receiptJob: {},
- received: false,
fromLocationCode: '',
isShowPackingCode: true,
scanCount: 0,
@@ -117,7 +116,8 @@
editInventoryStatus: false,
package: {}, //包装
label: {}, //标签
- currentEditItem: {}
+ currentEditItem: {},
+ jobStatus:""
};
},
onLoad(option) {
@@ -126,7 +126,6 @@
//新建的任务自动接收
if (option.status == "1") {
this.receive((callback => {
- this.received = true;
this.getDetail();
}));
} else {
@@ -144,7 +143,7 @@
onBackPress(e) {
//已经接收但是没提交任务
if (e.from === 'backbutton') {
- if (this.received) {
+ if (this.jobStatus=="2") {
//取消承接任务
cancleTakeCountJob(this.id).then(res => {
uni.navigateBack();
@@ -190,6 +189,7 @@
that.showMessage('未获取到详情');
} else {
that.jobContent = res.data;
+ that.jobStatus = res.data.status;
that.fromLocationCode = that.jobContent.locationCode;
that.subList = res.data.subList;
that.detailSource = that.getDataSource(that.subList)
diff --git a/pages/customerReturn/job/returnDetail.vue b/pages/customerReturn/job/returnDetail.vue
index 2c6f06c9..3b282218 100644
--- a/pages/customerReturn/job/returnDetail.vue
+++ b/pages/customerReturn/job/returnDetail.vue
@@ -82,7 +82,6 @@
data() {
return {
id: '',
- received: false,
scanCount: 0,
jobContent: {}, //任务内容
subList: [], //接口返回的任务subList
@@ -92,6 +91,7 @@
toLocationCode: "",
toLocationInfo: {},
tolocationTypeList: [],
+ jobStatus:""
};
},
onLoad(option) {
@@ -100,7 +100,6 @@
//新建的任务自动接收
if (option.status == "1") {
this.receive((callback => {
- this.received = true;
this.getDetail();
}));
} else {
@@ -118,7 +117,7 @@
onBackPress(e) {
//已经接收但是没提交任务
if (e.from == 'backbutton') {
- if (this.received) {
+ if (this.jobStatus=="2") {
//取消承接任务
cancleTakeCustomerReturnJob(this.id).then(res => {
uni.navigateBack();
@@ -167,8 +166,9 @@
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.subList = res.data.subList;
+ that.jobStatus = res.data.status
+
that.detailSource = getDataSource(that.subList)
-
that.fromLocationCode = that.subList[0].fromLocationCode
that.toLocationCode = that.subList[0].toLocationCode
that.tolocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes)
diff --git a/pages/customerReturn/record/returnRecord.vue b/pages/customerReturn/record/returnRecord.vue
index bfe6611a..aac1152a 100644
--- a/pages/customerReturn/record/returnRecord.vue
+++ b/pages/customerReturn/record/returnRecord.vue
@@ -149,8 +149,10 @@
}
})
if (item == undefined) {
+
var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
+
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
} else {
@@ -316,7 +318,6 @@
},
setParams() {
-
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
@@ -346,7 +347,7 @@
submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode;
- submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
+ submitItem.qty = detail.handleQty;
submitItem.package ="";
subList.push(submitItem)
diff --git a/pages/customerReturn/request/customerReturnRequestCreate.vue b/pages/customerReturn/request/customerReturnRequestCreate.vue
index c91ed6dc..01f1c890 100644
--- a/pages/customerReturn/request/customerReturnRequestCreate.vue
+++ b/pages/customerReturn/request/customerReturnRequestCreate.vue
@@ -56,6 +56,7 @@
-
-
diff --git a/pages/productPutaway/job/productPutawayDetail.vue b/pages/productPutaway/job/productPutawayDetail.vue
index b91b5119..48c2a833 100644
--- a/pages/productPutaway/job/productPutawayDetail.vue
+++ b/pages/productPutaway/job/productPutawayDetail.vue
@@ -102,7 +102,6 @@
data() {
return {
id: '',
- received: false,
scanCount: 0,
jobContent: {}, //任务内容
subList: [], //接口返回的任务subList
@@ -112,6 +111,7 @@
toLocationCode: "",
toLocationInfo: {},
tolocationTypeList: [],
+ jobStatus:""
};
},
onLoad(option) {
@@ -120,7 +120,6 @@
//新建的任务自动接收
if (option.status == "1") {
this.receive((callback => {
- this.received = true;
this.getDetail();
}));
} else {
@@ -138,7 +137,7 @@
onBackPress(e) {
//已经接收但是没提交任务
if (e.from == 'backbutton') {
- if (this.received) {
+ if (this.jobStatus=="2") {
//取消承接任务
cancleTakeProductPutawayJob(this.id).then(res => {
uni.navigateBack();
@@ -183,6 +182,7 @@
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.subList = res.data.subList;
+ that.jobStatus = res.data.status
that.fromLocationCode = that.subList[0].fromLocationCode
that.toLocationCode = that.subList[0].toLocationCode
that.tolocationTypeList = getLocationTypeArray(that.jobContent.toLocationTypes)
diff --git a/pages/productPutaway/record/productPutawayRecord.vue b/pages/productPutaway/record/productPutawayRecord.vue
index 644abbca..76f30d73 100644
--- a/pages/productPutaway/record/productPutawayRecord.vue
+++ b/pages/productPutaway/record/productPutawayRecord.vue
@@ -335,7 +335,7 @@
submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode;
- submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
+ submitItem.qty = detail.handleQty;
submitItem.package ="";
subList.push(submitItem)
}
diff --git a/pages/productPutaway/request/putawayRequestCreate.vue b/pages/productPutaway/request/putawayRequestCreate.vue
index 414b0561..bc89b7b2 100644
--- a/pages/productPutaway/request/putawayRequestCreate.vue
+++ b/pages/productPutaway/request/putawayRequestCreate.vue
@@ -53,6 +53,7 @@
import {
goHome,
updateTitle,
+ deepCopyData,
getCurrDateTime,
getPackingNumberAndBatchByList
} from '@/common/basic.js';
@@ -210,14 +211,7 @@
},
calcHandleQty() {
- for (let item of this.detailSource) {
- item.qty = 0;
- for (let detail of item.subList) {
- if (detail != undefined) {
- item.qty = calc.add(item.qty,detail.qty)
- }
- }
- }
+ calcHandleQty(this.detailSource)
this.$forceUpdate();
},
@@ -283,7 +277,7 @@
productPutawayRequestSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
- this.showCommitSuccessMessage("提交成功
生成制品上架申请
" + res.data, )
+ this.showCommitSuccessMessage("提交成功
生成制品上架申请
" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
@@ -305,8 +299,7 @@
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
- var subItem = {};
- Object.assign(subItem, detail)
+ var subItem = deepCopyData(detail)
subItem.fromLocationCode = detail.locationCode;
subItem.qty = detail.handleQty;
subItem.package = null;
diff --git a/pages/productReceipt/job/productReceiptDetail.vue b/pages/productReceipt/job/productReceiptDetail.vue
index b4e75298..1d413251 100644
--- a/pages/productReceipt/job/productReceiptDetail.vue
+++ b/pages/productReceipt/job/productReceiptDetail.vue
@@ -97,7 +97,6 @@
return {
id: '',
receiptJob: {},
- received: false,
toLocationCode: '',
isShowPackingCode: true,
scanCount: 0,
@@ -105,7 +104,8 @@
subList: [], //接口返回的任务subList
detailSource: [], //绑定在页面上的数据源
toLocationTypeList: [],
- managementList: []
+ managementList: [],
+ jobStatus:""
};
},
@@ -115,7 +115,6 @@
//新建的任务自动接收
if (option.status == "1") {
this.receive((callback => {
- this.received = true;
this.getDetail();
}));
} else {
@@ -134,7 +133,7 @@
onBackPress(e) {
//已经接收但是没提交任务
if (e.from == 'backbutton') {
- if (this.received) {
+ if (this.jobStatus=="2") {
//取消承接任务
cancleTakeProductReceiptJob(this.id).then(res => {
uni.navigateBack();
@@ -184,6 +183,7 @@
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.subList = res.data.subList;
+ that.jobStatus = res.data.status
that.toLocationCode = that.subList[0].toLocationCode
that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes)
that.detailSource = getDataSource(that.subList)
diff --git a/pages/productReceipt/record/productReceiptRecord.vue b/pages/productReceipt/record/productReceiptRecord.vue
index f6495709..e1d9b0c2 100644
--- a/pages/productReceipt/record/productReceiptRecord.vue
+++ b/pages/productReceipt/record/productReceiptRecord.vue
@@ -64,6 +64,8 @@
import {
calc
} from '@/common/calc.js';
+
+ import { Decimal } from 'decimal.js';//引入
import {
getInventoryStatusDesc,
@@ -186,8 +188,8 @@
itemName: pack.itemName,
stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit,
- qty: Number(label.qty),
- handleQty: 0,
+ qty: new Decimal(label.qty).toNumber(),
+ handleQty: new Decimal(0).toNumber(),
uom: pack.uom,
subList: []
}
@@ -195,11 +197,10 @@
},
createDetailInfo(label, pack) {
- let detail = {};
- Object.assign(detail, label)
+ let detail = deepCopyData(label);
detail.scaned = true;
- detail.qty = Number(label.qty);
- detail.handleQty = 0;
+ detail.qty = new Decimal(label.qty).toNumber();
+ detail.handleQty = new Decimal(label.qty).toNumber();
detail.inventoryStatus = "OK"
detail.stdPackQty = pack.stdPackQty;
detail.stdPackUnit = pack.stdPackUnit;
@@ -211,10 +212,10 @@
calcHandleQty() {
for (let item of this.detailSource) {
- item.qty = 0;
+ item.handleQty = new Decimal(0).toNumber();
for (let detail of item.subList) {
if (detail != undefined) {
- item.qty = calc.add(item.qty,detail.qty)
+ item.handleQty = calc.add(item.handleQty,detail.handleQty)
}
}
}
@@ -331,7 +332,7 @@
submitItem.productionlineCode = this.productionLineCode;
submitItem.workStationCode = this.workStationCode;
- submitItem.qty = detail.handleQty != 0 ? detail.handleQty : detail.qty;
+ submitItem.qty = detail.handleQty;
submitItem.package = "";
subList.push(submitItem)
diff --git a/pages/productionReceipt/job/productionReceiptDetail.vue b/pages/productionReceipt/job/productionReceiptDetail.vue
index 2c6bef2f..e724635b 100644
--- a/pages/productionReceipt/job/productionReceiptDetail.vue
+++ b/pages/productionReceipt/job/productionReceiptDetail.vue
@@ -100,7 +100,6 @@
data() {
return {
id: '',
- received: false,
scanCount: 0,
jobContent: {}, //任务内容
subList: [], //接口返回的任务subList
@@ -109,6 +108,7 @@
fromLocationCode: "",
toLocationCode: "",
tolocationTypeList: [],
+ jobStatus:""
};
},
onLoad(option) {
@@ -117,7 +117,6 @@
//新建的任务自动接收
if (option.status == "1") {
this.receive((callback => {
- this.received = true;
this.getDetail();
}));
} else {
@@ -135,7 +134,7 @@
onBackPress(e) {
//已经接收但是没提交任务
if (e.from == 'backbutton') {
- if (this.received) {
+ if (this.jobStatus=="2") {
//取消承接任务
cancleTakeProductionReceiptJob(this.id).then(res => {
uni.navigateBack();
@@ -179,6 +178,7 @@
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
+ that.jobStatus = res.data.status
that.subList = res.data.subList;
that.fromLocationCode = that.subList[0].fromLocationCode
that.toLocationCode = that.subList[0].toLocationCode
diff --git a/pages/productionReceipt/record/productionReceiptRecord.vue b/pages/productionReceipt/record/productionReceiptRecord.vue
index 6a51526b..593a1b6c 100644
--- a/pages/productionReceipt/record/productionReceiptRecord.vue
+++ b/pages/productionReceipt/record/productionReceiptRecord.vue
@@ -316,6 +316,7 @@
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.fromLocationCode = '';
+ this.toLocationCode =""
})
},
diff --git a/pages/productionReturn/coms/comReturnRecord.vue b/pages/productionReturn/coms/comReturnRecord.vue
index b201da49..0f8d156a 100644
--- a/pages/productionReturn/coms/comReturnRecord.vue
+++ b/pages/productionReturn/coms/comReturnRecord.vue
@@ -5,8 +5,7 @@
-
+
@@ -17,7 +16,7 @@
+ :isShowFromLocation="isShowFromLocation" :isShowToLocation="isShowToLocation">
@@ -86,6 +85,10 @@
isShowToLocation: {
type: Boolean,
default: true
+ },
+ isShowFromLocation: {
+ type: Boolean,
+ default: true
}
},
watch: {
@@ -147,7 +150,7 @@
edit(item) {
this.editItem = item;
- this.$refs.recommendQtyEdit.openRecordEditPopup(item.qty);
+ this.$refs.recommendQtyEdit.openRecordEditPopup(item.handleQty);
// this.$refs.recommendQtyEdit.openEditPopup(item.qty);
},
@@ -165,7 +168,7 @@
});
},
confirm(qty) {
- this.editItem.qty = qty;
+ this.editItem.handleQty = qty;
this.$emit('updateData')
}
}
diff --git a/pages/productionReturn/coms/comReturnRequestPopup.vue b/pages/productionReturn/coms/comReturnRequestPopup.vue
index b5f64d18..344432cd 100644
--- a/pages/productionReturn/coms/comReturnRequestPopup.vue
+++ b/pages/productionReturn/coms/comReturnRequestPopup.vue
@@ -28,7 +28,7 @@
- 箱码:
+ 物料:
{{itemCode}}
@@ -46,10 +46,13 @@
数量 :
-
-
+
+
+
+ ()
+
@@ -63,7 +66,7 @@
-
+
@@ -82,6 +85,7 @@
checkDirectoryItemExist
} from '@/common/directory.js';
import uom from '@/mycomponents/qty/uom.vue'
+ import stdPackQty from '@/mycomponents/qty/stdPackQty.vue'
import balanceStatus from '@/mycomponents/status/balanceStatus.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanItem from '@/mycomponents/scan/winScanItem.vue'
@@ -90,6 +94,7 @@
export default {
components: {
uom,
+ stdPackQty,
balanceStatus,
comMessage,
winScanItem
@@ -120,6 +125,8 @@
show: false,
isModifiedPosition: true,
positionList: [],
+ maxlength:10,
+ stdPackInfo:undefined,
list: [{
value: 1,
label: '车间1',
@@ -193,6 +200,21 @@
},
},
methods: {
+ checkNum(e) {
+ let value = e.detail.value;
+ let dot = value.indexOf('.'); //包含小数点
+ let reg = /^[0-9]+$/; //正整数
+ if (dot > -1) {
+ this.maxlength = dot + 7; //长度是小数点后两位
+ if (value.length > dot + 7) {
+
+ }
+ }
+ if (reg.test(value)) { //如果是正整数不包含小数点
+ this.maxlength = 10;
+ }
+ this.change(value)
+ },
openRequestPopup(editPosition) {
if (this.positionList.length == 0) {
getWorkShopLineStation().then(res => {
@@ -352,13 +374,14 @@
}
},
- getScanCode(code) {
+ getScanCode(code, scanResult) {
if (code == "") {
this.showErrorMessage('物料号不能为空')
return;
}
this.itemCode = "";
this.checkItemCode(code)
+ this.stdPackInfo = scanResult.package;
},
}
diff --git a/pages/productionReturn/job/returnDetail.vue b/pages/productionReturn/job/returnDetail.vue
index 2233601c..5542c093 100644
--- a/pages/productionReturn/job/returnDetail.vue
+++ b/pages/productionReturn/job/returnDetail.vue
@@ -104,7 +104,6 @@
return {
id: '',
jobContent: {},
- received: false,
toLocationCode: '',
scanCount: 0,
jobContent: {}, //任务内容
@@ -115,7 +114,8 @@
toLocationTypeList: [],
toLocationInfo: {},
businessTypeInfo: {},
- titleInfo: ""
+ titleInfo: "",
+ jobStatus:""
};
},
onLoad(option) {
@@ -124,7 +124,6 @@
// //新建的任务自动接收
if (option.status == "1") {
this.receive((callback => {
- this.received = true;
this.getDetail();
}));
} else {
@@ -142,7 +141,7 @@
onBackPress(e) {
//已经接收但是没提交任务
if (e.from == 'backbutton') {
- if (this.received) {
+ if (this.jobStatus=="2") {
//取消承接任务
cancleTakeProductionReturnJob(this.id).then(res => {
uni.navigateBack();
@@ -190,6 +189,7 @@
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
+ that.jobStatus = res.data.status
that.subList = res.data.subList;
that.detailSource = getDataSource(that.subList)
diff --git a/pages/productionReturn/record/returnToHold.vue b/pages/productionReturn/record/returnToHold.vue
index e92aff05..838656d2 100644
--- a/pages/productionReturn/record/returnToHold.vue
+++ b/pages/productionReturn/record/returnToHold.vue
@@ -62,11 +62,15 @@
getPackingNumberAndBatchByList,
deepCopyData
} from '@/common/basic.js';
-
+
import {
calc
} from '@/common/calc.js';
+ import {
+ Decimal
+ } from 'decimal.js'; //引入
+
import {
getDirectoryItemArray
} from '@/common/directory.js';
@@ -168,7 +172,7 @@
this.$refs.scanPopup.openScanPopup(isEditPosition);
},
- async getScanResult(result, param) {
+ async getScanResult(result, param) {
this.positionInfo = param.positionInfo;
this.workshopCode = param.workshopCode;
this.productionLineCode = param.productionLineCode;
@@ -186,30 +190,30 @@
if (item == undefined) {
var filters = []
- filters.push({
- column: "itemCode",
- action: "==",
- value: label.itemCode
- })
- filters.push({
- column: "locationCode",
- action: "==",
- value: this.rawLocationCode
- })
-
- var params = {
- filters: filters,
- pageNo: 1,
- pageSize: 100,
- }
- var isCheckItemCode = await getBalanceByFilter(params);
- if(isCheckItemCode.data==null||isCheckItemCode.data.list==0){
+ filters.push({
+ column: "itemCode",
+ action: "==",
+ value: label.itemCode
+ })
+ filters.push({
+ column: "locationCode",
+ action: "==",
+ value: this.rawLocationCode
+ })
+
+ var params = {
+ filters: filters,
+ pageNo: 1,
+ pageSize: 100,
+ }
+ var isCheckItemCode = await getBalanceByFilter(params);
+ if (isCheckItemCode.data == null || isCheckItemCode.data.list == 0) {
this.showErrorMessage("未查询到物料号[" + label.itemCode + "]" +
- "库位[" + this.rawLocationCode + "]的信息")
- return
+ "库位[" + this.rawLocationCode + "]的信息")
+ return
}
-
-
+
+
var itemp = this.createItemInfo(label, pack);
let newDetail = this.createDetailInfo(label, pack);
newDetail.toLocationCode = "HOLD";
@@ -247,8 +251,8 @@
itemName: pack.itemName,
stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit,
- qty: Number(label.qty),
- handleQty: 0,
+ qty: new Decimal(label.qty).toNumber(),
+ handleQty: new Decimal(0).toNumber(),
uom: pack.uom,
subList: []
}
@@ -256,11 +260,10 @@
},
createDetailInfo(label, pack) {
- let detail = {};
- Object.assign(detail, label)
+ let detail = deepCopyData(label);
detail.scaned = true;
- detail.qty = Number(label.qty);
- detail.handleQty = 0;
+ detail.qty = new Decimal(label.qty).toNumber();
+ detail.handleQty = new Decimal(label.qty).toNumber();
detail.inventoryStatus = "OK"
detail.stdPackQty = pack.stdPackQty;
detail.stdPackUnit = pack.stdPackUnit;
@@ -273,10 +276,10 @@
calcHandleQty() {
for (let item of this.detailSource) {
- item.qty = 0;
+ item.handleQty = new Decimal(0).toNumber();
for (let detail of item.subList) {
if (detail != undefined) {
- item.qty = calc.add(item.qty,detail.qty)
+ item.handleQty = calc.add(item.handleQty, detail.handleQty)
}
}
}
@@ -361,7 +364,7 @@
}
},
-
+
setFromPrecisionStrategParams() {
var itemList = []
this.detailSource.forEach(item => {
@@ -381,13 +384,13 @@
}
itemList.push(result)
}
-
+
}
})
})
return itemList;
},
-
+
setToPrecisionStrategParams() {
var itemList = []
this.detailSource.forEach(item => {
@@ -407,7 +410,7 @@
}
itemList.push(result)
}
-
+
}
})
})
@@ -421,35 +424,37 @@
item.subList.forEach(detail => {
if (detail.scaned) {
var submitItem = deepCopyData(detail)
- var fromInfo = getPackingNumberAndBatchByList(this.fromManagementList, detail.itemCode,
+ var fromInfo = getPackingNumberAndBatchByList(this.fromManagementList, detail
+ .itemCode,
detail.packingNumber, detail.fromLocationCode, detail.batch);
- var toInfo = getPackingNumberAndBatchByList(this.fromManagementList, detail.itemCode,
+ var toInfo = getPackingNumberAndBatchByList(this.fromManagementList, detail
+ .itemCode,
detail.packingNumber, detail.toLocationCode, detail.batch);
-
+
submitItem.itemCode = detail.itemCode;
submitItem.itemName = detail.package.itemName;
submitItem.itemDesc1 = detail.package.itemDesc1;
submitItem.itemDesc2 = detail.package.itemDesc2;
-
+
submitItem.inventoryStatus = detail.inventoryStatus;
-
+
submitItem.fromPackingNumber = fromInfo.packingNumber;
submitItem.toPackingNumber = toInfo.packingNumber;
-
+
submitItem.fromContainerNumber = detail.containerNumber;
submitItem.toContainerNumber = detail.containerNumber
-
+
submitItem.fromBatch = fromInfo.batch;
submitItem.toBatch = toInfo.batch;
-
+
submitItem.fromLocationCode = detail.fromLocationCode;
submitItem.toLocationCode = detail.toLocationCode;
-
+
submitItem.productionlineCode = this.productionLineCode;
submitItem.workStationCode = this.workStationCode;
-
- submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
-
+
+ submitItem.qty = detail.handleQty;
+
subList.push(submitItem)
}
})
diff --git a/pages/productionReturn/record/returnToStore.vue b/pages/productionReturn/record/returnToStore.vue
index 98672fb1..70a0c112 100644
--- a/pages/productionReturn/record/returnToStore.vue
+++ b/pages/productionReturn/record/returnToStore.vue
@@ -15,6 +15,7 @@
@@ -61,6 +62,8 @@
import {
calc
} from '@/common/calc.js';
+
+ import { Decimal } from 'decimal.js';//引入
import {
getBusinessType,
@@ -212,9 +215,11 @@
let newDetail = this.createDetailInfo(label, pack);
newDetail.toLocationCode = toLocation.code;
newDetail.fromLocationCode = this.rawLocationCode;
+ newDetail.locationCode = this.rawLocationCode;
newDetail.toWarehouseCode = toLocation.warehouseCode;
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
+ this.calcHandleQty();
})
} else {
@@ -232,6 +237,7 @@
newDetail.fromLocationCode = this.rawLocationCode;
newDetail.toWarehouseCode = toLocation.warehouseCode;
item.subList.push(newDetail);
+ this.calcHandleQty();
});
} else {
@@ -240,7 +246,6 @@
}
}
}
- this.calcHandleQty();
},
createItemInfo(label, pack) {
let item = {
@@ -248,8 +253,8 @@
itemName: pack.itemName,
stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit,
- qty: Number(label.qty),
- handleQty: 0,
+ qty: new Decimal(label.qty).toNumber(),
+ handleQty: new Decimal(0).toNumber(),
uom: pack.uom,
subList: []
}
@@ -257,11 +262,10 @@
},
createDetailInfo(label, pack) {
- let detail = {};
- Object.assign(detail, label)
+ let detail = deepCopyData(label);
detail.scaned = true;
- detail.qty = Number(label.qty);
- detail.handleQty =0;
+ detail.qty = new Decimal(label.qty).toNumber();
+ detail.handleQty = new Decimal(label.qty).toNumber();
detail.inventoryStatus = "OK"
detail.stdPackQty = pack.stdPackQty;
detail.stdPackUnit = pack.stdPackUnit;
@@ -274,10 +278,10 @@
calcHandleQty() {
for (let item of this.detailSource) {
- item.qty = 0;
+ item.handleQty = new Decimal(0).toNumber();
for (let detail of item.subList) {
if (detail != undefined) {
- item.qty = calc.add(item.qty,detail.qty)
+ item.handleQty = calc.add(item.handleQty,detail.handleQty)
}
}
}
@@ -293,6 +297,8 @@
var item = this.detailSource[i];
if (item.subList.length == 0) {
this.detailSource.splice(i, 1)
+ this.clearData();
+ this.$refs.scanPopup.initData();
}
}
this.updateData();
@@ -387,7 +393,6 @@
this.showErrorMessage("没有要提交的数据,请先扫描")
}
-
},
setFromPrecisionStrategParams() {
@@ -477,7 +482,7 @@
submitItem.productionlineCode = this.productionLineCode;
submitItem.workStationCode = this.workStationCode;
- submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
+ submitItem.qty = detail.handleQty;
subList.push(submitItem)
}
})
@@ -530,6 +535,7 @@
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.clearData();
+ this.$refs.scanPopup.initData();
})
},
clearData() {
diff --git a/pages/purchaseReceipt/job/receiptDetail.vue b/pages/purchaseReceipt/job/receiptDetail.vue
index abb8f91c..15acf5c7 100644
--- a/pages/purchaseReceipt/job/receiptDetail.vue
+++ b/pages/purchaseReceipt/job/receiptDetail.vue
@@ -95,7 +95,6 @@
return {
id: '',
receiptJob: {},
- received: false,
scanCount: 0,
jobContent: {}, //任务内容
subList: [], //接口返回的任务subList
@@ -104,7 +103,8 @@
toLocationCode: '',
toLocationInfo: {},
businessTypeInfo: {},
- managementList: []
+ managementList: [],
+ jobStatus:""
};
},
onLoad(option) {
@@ -113,7 +113,6 @@
//新建的任务自动接收
if (option.status == "1") {
this.receive((callback => {
- this.received = true;
this.getDetail();
}));
} else {
@@ -131,7 +130,7 @@
onBackPress(e) {
//已经接收但是没提交任务
if (e.from == 'backbutton') {
- if (this.received) {
+ if (this.jobStatus=="2") {
//取消承接任务
cancleTakePurchaseReceiptJob(this.id).then(res => {
uni.navigateBack();
@@ -187,7 +186,8 @@
that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes);
// that.jobContent.toLocationTypeList = that.toLocationTypeList;
that.subList = res.data.subList;
- this.toLocationCode = that.subList[0].toLocationCode
+ that.jobStatus = res.data.status
+ that.toLocationCode = that.subList[0].toLocationCode
that.detailSource = getDataSource(that.subList)
} else {
that.showMessage('列表数据为0');
diff --git a/pages/purchaseReturn/job/returnDetail.vue b/pages/purchaseReturn/job/returnDetail.vue
index dd2b8ca1..fbf9651b 100644
--- a/pages/purchaseReturn/job/returnDetail.vue
+++ b/pages/purchaseReturn/job/returnDetail.vue
@@ -90,13 +90,13 @@
data() {
return {
id: '',
- received: false,
scanCount: 0,
jobContent: {}, //任务内容
subList: [], //接口返回的任务subList
detailSource: [], //绑定在页面上的数据源
businessTypeInfo: {},
- managementList: []
+ managementList: [],
+ jobStatus:""
};
},
onLoad(option) {
@@ -105,7 +105,6 @@
//新建的任务自动接收
if (option.status == "1") {
this.receive((callback => {
- this.received = true;
this.getDetail();
}));
} else {
@@ -123,7 +122,7 @@
onBackPress(e) {
//已经接收但是没提交任务
if (e.from == 'backbutton') {
- if (this.received) {
+ if (this.jobStatus=="2") {
//取消承接任务
cancleTakePurchasereturnJob(this.id).then(res => {
uni.navigateBack();
@@ -179,6 +178,7 @@
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
+ that.jobStatus = res.data.status
that.subList = res.data.subList;
that.toLocationCode = that.jobContent.toLocationCode
that.detailSource = getDataSource(that.subList);
diff --git a/pages/purchaseReturn/record/returnRecord.vue b/pages/purchaseReturn/record/returnRecord.vue
index 96d41864..68f60fce 100644
--- a/pages/purchaseReturn/record/returnRecord.vue
+++ b/pages/purchaseReturn/record/returnRecord.vue
@@ -241,7 +241,6 @@
});
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
- console.log("提交参数", JSON.stringify(params));
//直接创建申请
//直接创建记录
@@ -254,7 +253,7 @@
if (res.data) {
this.showCommitSuccessMessage("提交成功
生成采购退货记录
" + res.data)
} else {
- this.showErrorMessage("提交失败" + res.msg)
+ this.showErrorMessage("提交失败[" + res.msg+"]")
}
}).catch(error => {
uni.hideLoading()
@@ -290,7 +289,7 @@
submitItem.fromLocationCode = this.fromLocationCode;
submitItem.toLocationCode = ''; //采购退货直接出库,目标库位为空
- submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
+ submitItem.qty = detail.handleQty;
submitItem.package = "";
subList.push(submitItem)
}
diff --git a/pages/purchaseReturn/request/returnRequestCreate.vue b/pages/purchaseReturn/request/returnRequestCreate.vue
index 11f8fde1..3bc74428 100644
--- a/pages/purchaseReturn/request/returnRequestCreate.vue
+++ b/pages/purchaseReturn/request/returnRequestCreate.vue
@@ -45,6 +45,7 @@
goHome,
updateTitle,
navigateBack,
+ deepCopyData,
getCurrDateOneMonthsTimes
} from '@/common/basic.js';
@@ -209,7 +210,6 @@
commit() {
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
- console.log("提交参数", JSON.stringify(params));
uni.showLoading({
title: "提交中....",
mask: true
@@ -240,11 +240,13 @@
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
+ var submitItem = deepCopyData(detail)
if(supplierCode==""){
supplierCode = detail.package.supplierCode
}
- detail.fromLocationCode = detail.locationCode
- subList.push(detail)
+ submitItem.fromLocationCode = detail.locationCode
+ submitItem.qty =detail.handleQty;
+ subList.push(submitItem)
}
})
})
diff --git a/pages/putaway/job/putawayDetail.vue b/pages/putaway/job/putawayDetail.vue
index 86b9e627..94086972 100644
--- a/pages/putaway/job/putawayDetail.vue
+++ b/pages/putaway/job/putawayDetail.vue
@@ -97,7 +97,6 @@
data() {
return {
id: '',
- received: false,
scanCount: 0,
jobContent: {}, //任务内容
subList: [], //接口返回的任务subList
@@ -106,6 +105,7 @@
fromLocationCode: "",
toLocationCode: "",
tolocationTypeList: [],
+ jobStatus:""
};
},
onLoad(option) {
@@ -114,7 +114,6 @@
//新建的任务自动接收
if (option.status == "1") {
this.receive((callback => {
- this.received = true;
this.getDetail();
}));
} else {
@@ -132,7 +131,7 @@
onBackPress(e) {
//已经接收但是没提交任务
if (e.from == 'backbutton') {
- if (this.received) {
+ if (this.jobStatus=="2") {
//取消承接任务
cancleTakePutawayJob(this.id).then(res => {
uni.navigateBack();
@@ -180,6 +179,7 @@
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
+ that.jobStatus = res.data.status
that.subList = res.data.subList;
that.detailSource = getDataSource(that.subList)
diff --git a/pages/putaway/record/putawayRecord.vue b/pages/putaway/record/putawayRecord.vue
index 78ccda98..3f50079f 100644
--- a/pages/putaway/record/putawayRecord.vue
+++ b/pages/putaway/record/putawayRecord.vue
@@ -386,7 +386,7 @@
// detail.toInventoryStatus = detail.inventoryStatus
// detail.toLocationCode = detail.toLocationCode
- submitItem.qty = detail.handleQty != 0 ? detail.handleQty : detail.qty;
+ submitItem.qty = detail.handleQty ;
submitItem.package = "";
subList.push(submitItem)
}
diff --git a/pages/repleinsh/coms/comRepleinshRequestPopup.vue b/pages/repleinsh/coms/comRepleinshRequestPopup.vue
index aa1ca50d..2585a16f 100644
--- a/pages/repleinsh/coms/comRepleinshRequestPopup.vue
+++ b/pages/repleinsh/coms/comRepleinshRequestPopup.vue
@@ -44,10 +44,14 @@
数量:
-
-
+
+
+
+ ()
+
+
@@ -60,7 +64,7 @@
-
+
-1) {
+ this.maxlength = dot + 7; //长度是小数点后两位
+ if (value.length > dot + 7) {
+
+ }
+ }
+ if (reg.test(value)) { //如果是正整数不包含小数点
+ this.maxlength = 10;
+ }
+ this.change(value)
+ },
openRequestPopup(editPosition) {
// this.editPosition = editPosition;
// if (this.isModifiedPosition) {
@@ -237,13 +261,14 @@
this.closeRequestPopup();
},
- getScanCode(code) {
+ getScanCode(code, scanResult) {
if (code == "") {
this.showErrorMessage('物料号不能为空')
return;
}
this.itemCode = "";
this.checkItemCode(code)
+ this.stdPackInfo = scanResult.package;
},
getLocationCode(location, code) {
diff --git a/pages/repleinsh/job/repleinshDetail.vue b/pages/repleinsh/job/repleinshDetail.vue
index d87aaee3..10d7b1ea 100644
--- a/pages/repleinsh/job/repleinshDetail.vue
+++ b/pages/repleinsh/job/repleinshDetail.vue
@@ -100,7 +100,7 @@
scanOptions: [],
toLocationCode: '',
tolocationTypeList: [],
- received:false,
+ jobStatus:""
};
},
@@ -114,7 +114,6 @@
//新建的任务自动接收
if (option.status == "1") {
this.receive((callback => {
- this.received = true;
this.getDetail();
}));
} else {
@@ -133,7 +132,7 @@
onBackPress(e) {
//已经接收但是没提交任务
if (e.from === 'backbutton') {
- if (this.received) {
+ if (this.jobStatus=="2") {
//取消承接任务
cancleTakeRepleinshJob(this.id).then(res => {
uni.navigateBack();
@@ -183,6 +182,7 @@
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
+ that.jobStatus = res.data.status
that.subList = res.data.subList;
that.toLocationCode = that.subList[0].toLocationCode
that.tolocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes)
diff --git a/pages/repleinsh/record/repleinshRecord.vue b/pages/repleinsh/record/repleinshRecord.vue
index f2b87b99..5db4e85a 100644
--- a/pages/repleinsh/record/repleinshRecord.vue
+++ b/pages/repleinsh/record/repleinshRecord.vue
@@ -72,8 +72,6 @@
import {
getBusinessType,
- createItemInfo,
- createDetailInfo,
calcHandleQty
} from '@/common/record.js';
diff --git a/pages/scrap/job/scrapJobDetail.vue b/pages/scrap/job/scrapJobDetail.vue
index bedb7caf..f7d26be5 100644
--- a/pages/scrap/job/scrapJobDetail.vue
+++ b/pages/scrap/job/scrapJobDetail.vue
@@ -86,14 +86,14 @@
return {
id: '',
receiptJob: {},
- received: false,
scanCount: 0,
jobContent: {}, //任务内容
subList: [], //接口返回的任务subList
detailSource: [], //绑定在页面上的数据源
toLocationInfo: {},
businessTypeInfo: {},
- managementList: []
+ managementList: [],
+ jobStatus:""
};
},
onLoad(option) {
@@ -102,7 +102,6 @@
//新建的任务自动接收
if (option.status == "1") {
this.receive((callback => {
- this.received = true;
this.getDetail();
}));
} else {
@@ -120,7 +119,7 @@
onBackPress(e) {
//已经接收但是没提交任务
if (e.from == 'backbutton') {
- if (this.received) {
+ if (this.jobStatus=="2") {
//取消承接任务
cancleTakeScrapJob(this.id).then(res => {
uni.navigateBack();
@@ -173,6 +172,7 @@
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
+ that.jobStatus = res.data.status
that.subList = res.data.subList;
that.detailSource = getDataSource(that.subList)
} else {
diff --git a/pages/scrap/record/scrapRecord.vue b/pages/scrap/record/scrapRecord.vue
index 827a5728..70b0ffb0 100644
--- a/pages/scrap/record/scrapRecord.vue
+++ b/pages/scrap/record/scrapRecord.vue
@@ -18,7 +18,7 @@
@@ -176,20 +176,6 @@
},
- createItemInfo(balance, pack) {
- let item = {
- itemCode: balance.itemCode,
- itemName: pack.itemName,
- stdPackQty: pack.stdPackQty,
- stdPackUnit: pack.stdPackUnit,
- qty: Number(balance.qty),
- handleQty: 0,
- uom: pack.uom,
- subList: []
- }
- return item;
- },
-
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
@@ -297,7 +283,7 @@
submitItem.toLocationCode = "";
submitItem.reason = this.reasonCode;
- submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
+ submitItem.qty = detail.handleQty;
submitItem.package ="";
subList.push(submitItem)
}
diff --git a/pages/scrap/request/scrapRequestCreate.vue b/pages/scrap/request/scrapRequestCreate.vue
index 8d55339b..0192e97f 100644
--- a/pages/scrap/request/scrapRequestCreate.vue
+++ b/pages/scrap/request/scrapRequestCreate.vue
@@ -17,7 +17,9 @@
diff --git a/pages/transfer/job/issueDetail.vue b/pages/transfer/job/issueDetail.vue
index bd19fe7c..53d1f954 100644
--- a/pages/transfer/job/issueDetail.vue
+++ b/pages/transfer/job/issueDetail.vue
@@ -92,7 +92,6 @@
data() {
return {
id: '',
- received: false,
scanCount: 0,
jobContent: {}, //任务内容
subList: [], //接口返回的任务subList
@@ -100,7 +99,8 @@
toLocationCode: "",
businessTypeInfo: {},
managementList: [],
- tolocationTypeList:[]
+ tolocationTypeList:[],
+ jobStatus:""
};
},
onLoad(option) {
@@ -109,7 +109,6 @@
// //新建的任务自动接收
if (option.status == "1") {
this.receive((callback => {
- this.received = true;
this.getDetail();
}));
} else {
@@ -127,7 +126,7 @@
onBackPress(e) {
//已经接收但是没提交任务
if (e.from == 'backbutton') {
- if (this.received) {
+ if (this.jobStatus=="2") {
//取消承接任务
cancleTakeTransferIssueJob(this.id).then(res => {
uni.navigateBack();
@@ -182,6 +181,7 @@
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
+ that.jobStatus = res.data.status
that.subList =res.data.subList
that.detailSource = getDataSource(that.subList)
that.fromLocationCode = that.subList[0].fromLocationCode
diff --git a/pages/transfer/job/receiptDetail.vue b/pages/transfer/job/receiptDetail.vue
index c137c692..ce6ac0d1 100644
--- a/pages/transfer/job/receiptDetail.vue
+++ b/pages/transfer/job/receiptDetail.vue
@@ -101,7 +101,6 @@
data() {
return {
id: '',
- received: false,
scanCount: 0,
jobContent: {}, //任务内容
subList: [], //接口返回的任务subList
@@ -109,7 +108,8 @@
toLocationCode: "",
businessTypeInfo: {},
managementList: [],
- toLocationTypeList: []
+ toLocationTypeList: [],
+ jobStatus:""
};
},
onLoad(option) {
@@ -118,7 +118,6 @@
// //新建的任务自动接收
if (option.status == "1") {
this.receive((callback => {
- this.received = true;
this.getDetail();
}));
} else {
@@ -136,7 +135,7 @@
onBackPress(e) {
//已经接收但是没提交任务
if (e.from == 'backbutton') {
- if (this.received) {
+ if (this.jobStatus=="2") {
//取消承接任务
cancleTakeTransferReceiptJob(this.id).then(res => {
uni.navigateBack();
@@ -192,6 +191,7 @@
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
+ that.jobStatus = res.data.status
that.subList = res.data.subList;
that.detailSource = getDataSource(that.subList)
that.fromLocationCode = that.subList[0].fromLocationCode
diff --git a/pages/transfer/record/deliverRecord.vue b/pages/transfer/record/deliverRecord.vue
index 910d99ce..8baebdd1 100644
--- a/pages/transfer/record/deliverRecord.vue
+++ b/pages/transfer/record/deliverRecord.vue
@@ -334,7 +334,7 @@
submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode;
- submitItem.qty = detail.handleQty != 0 ? detail.handleQty : detail.qty;
+ submitItem.qty = detail.handleQty;
submitItem.package = "";
subList.push(submitItem)
diff --git a/pages/transfer/record/receiptRecord.vue b/pages/transfer/record/receiptRecord.vue
index ddd98c2d..601d7952 100644
--- a/pages/transfer/record/receiptRecord.vue
+++ b/pages/transfer/record/receiptRecord.vue
@@ -316,7 +316,7 @@
submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode;
- submitItem.qty = detail.handleQty != 0 ? detail.handleQty : detail.qty;
+ submitItem.qty = detail.handleQty;
submitItem.package = "";
subList.push(submitItem)
diff --git a/pages/unPlanned/coms/comReceiptRecord.vue b/pages/unPlanned/coms/comReceiptRecord.vue
index fba51210..0397b8c2 100644
--- a/pages/unPlanned/coms/comReceiptRecord.vue
+++ b/pages/unPlanned/coms/comReceiptRecord.vue
@@ -5,7 +5,7 @@
-
@@ -16,9 +16,8 @@
-
-
+
@@ -147,7 +146,7 @@
edit(item) {
this.editItem = item;
- this.$refs.qtyEdit.openRecordEditPopup(item.label.qty);
+ this.$refs.qtyEdit.openRecordEditPopup(item.handleQty);
},
detail(packageInfo) {
@@ -164,7 +163,7 @@
});
},
confirm(qty) {
- this.editItem.qty = qty;
+ this.editItem.handleQty = qty;
this.$emit('updateData')
}
}
diff --git a/pages/unPlanned/coms/comReceiptRequestPopup.vue b/pages/unPlanned/coms/comReceiptRequestPopup.vue
index aee41088..d523a4de 100644
--- a/pages/unPlanned/coms/comReceiptRequestPopup.vue
+++ b/pages/unPlanned/coms/comReceiptRequestPopup.vue
@@ -48,10 +48,13 @@
数量 :
-
-
+
+
+
+ ()
+
@@ -65,7 +68,7 @@
-
+
@@ -82,6 +85,7 @@
checkDirectoryItemExist
} from '@/common/directory.js';
import uom from '@/mycomponents/qty/uom.vue'
+ import stdPackQty from '@/mycomponents/qty/stdPackQty.vue'
import balanceStatus from '@/mycomponents/status/balanceStatus.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanItem from '@/mycomponents/scan/winScanItem.vue'
@@ -90,6 +94,7 @@
export default {
components: {
uom,
+ stdPackQty,
balanceStatus,
comMessage,
winScanItem,
@@ -112,6 +117,8 @@
toLocationCode: '请扫描库位信息',
isCheckLocationCode: false,
editPosition: true,
+ maxlength:10,
+ stdPackInfo:undefined
}
},
props: {
@@ -121,12 +128,28 @@
},
},
methods: {
+ checkNum(e) {
+ let value = e.detail.value;
+ let dot = value.indexOf('.'); //包含小数点
+ let reg = /^[0-9]+$/; //正整数
+ if (dot > -1) {
+ this.maxlength = dot + 7; //长度是小数点后两位
+ if (value.length > dot + 7) {
+
+ }
+ }
+ if (reg.test(value)) { //如果是正整数不包含小数点
+ this.maxlength = 10;
+ }
+ this.change(value)
+ },
openRequestPopup(editPosition) {
this.editPosition = editPosition;
if (!editPosition) {
this.itemCode = "";
this.uom = ""
this.qty = 0
+ this.count = 0;
this.itemCodeGetFocus();
}
this.$refs.popup.open('bottom')
@@ -231,13 +254,14 @@
this.closeRequestPopup();
},
- getItemCode(code) {
+ getItemCode(code, scanResult) {
if (code == "") {
this.showErrorMessage('物料号不能为空')
return;
}
this.itemCode = "";
this.checkItemCode(code)
+ this.stdPackInfo = scanResult.package;
},
getLocationCode(location, code) {
this.toLocationCode = code;
diff --git a/pages/unPlanned/job/issueJobDetail.vue b/pages/unPlanned/job/issueJobDetail.vue
index 1dd2c7a7..5e58f74e 100644
--- a/pages/unPlanned/job/issueJobDetail.vue
+++ b/pages/unPlanned/job/issueJobDetail.vue
@@ -87,13 +87,13 @@
data() {
return {
id: '',
- received: false,
scanCount: 0,
jobContent: {}, //任务内容
subList: [], //接口返回的任务subList
detailSource: [], //绑定在页面上的数据源
businessTypeInfo: {},
- managementList: []
+ managementList: [],
+ jobStatus:""
};
},
onLoad(option) {
@@ -102,7 +102,6 @@
// //新建的任务自动接收
if (option.status == "1") {
this.receive((callback => {
- this.received = true;
this.getDetail();
}));
} else {
@@ -120,7 +119,7 @@
onBackPress(e) {
//已经接收但是没提交任务
if (e.from == 'backbutton') {
- if (this.received) {
+ if (this.jobStatus=="2") {
//取消承接任务
cancleTakeUnPlannedIssueJob(this.id).then(res => {
uni.navigateBack();
@@ -167,6 +166,7 @@
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
+ that.jobStatus = res.data.status
that.subList = res.data.subList;
that.detailSource = getDataSource(that.subList)
} else {
diff --git a/pages/unPlanned/job/receiptJobDetail.vue b/pages/unPlanned/job/receiptJobDetail.vue
index a6ef8a8f..91d5c1f4 100644
--- a/pages/unPlanned/job/receiptJobDetail.vue
+++ b/pages/unPlanned/job/receiptJobDetail.vue
@@ -88,7 +88,6 @@
data() {
return {
id: '',
- received: false,
scanCount: 0,
jobContent: {}, //任务内容
subList: [], //接口返回的任务subList
@@ -97,7 +96,8 @@
toLocationCode: '',
toLocationInfo: {},
businessTypeInfo: {},
- managementList: []
+ managementList: [],
+ jobStatus:""
};
},
onLoad(option) {
@@ -106,7 +106,6 @@
// //新建的任务自动接收
if (option.status == "1") {
this.receive((callback => {
- this.received = true;
this.getDetail();
}));
} else {
@@ -124,7 +123,7 @@
onBackPress(e) {
//已经接收但是没提交任务
if (e.from == 'backbutton') {
- if (this.received) {
+ if (this.jobStatus=="2") {
//取消承接任务
cancleTakeUnPlannedReceiptJob(this.id).then(res => {
uni.navigateBack();
@@ -167,6 +166,7 @@
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
+ that.jobStatus = res.data.status
that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes);
that.subList = res.data.subList;
this.toLocationCode = that.subList[0].toLocationCode
diff --git a/pages/unPlanned/record/issueRecord.vue b/pages/unPlanned/record/issueRecord.vue
index a662bbfa..374f4611 100644
--- a/pages/unPlanned/record/issueRecord.vue
+++ b/pages/unPlanned/record/issueRecord.vue
@@ -255,7 +255,7 @@
submitItem.toLocationCode = "";
submitItem.reason = this.reasonCode;
- submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
+ submitItem.qty = detail.handleQty;
submitItem.package ="";
subList.push(submitItem)
diff --git a/pages/unPlanned/record/receiptRecord.vue b/pages/unPlanned/record/receiptRecord.vue
index ee901736..09e57294 100644
--- a/pages/unPlanned/record/receiptRecord.vue
+++ b/pages/unPlanned/record/receiptRecord.vue
@@ -22,12 +22,12 @@
-
+
@@ -55,7 +55,7 @@
import {
unPlannedReceiptRecordbSubmit
} from '@/api/request2.js';
-
+
import {
getDirectoryItemArray,
getUnPlannedReceiptReasonList
@@ -64,17 +64,19 @@
import {
getBusinessType,
} from '@/common/record.js';
-
+
import {
- calc
- } from '@/common/calc.js';
+ calc
+ } from '@/common/calc.js';
+
+ import { Decimal } from 'decimal.js';//引入
import {
goHome,
updateTitle,
deepCopyData,
getPackingNumberAndBatchByList
} from '@/common/basic.js';
-
+
import {
getPrecisionStrategyList
} from '@/common/balance.js';
@@ -102,10 +104,10 @@
detailSource: [], //绑定在页面上的数据源
businessTypeCode: "UnplannedReceipt",
reasonText: "",
- reasonCode:"",
+ reasonCode: "",
reasonList: [],
- dataContent:{},
- managementList:[]
+ dataContent: {},
+ managementList: []
}
},
@@ -123,8 +125,7 @@
});
},
- onLoad(option) {
- },
+ onLoad(option) {},
methods: {
openScanPopup() {
@@ -174,8 +175,8 @@
itemName: pack.itemName,
stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit,
- qty: label.qty,
- handleQty: 0,
+ qty: new Decimal(label.qty).toNumber(),
+ handleQty: new Decimal(0).toNumber(),
uom: label.uom,
subList: []
}
@@ -183,11 +184,11 @@
},
createDetailInfo(label, pack) {
- let detail = {};
+ let detail = deepCopyData(label);
detail.scaned = true;
// Object.assign(detail, label)
- detail.qty = Number(label.qty)
- detail.handleQty = 0,
+ detail.qty = new Decimal(label.qty).toNumber();
+ detail.handleQty = new Decimal(label.qty).toNumber();
detail.inventoryStatus = "OK"
detail.stdPackQty = pack.stdPackQty;
detail.stdPackUnit = pack.stdPackUnit;
@@ -200,10 +201,10 @@
calcHandleQty() {
for (let item of this.detailSource) {
- item.qty = 0;
+ item.handleQty = new Decimal(0).toNumber();
for (let detail of item.subList) {
if (detail != undefined) {
- item.qty = calc.add(item.qty,detail.qty)
+ item.handleQty = calc.add(item.handleQty, detail.handleQty)
}
}
}
@@ -242,44 +243,44 @@
this.showErrorMessage("请选择入库原因")
return;
}
-
-
+
+
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
- //查询管理模式
- uni.showLoading({
- title: "提交中....",
- mask: true
- });
- this.managementList = [];
- var precisionStrategParams = this.setPrecisionStrategParams()
- getPrecisionStrategyList(precisionStrategParams, res => {
- if (res.success) {
- this.managementList = res.list;
- var params = this.setParams()
- console.log("提交" + JSON.stringify(params))
- unPlannedReceiptRecordbSubmit(params).then(res => {
- uni.hideLoading()
- if (res.data) {
- this.showCommitSuccessMessage("提交成功
生成计划外入库记录
" + res.data)
- } else {
- this.showErrorMessage("提交失败[" + res.msg + "]")
- }
- }).catch(error => {
- uni.hideLoading()
- this.showErrorMessage(error)
- })
-
- } else {
- uni.hideLoading();
- this.showErrorMessage(res.message);
- }
-
- })
- }else {
+ //查询管理模式
+ uni.showLoading({
+ title: "提交中....",
+ mask: true
+ });
+ this.managementList = [];
+ var precisionStrategParams = this.setPrecisionStrategParams()
+ getPrecisionStrategyList(precisionStrategParams, res => {
+ if (res.success) {
+ this.managementList = res.list;
+ var params = this.setParams()
+ console.log("提交" + JSON.stringify(params))
+ unPlannedReceiptRecordbSubmit(params).then(res => {
+ uni.hideLoading()
+ if (res.data) {
+ this.showCommitSuccessMessage("提交成功
生成计划外入库记录
" + res.data)
+ } else {
+ this.showErrorMessage("提交失败[" + res.msg + "]")
+ }
+ }).catch(error => {
+ uni.hideLoading()
+ this.showErrorMessage(error)
+ })
+
+ } else {
+ uni.hideLoading();
+ this.showErrorMessage(res.message);
+ }
+
+ })
+ } else {
this.showErrorMessage("没有要提交的数据,请先扫描")
}
-
-
+
+
},
setPrecisionStrategParams() {
var itemList = []
@@ -301,47 +302,48 @@
}
itemList.push(result)
}
-
+
}
})
})
return itemList;
},
setParams() {
-
+
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var submitItem = deepCopyData(detail)
- var info = getPackingNumberAndBatchByList(this.managementList, detail.label.itemCode,
+ var info = getPackingNumberAndBatchByList(this.managementList, detail.label
+ .itemCode,
detail.label.packingNumber, detail.toLocationCode, detail.label.batch);
-
+
submitItem.itemCode = detail.package.itemCode;
submitItem.itemName = detail.package.itemName;
submitItem.itemDesc1 = detail.package.itemDesc1;
submitItem.itemDesc2 = detail.package.itemDesc2;
-
+
submitItem.inventoryStatus = detail.inventoryStatus;
-
+
submitItem.fromPackingNumber = info.packingNumber;
submitItem.toPackingNumber = info.packingNumber;
-
+
// detail.fromContainerNumber = detail.containerNumber;
// detail.toContainerNumber = detail.containerNumber
-
+
submitItem.fromBatch = info.batch;
submitItem.toBatch = info.batch;
-
+
submitItem.fromLocationCode = "";
submitItem.toLocationCode = detail.toLocationCode;
-
+
submitItem.reason = this.reasonCode;
-
- submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
- submitItem.package ="";
-
+
+ submitItem.qty = detail.handleQty;
+ submitItem.package = "";
+
subList.push(submitItem)
}
})
@@ -364,16 +366,16 @@
this.clearData();
})
},
- clearData(){
+ clearData() {
this.reasonCode = ""
this.reasonText = "";
this.detailSource = [];
- this.managementList=[];
- this.dataContent ={}
- this.toLocationCode =""
+ this.managementList = [];
+ this.dataContent = {}
+ this.toLocationCode = ""
}
-
-
+
+
}
}
diff --git a/pages/unPlanned/request/issueRequestCreate.vue b/pages/unPlanned/request/issueRequestCreate.vue
index 433a0f8f..5ed7d8c9 100644
--- a/pages/unPlanned/request/issueRequestCreate.vue
+++ b/pages/unPlanned/request/issueRequestCreate.vue
@@ -18,7 +18,7 @@
@@ -78,6 +78,7 @@
import {
goHome,
updateTitle,
+ deepCopyData,
getCurrDateTimes,
getCurrDateOneMonthsTimes,
navigateBack
@@ -255,16 +256,18 @@
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
- detail.fromLocationCode = detail.locationCode;
- detail.reason = this.reasonCode;
- detail.containerNumber ="";
- subList.push(detail)
+ var submitItem = deepCopyData(detail)
+ submitItem.fromLocationCode = detail.locationCode;
+ submitItem.reason = this.reasonCode;
+ submitItem.containerNumber ="";
+ submitItem.qty = detail.handleQty;
+ subList.push(submitItem)
}
})
})
this.dataContent.subList = subList
- this.dataContent.status = 1;
+ this.dataContent.status = "1";
this.dataContent.requestTime = getCurrDateTimes();
this.dataContent.dueTime = getCurrDateOneMonthsTimes();
diff --git a/pages/unPlanned/request/receiptRequestCreate.vue b/pages/unPlanned/request/receiptRequestCreate.vue
index a2f02fc9..1fd5e8d3 100644
--- a/pages/unPlanned/request/receiptRequestCreate.vue
+++ b/pages/unPlanned/request/receiptRequestCreate.vue
@@ -58,6 +58,7 @@
getISODateTime,
navigateBack,
getBatch,
+ deepCopyData,
getCurrDateTimes,
getCurrDateOneMonthsTimes
} from '@/common/basic.js';
@@ -186,16 +187,17 @@
setRequestParams() {
var subList = []
this.detailSource.subList.forEach(detail => {
- detail.toLocationCode = this.detailSource.toLocationCode;
- detail.reason = this.reasonCode;
- detail.containerNumber = "";
- detail.batch = getBatch();
- detail.inventoryStatus = "OK";
+ var submitItem = deepCopyData(detail)
+ submitItem.toLocationCode = this.detailSource.toLocationCode;
+ submitItem.reason = this.reasonCode;
+ submitItem.containerNumber = "";
+ submitItem.batch = getBatch();
+ submitItem.inventoryStatus = "OK";
console.log("", getBatch())
- subList.push(detail)
+ subList.push(submitItem)
})
this.dataContent.subList = subList
- this.dataContent.status = 1;
+ this.dataContent.status = "1";
this.dataContent.requestTime = getCurrDateTimes();
this.dataContent.dueTime = getCurrDateOneMonthsTimes();
diff --git a/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue b/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue
index 39bb86a9..6f8393a8 100644
--- a/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue
+++ b/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue
@@ -1,13 +1,14 @@
- -
+ -
+ :focus="focus" v-model="inputValue" :style="{background, color}" @input="checkNum" :maxlength="maxlength" />
- +
+ +
@@ -27,7 +28,9 @@
* @event {Function} focus 输入框聚焦时触发的事件,参数为 event 对象
* @event {Function} blur 输入框失焦时触发的事件,参数为 event 对象
*/
-
+ import {
+ Decimal
+ } from 'decimal.js'; //引入
export default {
name: "UniNumberBox",
emits: ['change', 'input', 'update:modelValue', 'blur', 'focus'],
@@ -71,26 +74,55 @@
},
data() {
return {
- inputValue: 0
+ inputValue: 0,
+ maxlength: 10
};
},
watch: {
value(val) {
- this.inputValue = +val;
+ this.inputValue = this.add(this.inputValue, val)
},
modelValue(val) {
- this.inputValue = +val;
+ this.inputValue = this.add(this.inputValue, val)
}
},
created() {
if (this.value === 1) {
- this.inputValue = +this.modelValue;
+ this.inputValue = this.add(this.inputValue, this.modelValue)
}
if (this.modelValue === 1) {
- this.inputValue = +this.value;
+ this.inputValue = this.add(this.inputValue, this.value)
}
},
methods: {
+ add(num1, num2) {
+ return new Decimal(num1).add(new Decimal(num2))
+ },
+
+ sub(num1, num2) {
+ return new Decimal(num1).sub(new Decimal(num2))
+ },
+
+ mul(num1,num2) {
+ return new Decimal(num1).mul(new Decimal(num2))
+ },
+ div(num1,num2) {
+ return new Decimal(num1).div(new Decimal(num2))
+ },
+ checkNum(e) {
+ let value = e.detail.value;
+ let dot = value.indexOf('.'); //鍖呭惈灏忔暟鐐
+ let reg = /^[0-9]+$/; //姝f暣鏁
+ if (dot > -1) {
+ this.maxlength = dot + 7; //闀垮害鏄¯灏忔暟鐐瑰悗涓や綅
+ if (value.length > dot + 7) {
+
+ }
+ }
+ if (reg.test(value)) { //濡傛灉鏄¯姝f暣鏁颁笉鍖呭惈灏忔暟鐐
+ this.maxlength = 10;
+ }
+ },
_calcValue(type) {
if (this.disabled) {
return;
@@ -99,7 +131,7 @@
let value = this.inputValue * scale;
let step = this.step * scale;
if (type === "minus") {
- value -= step;
+ value = this.sub(value - step)
if (value < (this.min * scale)) {
return;
}
@@ -109,53 +141,54 @@
}
if (type === "plus") {
- value += step;
- if (value > (this.max * scale)) {
- return;
- }
- if (value < (this.min * scale)) {
- value = this.min * scale
- }
- }
-
- this.inputValue = (value / scale).toFixed(String(scale).length - 1);
- this.$emit("change", +this.inputValue);
- // TODO vue2 兼容
- this.$emit("input", +this.inputValue);
- // TODO vue3 兼容
- this.$emit("update:modelValue", +this.inputValue);
- },
- _getDecimalScale() {
-
- let scale = 1;
- // 浮点型
- if (~~this.step !== this.step) {
- scale = Math.pow(10, String(this.step).split(".")[1].length);
- }
- return scale;
- },
- _onBlur(event) {
- this.$emit('blur', event)
- let value = event.detail.value;
- if (!value) {
- // this.inputValue = 0;
+ value = this.add(value, step)
+
+ if (value > (this.max * scale)) {
return;
}
- value = +value;
- if (value > this.max) {
- value = this.max;
- } else if (value < this.min) {
- value = this.min;
+ if (value < (this.min * scale)) {
+ value = this.min * scale
}
- const scale = this._getDecimalScale();
- this.inputValue = value.toFixed(String(scale).length - 1);
- this.$emit("change", +this.inputValue);
- this.$emit("input", +this.inputValue);
- },
- _onFocus(event) {
- this.$emit('focus', event)
}
+
+ this.inputValue = (value / scale).toFixed(String(scale).length - 1);
+ this.$emit("change", +this.inputValue);
+ // TODO vue2 兼容
+ this.$emit("input", +this.inputValue);
+ // TODO vue3 兼容
+ this.$emit("update:modelValue", +this.inputValue);
+ },
+ _getDecimalScale() {
+
+ let scale = 1;
+ // 浮点型
+ if (~~this.step !== this.step) {
+ scale = Math.pow(10, String(this.step).split(".")[1].length);
+ }
+ return scale;
+ },
+ _onBlur(event) {
+ this.$emit('blur', event)
+ let value = event.detail.value;
+ if (!value) {
+ // this.inputValue = 0;
+ return;
+ }
+ value = +value;
+ if (value > this.max) {
+ value = this.max;
+ } else if (value < this.min) {
+ value = this.min;
+ }
+ const scale = this._getDecimalScale();
+ this.inputValue = value.toFixed(String(scale).length - 1);
+ this.$emit("change", +this.inputValue);
+ this.$emit("input", +this.inputValue);
+ },
+ _onFocus(event) {
+ this.$emit('focus', event)
}
+ }
};