Browse Source

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

# Conflicts:
#	mycomponents/item/itemQty.vue
wms3.0_pda
niexiting 8 months ago
parent
commit
8e0c10d965
  1. 8
      common/calc.js
  2. 27
      common/record.js
  3. 19
      mycomponents/item/itemQty.vue
  4. 3
      mycomponents/qty/balanceQtyEdit.vue
  5. 4
      mycomponents/record/recordComDetailCard.vue
  6. 7
      mycomponents/scan/winScanItem.vue
  7. 16
      mycomponents/scan/winScanPackAndPosition.vue
  8. 2
      mycomponents/status/balanceStatus.vue
  9. 2
      pages/container/record/containerUnBindRecord.vue
  10. 8
      pages/count/job/countDetail.vue
  11. 8
      pages/customerReturn/job/returnDetail.vue
  12. 5
      pages/customerReturn/record/returnRecord.vue
  13. 3
      pages/customerReturn/request/customerReturnRequestCreate.vue
  14. 29
      pages/deliver/coms/comDeliverRequestPopup.vue
  15. 9
      pages/deliver/job/deliverDetail.vue
  16. 5
      pages/deliver/record/deliverRecord.vue
  17. 6
      pages/inspect/job/inspectFullDetail.vue
  18. 6
      pages/inspect/job/inspectResult.vue
  19. 2
      pages/inventoryMove/coms/comMoveRecord.vue
  20. 3
      pages/inventoryMove/coms/comMoveRecordCard.vue
  21. 8
      pages/inventoryMove/job/inventoryMoveDetail.vue
  22. 51
      pages/issue/coms/comIssueRequestPopup.vue
  23. 6
      pages/issue/job/issueDetail.vue
  24. 5
      pages/issue/record/issueRecord.vue
  25. 2
      pages/package/record/mergePackageRecord.vue
  26. 2
      pages/package/record/overPackageRecord.vue
  27. 198
      pages/productPutaway/coms/comProductRecord.vue
  28. 6
      pages/productPutaway/job/productPutawayDetail.vue
  29. 2
      pages/productPutaway/record/productPutawayRecord.vue
  30. 15
      pages/productPutaway/request/putawayRequestCreate.vue
  31. 8
      pages/productReceipt/job/productReceiptDetail.vue
  32. 19
      pages/productReceipt/record/productReceiptRecord.vue
  33. 6
      pages/productionReceipt/job/productionReceiptDetail.vue
  34. 1
      pages/productionReceipt/record/productionReceiptRecord.vue
  35. 13
      pages/productionReturn/coms/comReturnRecord.vue
  36. 35
      pages/productionReturn/coms/comReturnRequestPopup.vue
  37. 8
      pages/productionReturn/job/returnDetail.vue
  38. 67
      pages/productionReturn/record/returnToHold.vue
  39. 28
      pages/productionReturn/record/returnToStore.vue
  40. 10
      pages/purchaseReceipt/job/receiptDetail.vue
  41. 8
      pages/purchaseReturn/job/returnDetail.vue
  42. 5
      pages/purchaseReturn/record/returnRecord.vue
  43. 8
      pages/purchaseReturn/request/returnRequestCreate.vue
  44. 6
      pages/putaway/job/putawayDetail.vue
  45. 2
      pages/putaway/record/putawayRecord.vue
  46. 35
      pages/repleinsh/coms/comRepleinshRequestPopup.vue
  47. 6
      pages/repleinsh/job/repleinshDetail.vue
  48. 2
      pages/repleinsh/record/repleinshRecord.vue
  49. 8
      pages/scrap/job/scrapJobDetail.vue
  50. 18
      pages/scrap/record/scrapRecord.vue
  51. 4
      pages/scrap/request/scrapRequestCreate.vue
  52. 8
      pages/transfer/job/issueDetail.vue
  53. 8
      pages/transfer/job/receiptDetail.vue
  54. 2
      pages/transfer/record/deliverRecord.vue
  55. 2
      pages/transfer/record/receiptRecord.vue
  56. 11
      pages/unPlanned/coms/comReceiptRecord.vue
  57. 34
      pages/unPlanned/coms/comReceiptRequestPopup.vue
  58. 8
      pages/unPlanned/job/issueJobDetail.vue
  59. 8
      pages/unPlanned/job/receiptJobDetail.vue
  60. 2
      pages/unPlanned/record/issueRecord.vue
  61. 108
      pages/unPlanned/record/receiptRecord.vue
  62. 15
      pages/unPlanned/request/issueRequestCreate.vue
  63. 16
      pages/unPlanned/request/receiptRequestCreate.vue
  64. 137
      uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue

8
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();

27
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);
}
}
}

19
mycomponents/item/itemQty.vue

@ -4,9 +4,9 @@
<item :dataContent="dataContent"></item>
</view>
<view>
<balance-qty v-if="showBalanceQty" :dataContent="dataContent"></balance-qty>
<balanceQty v-if="showItemQty" :dataContent="dataContent"></balanceQty>
<compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)"
:isShowRecommendQty='showRecommendQty' :handleQty="Number(handleQty)" :isShowStdPack="showStdPack" :isShowStatus="false">
:handleQty="dataContent.handleQty" :isShowStatus="false">
</compare-qty>
</view>
<!-- <view v-else>
@ -18,6 +18,7 @@
</view>
</template>
<script>
import item from '@/mycomponents/item/item.vue'
import balanceQty from '@/mycomponents/qty/balanceQty.vue'
import compareQty from '@/mycomponents/qty/compareQty.vue'
@ -43,19 +44,7 @@
type: Number,
default: 0
},
// showItemQty: {
// type: Boolean,
// default: true
// },
showBalanceQty: {
type: Boolean,
default: true
},
showRecommendQty: {
type: Boolean,
default: true
},
showStdPack: {
showItemQty: {
type: Boolean,
default: true
}

3
mycomponents/qty/balanceQtyEdit.vue

@ -141,8 +141,9 @@
openEditPopup(item, handleQty) {
this.dataContent = item
this.inventoryStatus = this.dataContent.inventoryStatus
this.originalInventoryStatus =this.dataContent.inventoryStatus;
this.toInventoryStatus = this.dataContent.toInventoryStatus
this.allQty = Number(handleQty)
this.allQty = handleQty
setTimeout(res => {
this.$refs.popup.open('bottom')
}, 500)

4
mycomponents/record/recordComDetailCard.vue

@ -88,7 +88,7 @@
isShowItemQty: {
type: Boolean,
default: true
default: false
},
},
watch: {
@ -150,7 +150,7 @@
edit(item) {
this.editItem = item;
this.$refs.balanceQtyEdit.openEditPopup(this.editItem, this.editItem.qty);
this.$refs.balanceQtyEdit.openEditPopup(this.editItem, this.editItem.handleQty);
},
detail(item) {

7
mycomponents/scan/winScanItem.vue

@ -13,7 +13,10 @@
</view>
<view class="">
<view class="">
<win-com-scan ref="scan" @getResult="getScanResult" :placeholder='title' :clearResult="false">
<win-com-scan ref="scan" @getResult="getScanResult"
:placeholder='title'
:clearResult="false"
headerType="HMQ,HPQ">
</win-com-scan>
</view>
</view>
@ -32,7 +35,7 @@
components: {
winComScan
},
emits: ["getScanCode"],
emits: ["getScanCode",'getScanResult'],
props: {
title: {
type: String,

16
mycomponents/scan/winScanPackAndPosition.vue

@ -94,7 +94,6 @@
},
methods: {
openScanPopup() {
if (this.positionList.length == 0) {
uni.showLoading({
title: "数据加载中....",
@ -112,6 +111,21 @@
this.$refs.popup.open('bottom');
},
initData(){
this.positionInfo= "请选择位置";
this.positionList = [];
this.productionLineCode = '';
this.rawLocationCode = "";
this.fgLocationCode = "";
this.workshopCode = "";
this.workStationCode ="";
this.workShopName = "";
this.productionLineName="";
this.workStationName="";
this.show = false;
this.isEditPosition = true
},
closeScanPopup() {
this.$refs.popup.close();
this.$emit("close", '');

2
mycomponents/status/balanceStatus.vue

@ -4,7 +4,7 @@
<text :class="statusStyle(status)" style='font-size: 38rpx;margin-right: 15rpx;'>
{{statusDesc(status) }}</text>
<!-- v-show="allowEdit" -->
<image style="width: 40rpx; height:40rpx" src="/static/icons/icons_edit.svg" @click="open">
<image v-if="allowEdit" style="width: 40rpx; height:40rpx" src="/static/icons/icons_edit.svg" @click="open">
</image>
</view>
<status-edit :status='status' ref="statusEdit" @updateStatus="updateStatus"></status-edit>

2
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)
}

8
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)

8
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.detailSource = getDataSource(that.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)

5
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)

3
pages/customerReturn/request/customerReturnRequestCreate.vue

@ -56,6 +56,7 @@
</template>
<script>
import { calc } from '@/common/calc'
import {
customerReturnRequestSubmit,
getBasicCustomerList
@ -210,7 +211,7 @@
});
},
calcHandleQty() {
calcHandleQty(this.detailSource)
calcHandleQty(this.detailSource);
this.$forceUpdate();
},

29
pages/deliver/coms/comDeliverRequestPopup.vue

@ -42,10 +42,13 @@
<text>数量 : </text>
<view class="uni-flex uni-row uni-center"
style="align-items: center;margin-left: 20rpx;">
<uni-number-box :value="counQty" @change="change" style='margin-left: 10rpx;'
:focus="numberFocus" @blur='numberFocus = false'>
</uni-number-box>
<input style="text-align: center;" class="qty_input" v-model="qty" type="number"
@confirm="confirm()" :focus="numberFocus" @input="checkNum" :maxlength="maxlength" />
<uom :uom="uom"></uom>
<!-- <view class="" v-if="stdPackInfo!=undefined" style="display: flex;flex-direction: row;margin-left: 10rpx;">
(<stdPackQty :dataContent="stdPackInfo"></stdPackQty>)
</view> -->
</view>
</view>
@ -109,7 +112,9 @@
isModifiedPosition: true,
customerList: [],
customerName: "请选择客户",
customerCode:""
customerCode:"",
maxlength:10,
stdPackInfo:undefined
}
},
props: {
@ -119,6 +124,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.customerList.length == 0) {
getBasicCustomerList().then(res => {
@ -142,6 +162,7 @@
this.itemCode = "";
this.uom = ""
this.qty = 0
this.counQty =0;
this.itemCodeGetFocus();
}

9
pages/deliver/job/deliverDetail.vue

@ -104,8 +104,8 @@
detailOptions: [],
scanOptions: [],
status: "",
received: false,
toLocationCode: ""
toLocationCode: "",
jobStatus:""
};
},
@ -119,7 +119,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") {
//
cancleTakeDeliverJob(this.id).then(res => {
uni.navigateBack();
@ -179,6 +178,8 @@
} 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.detailSource, that.subList)
that.toLocationCode = that.subList[0].toLocationCode

5
pages/deliver/record/deliverRecord.vue

@ -172,9 +172,8 @@
}
})
if (item == undefined) {
var itemp = createItemInfo(balance.qty, pack);
var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
if(labelQty)
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
} else {
@ -380,7 +379,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)

6
pages/inspect/job/inspectFullDetail.vue

@ -91,7 +91,6 @@
data() {
return {
id: '',
received: false,
scanCount: 0,
jobContent: {}, //
subList: [], //subList
@ -100,6 +99,7 @@
fromInventoryStatuses: "",
managementList: [],
selectedItem: {},
jobStatus:""
};
},
onLoad(option) {
@ -108,7 +108,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") {
//
cancleTakeInspectJob(this.id).then(res => {
uni.navigateBack();
@ -204,6 +203,7 @@
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.jobStatus = res.data.status
this.jobContent.failedQty = 0;
this.jobContent.crackQty = 0;
this.jobContent.notPassedQty = 0;

6
pages/inspect/job/inspectResult.vue

@ -173,7 +173,6 @@
failedReasonArray: [],
nextStep: '',
submitting: false,
received: false,
locations: [],
value: ['0'],
jobContent: {}, //
@ -181,6 +180,7 @@
detailSource: [], //
nextActionList: [],
nextAction: null,
jobStatus:""
}
},
@ -199,7 +199,6 @@
// //
if (option.status == "1") {
this.receive((callback => {
this.received = true;
this.getDetail();
}));
} else {
@ -210,7 +209,7 @@
onBackPress(e) {
//
if (e.from == 'backbutton') {
if (this.received) {
if (this.jobStatus=="2") {
//
cancleTakeInspectJob(this.id).then(res => {
uni.navigateBack();
@ -257,6 +256,7 @@
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.detailList = res.data.subList;
that.jobStatus = res.data.status
that.inspectType = that.jobContent.inspectType;
that.jobContent.goodQty = null, //
that.jobContent.failedQty = null, //

2
pages/inventoryMove/coms/comMoveRecord.vue

@ -421,7 +421,7 @@
submitItem.package = null;
submitItem.Records = null;
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty;
submitItem.qty = detail.handleQty;
subList.push(submitItem)
}

3
pages/inventoryMove/coms/comMoveRecordCard.vue

@ -5,7 +5,8 @@
<template v-slot:title>
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="removeData($event,dataContent)" :right-options="removeOptions">
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"
<item-qty :dataContent="dataContent"
:showItemQty="false"
:isShowBalance="true"></item-qty>
</uni-swipe-action-item>
</uni-swipe-action>

8
pages/inventoryMove/job/inventoryMoveDetail.vue

@ -92,7 +92,6 @@
data() {
return {
id: '',
received: false,
scanCount: 0,
jobContent: {}, //
subList: [], //subList
@ -103,7 +102,8 @@
managementList: [],
businessTypeCode: '',
toLocationCode: '',
toInventoryStatus: ''
toInventoryStatus: '',
jobStatus:""
};
},
props: {
@ -116,7 +116,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") {
//
cancleTakeInventoryMoveJob(this.id).then(res => {
uni.navigateBack();
@ -223,6 +222,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 {

51
pages/issue/coms/comIssueRequestPopup.vue

@ -41,18 +41,15 @@
<view class="uni-flex uni-row padding title u-col-center">
<text>数量 </text>
<view class="uni-flex uni-row uni-center"
style="align-items: center;margin-left: 20rpx;">
<uni-number-box :value="counQty" @change="change" style='margin-left: 10rpx;'
:focus="numberFocus" @blur='numberFocus = false'>
</uni-number-box>
style="display: flex; align-items: center;margin-left: 20rpx;justify-content: center;">
<input style="text-align: center;" class="qty_input" v-model="counQty" type="number"
@confirm="confirm()" :focus="numberFocus" @input="checkNum" :maxlength="maxlength" />
<view class="std_pack" v-if="itemCode!='请扫描物料信息'">
<text>
/{{stdQty}}
<!-- {{Number(dataContent.stdPackQty)}}{{getStdPackUnit(dataContent.uom)}} -->
</text>
</view>
<uom :uom="uom"></uom>
<view class="" v-if="stdPackInfo!=undefined" style="display: flex;flex-direction: row;margin-left: 10rpx;">
(<stdPackQty :dataContent="stdPackInfo"></stdPackQty>)
</view>
</view>
</view>
<u-line />
@ -84,6 +81,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'
@ -94,7 +92,8 @@
uom,
balanceStatus,
comMessage,
winScanItem
winScanItem,
stdPackQty
},
data() {
return {
@ -114,7 +113,7 @@
requestInfo: null,
itemCodeList: [],
isCheckItemCode: false,
counQty: 0,
counQty: undefined,
editPosition: true,
numberFocus: false,
uom: "",
@ -123,6 +122,8 @@
isModifiedPosition: true,
positionList: [],
stdQty: 0, //
maxlength:10,
stdPackInfo:undefined
}
},
props: {
@ -132,6 +133,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 => {
@ -147,7 +163,9 @@
} else {
this.itemCode = "";
this.uom = ""
this.qty = 0
this.qty = 0;
this.counQty = undefined;
this.numberFocus = false
this.itemCodeGetFocus();
}
@ -180,6 +198,11 @@
this.showErrorMessage("请输入物料", "itemCode")
return
}
if (this.counQty == undefined) {
this.showErrorMessage("请输入数量")
return
}
if (this.qty == 0) {
this.showErrorMessage("数量必须大于0")
return
@ -298,7 +321,7 @@
}
this.itemCode = "";
this.checkItemCode(code)
this.stdQty = scanResult.package.stdPackQty;
this.stdPackInfo = scanResult.package;
}
}
}

6
pages/issue/job/issueDetail.vue

@ -95,7 +95,7 @@
detailSource: [], //
detailOptions: [],
scanOptions: [],
received:false
jobStatus:""
};
},
@ -109,7 +109,6 @@
//
if (option.status == "1") {
this.receive((callback => {
this.received = true;
this.getDetail();
}));
} else {
@ -128,7 +127,7 @@
onBackPress(e) {
//
if (e.from === 'backbutton') {
if (this.received) {
if (this.jobStatus=="2") {
//
cancleTakeIssueJob(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.detailSource, that.subList)

5
pages/issue/record/issueRecord.vue

@ -109,6 +109,11 @@
},
mounted() {
},
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
onLoad(option) {
var typeCode = "Issue"

2
pages/package/record/mergePackageRecord.vue

@ -271,7 +271,7 @@
detail.fromInventoryStatus = detail.inventoryStatus;
detail.toInventoryStatus = detail.inventoryStatus;
detail.fromQty = detail.qty
detail.fromQty = detail.handleQty
detail.fromPackingNumber = detail.packingNumber;
detail.toPackingNumber = this.toPackingNumber;

2
pages/package/record/overPackageRecord.vue

@ -262,7 +262,7 @@
subItem.itemDesc2 = detail.package.itemDesc2;
subItem.fromInventoryStatus = detail.inventoryStatus;
subItem.fromQty = detail.qty
subItem.fromQty = detail.handleQty
subItem.fromPackingNumber = detail.packingNumber;
subItem.fromBatch = detail.batch;
subItem.fromLocationCode = detail.locationCode;

198
pages/productPutaway/coms/comProductRecord.vue

@ -1,198 +0,0 @@
<template>
<view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="removeItem($event,dataContent)" :right-options="removeOptions">
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowBalance="true"></item-qty>
</uni-swipe-action-item>
</uni-swipe-action>
</template>
<u-line />
<view class="" v-for="(item,index) in dataContent.subList">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item,index)"
:right-options="item.scaned?scanOptions:detailOptions">
<!-- <balance :dataContent="item" :isShowStdPack="false" :isShowPack="true"
:isShowLocation="true"></balance> -->
<purchase-label :dataContent="item" :packageContent="item.package" :isShowStdPack="false">
</purchase-label>
</uni-swipe-action-item>
</uni-swipe-action>
<u-line color="#D8D8D8"></u-line>
</view>
</uni-collapse-item>
</uni-collapse>
<balanceQtyEdit ref="balanceQtyEdit" @confirm="confirm"></balanceQtyEdit>
<job-detail-popup ref="winHint" :dataContent="showItem"></job-detail-popup>
<com-message ref="comMessage"></com-message>
</view>
</template>
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import purchaseLabel from '@/mycomponents/balance/purchaseLabel.vue'
import record from '@/mycomponents/record/record.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import {
getDetailOption,
getDetailEditRemoveOption,
getClearOption
} from '@/common/array.js';
export default {
components: {
itemQty,
recommend,
jobDetailPopup,
purchaseLabel,
balanceQtyEdit,
record,
comMessage
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
fromInventoryStatus: {
type: String,
default: ""
},
toInventoryStatus: {
type: String,
default: ""
},
isShowStatus: {
type: Boolean,
default: false
}
},
watch: {
dataContent: {
handler(newName, oldName) {
if (this.dataContent.subList.length > 0) {
if (this.$refs.collapse1 != undefined) {
this.$nextTick(res => {
this.$refs.collapse1.resize()
})
}
}
},
immediate: true,
deep: true
}
},
data() {
return {
option: [],
title: "推荐详情",
showItem: {},
editItem: {},
detailOptions: [],
scanOptions: [],
removeOptions: [],
dataList: []
}
},
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getDetailEditRemoveOption();
this.removeOptions = getClearOption();
},
methods: {
removeItem(e, dataContent) {
if (e.content.text == "清空") {
this.$refs.comMessage.showQuestionMessage("确定清空物料及箱码信息?",
res => {
if (res) {
this.$emit('removeItem')
// this.$emit('removeItem', this.dataContent)
}
});
}
},
swipeClick(e, item, index) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
this.remove(item, index)
}
},
edit(item) {
this.editItem = item;
this.$refs.balanceQtyEdit.openEditPopup(this.editItem, this.editItem.qty);
},
remove(item, index) {
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
this.dataContent.subList.splice(index, 1)
this.$emit('updateData')
}
});
},
confirm(qty) {
this.editItem.qty = qty;
this.$emit('updateData')
},
detail(item) {
this.showItem = item;
this.dataList = [{
title: "箱码",
content: item.packingNumber
},
{
title: "批次",
content: item.batch
},
{
title: "库位",
content: item.locationCode
},
{
title: "数量",
content: item.qty
},
{
title: "单位",
content: item.uom
}
]
this.$refs.winHint.openScanPopup()
},
remove(item, index) {
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
this.dataContent.subList.splice(index, 1)
this.$emit('removePack')
}
});
},
confirm(qty) {
this.editItem.qty = qty;
this.$emit('updateData')
}
}
}
</script>
<style>
</style>

6
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)

2
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)
}

15
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("提交成功<br>生成制品上架申请<br>" + res.data, )
this.showCommitSuccessMessage("提交成功<br>生成制品上架申请<br>" + 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;

8
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)

19
pages/productReceipt/record/productReceiptRecord.vue

@ -65,6 +65,8 @@
calc
} from '@/common/calc.js';
import { Decimal } from 'decimal.js';//
import {
getInventoryStatusDesc,
getDirectoryItemArray
@ -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)

6
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

1
pages/productionReceipt/record/productionReceiptRecord.vue

@ -316,6 +316,7 @@
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.fromLocationCode = '';
this.toLocationCode =""
})
},

13
pages/productionReturn/coms/comReturnRecord.vue

@ -5,8 +5,7 @@
<template v-slot:title>
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="removeData($event,dataContent)" :right-options="removeOptions">
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowBalance="true"></item-qty>
<item-qty :dataContent="dataContent" :showItemQty="false" :isShowBalance="true"></item-qty>
</uni-swipe-action-item>
</uni-swipe-action>
@ -17,7 +16,7 @@
<uni-swipe-action-item @click="swipeClick($event,item,index)"
:right-options="item.scaned?scanOptions:detailOptions">
<balance :dataContent="item" :isShowStdPack="false" :isShowStatus="true" :isShowPack="true"
:isShowFromLocation="true" :isShowToLocation="isShowToLocation"></balance>
:isShowFromLocation="isShowFromLocation" :isShowToLocation="isShowToLocation"></balance>
<!-- <production-label :dataContent="item" :packageContent="item.package"
:isShowLocation="false">
</production-label> -->
@ -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')
}
}

35
pages/productionReturn/coms/comReturnRequestPopup.vue

@ -28,7 +28,7 @@
<view class="title padding" style="display: flex;">
<text style=" flex-shrink: 0;">箱码</text>
<text style=" flex-shrink: 0;">物料</text>
<view class="" style="width: 100% ;">
{{itemCode}}
</view>
@ -46,10 +46,13 @@
<text>数量 : </text>
<view class="uni-flex uni-row uni-center"
style="align-items: center;margin-left: 20rpx;">
<uni-number-box :value="counQty" @change="change" style='margin-left: 10rpx;'
:focus="numberFocus" @blur='numberFocus = false'>
</uni-number-box>
<input style="text-align: center;" class="qty_input" v-model="counQty" type="number"
@confirm="confirm()" :focus="numberFocus" @input="checkNum" :maxlength="maxlength" />
<uom :uom="uom"></uom>
<view class="" v-if="stdPackInfo!=undefined" style="display: flex;flex-direction: row;margin-left: 10rpx;">
(<stdPackQty :dataContent="stdPackInfo"></stdPackQty>)
</view>
</view>
</view>
@ -63,7 +66,7 @@
</view>
</view>
</uni-popup>
<win-scan-item ref="scanPopup" title='物料代码' @getScanCode='getScanCode'>
<win-scan-item ref="scanPopup" title='物料代码' @getScanResult='getScanCode'>
</win-scan-item>
<comMessage ref="comMessage"></comMessage>
</view>
@ -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;
},
}

8
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)

67
pages/productionReturn/record/returnToHold.vue

@ -67,6 +67,10 @@
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,26 +190,26 @@
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 + "]的信息")
"库位[" + this.rawLocationCode + "]的信息")
return
}
@ -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)
}
}
}
@ -421,9 +424,11 @@
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;
@ -448,7 +453,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)
}

28
pages/productionReturn/record/returnToStore.vue

@ -15,6 +15,7 @@
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<comReturnRecord :dataContent="item" :index="index" @removeItem="removeItem(index,item)"
:isShowFromLocation="true"
@updateData="updateData" @removePack="removePack">
</comReturnRecord>
</view>
@ -62,6 +63,8 @@
calc
} from '@/common/calc.js';
import { Decimal } from 'decimal.js';//
import {
getBusinessType,
} from '@/common/record.js';
@ -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() {

10
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');

8
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);

5
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("提交成功<br>生成采购退货记录<br>" + 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)
}

8
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)
}
})
})

6
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)

2
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)
}

35
pages/repleinsh/coms/comRepleinshRequestPopup.vue

@ -44,10 +44,14 @@
<text>数量 </text>
<view class="uni-flex uni-row uni-center"
style="align-items: center;margin-left: 20rpx;">
<uni-number-box :value="counQty" @change="change" style='margin-left: 10rpx;'
:focus="numberFocus" @blur='numberFocus = false'>
</uni-number-box>
<input style="text-align: center;" class="qty_input" v-model="counQty" type="number"
@confirm="confirm()" :focus="numberFocus" @input="checkNum" :maxlength="maxlength" />
<uom :uom="uom"></uom>
<view class="" v-if="stdPackInfo!=undefined" style="display: flex;flex-direction: row;margin-left: 10rpx;">
(<stdPackQty :dataContent="stdPackInfo"></stdPackQty>)
</view>
</view>
</view>
<u-line />
@ -60,7 +64,7 @@
</view>
</view>
</uni-popup>
<win-scan-item ref="scanPopup" title='物料代码' @getScanCode='getScanCode'>
<win-scan-item ref="scanPopup" title='物料代码' @getScanResult='getScanCode'>
</win-scan-item>
<win-scan-location ref="scanLocationPopup" title='目标库位' @getLocation='getLocationCode'
@ -89,14 +93,17 @@
import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanItem from '@/mycomponents/scan/winScanItem.vue'
import winScanLocation from '@/mycomponents/scan/winScanLocation.vue'
import stdPackQty from '@/mycomponents/qty/stdPackQty.vue'
export default {
components: {
uom,
stdPackQty,
balanceStatus,
comMessage,
winScanItem,
winScanLocation
},
data() {
return {
@ -117,6 +124,8 @@
show: false,
isModifiedPosition: true,
positionList: [],
maxlength:10,
stdPackInfo:undefined
}
},
props: {
@ -133,6 +142,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) {
// 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) {

6
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)

2
pages/repleinsh/record/repleinshRecord.vue

@ -72,8 +72,6 @@
import {
getBusinessType,
createItemInfo,
createDetailInfo,
calcHandleQty
} from '@/common/record.js';

8
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 {

18
pages/scrap/record/scrapRecord.vue

@ -18,7 +18,7 @@
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowLocation="true" @removeItem="removeItem(index,item)" @updateData="updateData"
:isShowFromLocation="true" @removeItem="removeItem(index,item)" @updateData="updateData"
:isShowToLocation="false"
@removePack="removePack">
</record-com-detail-card>
@ -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)
}

4
pages/scrap/request/scrapRequestCreate.vue

@ -17,7 +17,9 @@
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowLocation="true" @removeItem="removeItem(index,item)" @updateData="updateData"
:isShowFromLocation="true"
:isShowToLocation="false"
@removeItem="removeItem(index,item)" @updateData="updateData"
@removePack="removePack">
</record-com-detail-card>
</view>

8
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

8
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

2
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)

2
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)

11
pages/unPlanned/coms/comReceiptRecord.vue

@ -5,7 +5,7 @@
<template v-slot:title>
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="removeData($event,dataContent)" :right-options="removeOptions">
<item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"
<item-qty :dataContent="dataContent" :showItemQty="false"
:isShowBalance="true"></item-qty>
</uni-swipe-action-item>
</uni-swipe-action>
@ -16,9 +16,8 @@
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item,index)"
:right-options="item.scaned?scanOptions:detailOptions">
<purchase-label :dataContent="item.label" :packageContent="item.package"
:isShowLocation="false">
</purchase-label>
<balance :dataContent="item" :isShowStdPack="false" :isShowStatus="true" :isShowPack="true"
:isShowFromLocation="false" :isShowToLocation="false"></balance>
</uni-swipe-action-item>
</uni-swipe-action>
<!-- <u-line color="#D8D8D8"></u-line> -->
@ -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')
}
}

34
pages/unPlanned/coms/comReceiptRequestPopup.vue

@ -48,10 +48,13 @@
<text>数量 : </text>
<view class="uni-flex uni-row uni-center"
style="align-items: center;margin-left: 20rpx;">
<uni-number-box :value="counQty" @change="change" style='margin-left: 10rpx;'
:focus="numberFocus" @blur='numberFocus = false'>
</uni-number-box>
<input style="text-align: center;" class="qty_input" v-model="counQty" type="number"
@confirm="confirm()" :focus="numberFocus" @input="checkNum" :maxlength="maxlength" />
<uom :uom="uom"></uom>
<view class="" v-if="stdPackInfo!=undefined" style="display: flex;flex-direction: row;margin-left: 10rpx;">
(<stdPackQty :dataContent="stdPackInfo"></stdPackQty>)
</view>
</view>
</view>
@ -65,7 +68,7 @@
</view>
</view>
</uni-popup>
<win-scan-item ref="itemPopup" title='物料代码' @getScanCode='getItemCode'>
<win-scan-item ref="itemPopup" title='物料代码' @getScanResult='getItemCode'>
</win-scan-item>
<winScanLocation ref="locationPopup" title="库位代码" @getLocation='getLocationCode'></winScanLocation>
<comMessage ref="comMessage"></comMessage>
@ -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;

8
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 {

8
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

2
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)

108
pages/unPlanned/record/receiptRecord.vue

@ -27,7 +27,7 @@
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationTypeList="tolocationTypeList"></requiredLocation>
</view>
<view class=" uni-flex uni-row">
@ -37,7 +37,7 @@
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<win-scan-pack ref="scanPopup" @getResult='getScanResult' :title="'箱码'" headerType="HPQ,HMQ"></win-scan-pack>
<win-scan-pack ref="scanPopup" @getResult='getScanResult' :title="'箱码'" headerType="HPQ,HMQ"></win-scan-pack>
<com-message ref="comMessage"></com-message>
</view>
</template>
@ -66,8 +66,10 @@
} from '@/common/record.js';
import {
calc
} from '@/common/calc.js';
calc
} from '@/common/calc.js';
import { Decimal } from 'decimal.js';//
import {
goHome,
updateTitle,
@ -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)
}
}
}
@ -245,37 +246,37 @@
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("提交成功<br>生成计划外入库记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
//
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("提交成功<br>生成计划外入库记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
})
}else {
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
})
} else {
this.showErrorMessage("没有要提交的数据,请先扫描")
}
@ -315,7 +316,8 @@
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;
@ -339,8 +341,8 @@
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,13 +366,13 @@
this.clearData();
})
},
clearData(){
clearData() {
this.reasonCode = ""
this.reasonText = "";
this.detailSource = [];
this.managementList=[];
this.dataContent ={}
this.toLocationCode =""
this.managementList = [];
this.dataContent = {}
this.toLocationCode = ""
}

15
pages/unPlanned/request/issueRequestCreate.vue

@ -18,7 +18,7 @@
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<record-com-detail-card :dataContent="item" :index="index"
@removeItem="removeItem(index,item)" @updateData="updateData" :isShowLocation="true"
@removeItem="removeItem(index,item)" @updateData="updateData" :isShowFromLocation="true" :isShowToLocation="false"
@removePack="removePack">
</record-com-detail-card>
</view>
@ -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();

16
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();

137
uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue

@ -1,13 +1,14 @@
<template>
<view class="uni-numbox">
<view @click="_calcValue('minus')" class="uni-numbox__minus uni-numbox-btns" :style="{background}">
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue <= min || disabled }" :style="{color}">-</text>
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue <= min || disabled }"
:style="{color}">-</text>
</view>
<input :disabled="disabled" @focus="_onFocus" @blur="_onBlur" class="uni-numbox__value" type="number"
:focus="focus"
v-model="inputValue" :style="{background, color}" />
:focus="focus" v-model="inputValue" :style="{background, color}" @input="checkNum" :maxlength="maxlength" />
<view @click="_calcValue('plus')" class="uni-numbox__plus uni-numbox-btns" :style="{background}">
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue >= max || disabled }" :style="{color}">+</text>
<text class="uni-numbox--text" :class="{ 'uni-numbox--disabled': inputValue >= max || disabled }"
:style="{color}">+</text>
</view>
</view>
</template>
@ -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]+$/; //
if (dot > -1) {
this.maxlength = dot + 7; //¯
if (value.length > dot + 7) {
}
}
if (reg.test(value)) { //¯
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() {
value = this.add(value, step)
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;
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)
}
}
};
</script>
<style lang="scss" scoped>

Loading…
Cancel
Save