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. 5
      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. 55
      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. 101
      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. 152
      pages/unPlanned/record/receiptRecord.vue
  62. 15
      pages/unPlanned/request/issueRequestCreate.vue
  63. 16
      pages/unPlanned/request/receiptRequestCreate.vue
  64. 139
      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';//引入 import { Decimal } from 'decimal.js';//引入
class Calc { class Calc {
add(num1,num2) { add(num1,num2) {
return new Decimal(num1).add(new Decimal(num2)) return new Decimal(num1).add(new Decimal(num2)).toNumber()
} }
sub(num1,num2) { sub(num1,num2) {
return new Decimal(num1).sub(new Decimal(num2)) return new Decimal(num1).sub(new Decimal(num2)).toNumber()
} }
mul(num1,num2) { mul(num1,num2) {
return new Decimal(num1).mul(new Decimal(num2)) return new Decimal(num1).mul(new Decimal(num2)).toNumber()
} }
div(num1,num2) { 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(); export const calc = new Calc();

27
common/record.js

@ -6,6 +6,10 @@ import {
getDirectoryItemArray, getDirectoryItemArray,
} from '@/common/directory.js'; } from '@/common/directory.js';
import { calc } from '@/common/calc' import { calc } from '@/common/calc'
import { Decimal } from 'decimal.js';//引入
import {
deepCopyData
} from '@/common/basic.js';
export function createItemInfo(balance, pack) { export function createItemInfo(balance, pack) {
let item = { let item = {
@ -13,25 +17,24 @@ export function createItemInfo(balance, pack) {
itemName: pack.itemName, itemName: pack.itemName,
stdPackQty: pack.stdPackQty, stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit, stdPackUnit: pack.stdPackUnit,
qty: Number(balance.qty), qty: new Decimal(balance.qty).toNumber(),
handleQty: 0, handleQty:new Decimal(0).toNumber(),
uom: pack.uom, uom: pack.uom,
subList: [] subList: []
} }
return item; return item;
} }
export function createDetailInfo(data, pack) { export function createDetailInfo(balance, pack) {
data.scaned = true; balance.scaned = true;
// data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus; // data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus;
// data.inventoryStatus = data.inventoryStatus; // data.inventoryStatus = data.inventoryStatus;
let detail = {}; let detail = deepCopyData(balance);
Object.assign(detail, data) detail.balanceQty = new Decimal(detail.qty).toNumber()
detail.balanceQty = Number(detail.qty) detail.qty = new Decimal(detail.qty).toNumber();
detail.qty = Number(detail.qty); detail.stdPackQty = new Decimal(pack.stdPackQty).toNumber()
detail.stdPackQty = Number(pack.stdPackQty)
detail.stdPackUnit = pack.stdPackUnit detail.stdPackUnit = pack.stdPackUnit
detail.handleQty =0; detail.handleQty = new Decimal(detail.qty).toNumber() ;
detail.package = pack; detail.package = pack;
return detail; return detail;
@ -40,10 +43,10 @@ export function createDetailInfo(data, pack) {
//计算实际数量 //计算实际数量
export function calcHandleQty(detailSource) { export function calcHandleQty(detailSource) {
for (let item of detailSource) { for (let item of detailSource) {
item.qty = 0; item.handleQty = new Decimal(0).toNumber();
for (let detail of item.subList) { for (let detail of item.subList) {
if (detail != undefined && detail.scaned) { 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> <item :dataContent="dataContent"></item>
</view> </view>
<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)" <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> </compare-qty>
</view> </view>
<!-- <view v-else> <!-- <view v-else>
@ -18,6 +18,7 @@
</view> </view>
</template> </template>
<script> <script>
import item from '@/mycomponents/item/item.vue' import item from '@/mycomponents/item/item.vue'
import balanceQty from '@/mycomponents/qty/balanceQty.vue' import balanceQty from '@/mycomponents/qty/balanceQty.vue'
import compareQty from '@/mycomponents/qty/compareQty.vue' import compareQty from '@/mycomponents/qty/compareQty.vue'
@ -43,19 +44,7 @@
type: Number, type: Number,
default: 0 default: 0
}, },
// showItemQty: { showItemQty: {
// type: Boolean,
// default: true
// },
showBalanceQty: {
type: Boolean,
default: true
},
showRecommendQty: {
type: Boolean,
default: true
},
showStdPack: {
type: Boolean, type: Boolean,
default: true default: true
} }

5
mycomponents/qty/balanceQtyEdit.vue

@ -77,7 +77,7 @@
import StdUom from '@/mycomponents/qty/StdUom.vue' import StdUom from '@/mycomponents/qty/StdUom.vue'
import balanceStatus from '@/mycomponents/status/balanceStatus.vue' import balanceStatus from '@/mycomponents/status/balanceStatus.vue'
import comMessage from '@/mycomponents/common/comMessage.vue' import comMessage from '@/mycomponents/common/comMessage.vue'
export default { export default {
components: { components: {
uom, uom,
@ -141,8 +141,9 @@
openEditPopup(item, handleQty) { openEditPopup(item, handleQty) {
this.dataContent = item this.dataContent = item
this.inventoryStatus = this.dataContent.inventoryStatus this.inventoryStatus = this.dataContent.inventoryStatus
this.originalInventoryStatus =this.dataContent.inventoryStatus;
this.toInventoryStatus = this.dataContent.toInventoryStatus this.toInventoryStatus = this.dataContent.toInventoryStatus
this.allQty = Number(handleQty) this.allQty = handleQty
setTimeout(res => { setTimeout(res => {
this.$refs.popup.open('bottom') this.$refs.popup.open('bottom')
}, 500) }, 500)

4
mycomponents/record/recordComDetailCard.vue

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

7
mycomponents/scan/winScanItem.vue

@ -13,7 +13,10 @@
</view> </view>
<view class=""> <view class="">
<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> </win-com-scan>
</view> </view>
</view> </view>
@ -32,7 +35,7 @@
components: { components: {
winComScan winComScan
}, },
emits: ["getScanCode"], emits: ["getScanCode",'getScanResult'],
props: { props: {
title: { title: {
type: String, type: String,

16
mycomponents/scan/winScanPackAndPosition.vue

@ -94,7 +94,6 @@
}, },
methods: { methods: {
openScanPopup() { openScanPopup() {
if (this.positionList.length == 0) { if (this.positionList.length == 0) {
uni.showLoading({ uni.showLoading({
title: "数据加载中....", title: "数据加载中....",
@ -111,6 +110,21 @@
this.$refs.popup.open('bottom'); 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() { closeScanPopup() {
this.$refs.popup.close(); this.$refs.popup.close();

2
mycomponents/status/balanceStatus.vue

@ -4,7 +4,7 @@
<text :class="statusStyle(status)" style='font-size: 38rpx;margin-right: 15rpx;'> <text :class="statusStyle(status)" style='font-size: 38rpx;margin-right: 15rpx;'>
{{statusDesc(status) }}</text> {{statusDesc(status) }}</text>
<!-- v-show="allowEdit" --> <!-- 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> </image>
</view> </view>
<status-edit :status='status' ref="statusEdit" @updateStatus="updateStatus"></status-edit> <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.itemCode = detail.itemCode;
detail.batch = detail.batch; detail.batch = detail.batch;
detail.inventoryStatus = detail.inventoryStatus; detail.inventoryStatus = detail.inventoryStatus;
detail.qty =detail.handleQty;
detail.package = null; detail.package = null;
subList.push(detail) subList.push(detail)
} }

8
pages/count/job/countDetail.vue

@ -106,7 +106,6 @@
return { return {
id: '', id: '',
receiptJob: {}, receiptJob: {},
received: false,
fromLocationCode: '', fromLocationCode: '',
isShowPackingCode: true, isShowPackingCode: true,
scanCount: 0, scanCount: 0,
@ -117,7 +116,8 @@
editInventoryStatus: false, editInventoryStatus: false,
package: {}, // package: {}, //
label: {}, // label: {}, //
currentEditItem: {} currentEditItem: {},
jobStatus:""
}; };
}, },
onLoad(option) { onLoad(option) {
@ -126,7 +126,6 @@
// //
if (option.status == "1") { if (option.status == "1") {
this.receive((callback => { this.receive((callback => {
this.received = true;
this.getDetail(); this.getDetail();
})); }));
} else { } else {
@ -144,7 +143,7 @@
onBackPress(e) { onBackPress(e) {
// //
if (e.from === 'backbutton') { if (e.from === 'backbutton') {
if (this.received) { if (this.jobStatus=="2") {
// //
cancleTakeCountJob(this.id).then(res => { cancleTakeCountJob(this.id).then(res => {
uni.navigateBack(); uni.navigateBack();
@ -190,6 +189,7 @@
that.showMessage('未获取到详情'); that.showMessage('未获取到详情');
} else { } else {
that.jobContent = res.data; that.jobContent = res.data;
that.jobStatus = res.data.status;
that.fromLocationCode = that.jobContent.locationCode; that.fromLocationCode = that.jobContent.locationCode;
that.subList = res.data.subList; that.subList = res.data.subList;
that.detailSource = that.getDataSource(that.subList) that.detailSource = that.getDataSource(that.subList)

8
pages/customerReturn/job/returnDetail.vue

@ -82,7 +82,6 @@
data() { data() {
return { return {
id: '', id: '',
received: false,
scanCount: 0, scanCount: 0,
jobContent: {}, // jobContent: {}, //
subList: [], //subList subList: [], //subList
@ -92,6 +91,7 @@
toLocationCode: "", toLocationCode: "",
toLocationInfo: {}, toLocationInfo: {},
tolocationTypeList: [], tolocationTypeList: [],
jobStatus:""
}; };
}, },
onLoad(option) { onLoad(option) {
@ -100,7 +100,6 @@
// //
if (option.status == "1") { if (option.status == "1") {
this.receive((callback => { this.receive((callback => {
this.received = true;
this.getDetail(); this.getDetail();
})); }));
} else { } else {
@ -118,7 +117,7 @@
onBackPress(e) { onBackPress(e) {
// //
if (e.from == 'backbutton') { if (e.from == 'backbutton') {
if (this.received) { if (this.jobStatus=="2") {
// //
cancleTakeCustomerReturnJob(this.id).then(res => { cancleTakeCustomerReturnJob(this.id).then(res => {
uni.navigateBack(); uni.navigateBack();
@ -167,8 +166,9 @@
if (res.data.subList.length > 0) { if (res.data.subList.length > 0) {
that.jobContent = res.data; that.jobContent = res.data;
that.subList = res.data.subList; that.subList = res.data.subList;
that.jobStatus = res.data.status
that.detailSource = getDataSource(that.subList) that.detailSource = getDataSource(that.subList)
that.fromLocationCode = that.subList[0].fromLocationCode that.fromLocationCode = that.subList[0].fromLocationCode
that.toLocationCode = that.subList[0].toLocationCode that.toLocationCode = that.subList[0].toLocationCode
that.tolocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes) that.tolocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes)

5
pages/customerReturn/record/returnRecord.vue

@ -149,8 +149,10 @@
} }
}) })
if (item == undefined) { if (item == undefined) {
var itemp = createItemInfo(balance, pack); var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); // let newDetail = createDetailInfo(balance, pack); //
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
this.detailSource.push(itemp) this.detailSource.push(itemp)
} else { } else {
@ -316,7 +318,6 @@
}, },
setParams() { setParams() {
var subList = [] var subList = []
var creator = this.$store.state.user.id var creator = this.$store.state.user.id
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
@ -346,7 +347,7 @@
submitItem.fromLocationCode = detail.locationCode; submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode; submitItem.toLocationCode = detail.toLocationCode;
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty; submitItem.qty = detail.handleQty;
submitItem.package =""; submitItem.package ="";
subList.push(submitItem) subList.push(submitItem)

3
pages/customerReturn/request/customerReturnRequestCreate.vue

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

29
pages/deliver/coms/comDeliverRequestPopup.vue

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

9
pages/deliver/job/deliverDetail.vue

@ -104,8 +104,8 @@
detailOptions: [], detailOptions: [],
scanOptions: [], scanOptions: [],
status: "", status: "",
received: false, toLocationCode: "",
toLocationCode: "" jobStatus:""
}; };
}, },
@ -119,7 +119,6 @@
// //
if (option.status == "1") { if (option.status == "1") {
this.receive((callback => { this.receive((callback => {
this.received = true;
this.getDetail(); this.getDetail();
})); }));
} else { } else {
@ -138,7 +137,7 @@
onBackPress(e) { onBackPress(e) {
// //
if (e.from == 'backbutton') { if (e.from == 'backbutton') {
if (this.received) { if (this.jobStatus=="2") {
// //
cancleTakeDeliverJob(this.id).then(res => { cancleTakeDeliverJob(this.id).then(res => {
uni.navigateBack(); uni.navigateBack();
@ -179,6 +178,8 @@
} else { } else {
if (res.data.subList.length > 0) { if (res.data.subList.length > 0) {
that.jobContent = res.data; that.jobContent = res.data;
that.jobStatus = res.data.status;
that.subList = res.data.subList; that.subList = res.data.subList;
that.detailSource = getDataSource(that.detailSource, that.subList) that.detailSource = getDataSource(that.detailSource, that.subList)
that.toLocationCode = that.subList[0].toLocationCode that.toLocationCode = that.subList[0].toLocationCode

5
pages/deliver/record/deliverRecord.vue

@ -172,9 +172,8 @@
} }
}) })
if (item == undefined) { if (item == undefined) {
var itemp = createItemInfo(balance.qty, pack); var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); // let newDetail = createDetailInfo(balance, pack); //
if(labelQty)
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
this.detailSource.push(itemp) this.detailSource.push(itemp)
} else { } else {
@ -380,7 +379,7 @@
submitItem.fromLocationCode = detail.locationCode; submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode; submitItem.toLocationCode = detail.toLocationCode;
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty; submitItem.qty = detail.handleQty;
submitItem.package =""; submitItem.package ="";
subList.push(submitItem) subList.push(submitItem)

6
pages/inspect/job/inspectFullDetail.vue

@ -91,7 +91,6 @@
data() { data() {
return { return {
id: '', id: '',
received: false,
scanCount: 0, scanCount: 0,
jobContent: {}, // jobContent: {}, //
subList: [], //subList subList: [], //subList
@ -100,6 +99,7 @@
fromInventoryStatuses: "", fromInventoryStatuses: "",
managementList: [], managementList: [],
selectedItem: {}, selectedItem: {},
jobStatus:""
}; };
}, },
onLoad(option) { onLoad(option) {
@ -108,7 +108,6 @@
// // // //
if (option.status == "1") { if (option.status == "1") {
this.receive((callback => { this.receive((callback => {
this.received = true;
this.getDetail(); this.getDetail();
})); }));
} else { } else {
@ -127,7 +126,7 @@
onBackPress(e) { onBackPress(e) {
// //
if (e.from == 'backbutton') { if (e.from == 'backbutton') {
if (this.received) { if (this.jobStatus=="2") {
// //
cancleTakeInspectJob(this.id).then(res => { cancleTakeInspectJob(this.id).then(res => {
uni.navigateBack(); uni.navigateBack();
@ -204,6 +203,7 @@
} else { } else {
if (res.data.subList.length > 0) { if (res.data.subList.length > 0) {
that.jobContent = res.data; that.jobContent = res.data;
that.jobStatus = res.data.status
this.jobContent.failedQty = 0; this.jobContent.failedQty = 0;
this.jobContent.crackQty = 0; this.jobContent.crackQty = 0;
this.jobContent.notPassedQty = 0; this.jobContent.notPassedQty = 0;

6
pages/inspect/job/inspectResult.vue

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

2
pages/inventoryMove/coms/comMoveRecord.vue

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

3
pages/inventoryMove/coms/comMoveRecordCard.vue

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

8
pages/inventoryMove/job/inventoryMoveDetail.vue

@ -92,7 +92,6 @@
data() { data() {
return { return {
id: '', id: '',
received: false,
scanCount: 0, scanCount: 0,
jobContent: {}, // jobContent: {}, //
subList: [], //subList subList: [], //subList
@ -103,7 +102,8 @@
managementList: [], managementList: [],
businessTypeCode: '', businessTypeCode: '',
toLocationCode: '', toLocationCode: '',
toInventoryStatus: '' toInventoryStatus: '',
jobStatus:""
}; };
}, },
props: { props: {
@ -116,7 +116,6 @@
// // // //
if (option.status == "1") { if (option.status == "1") {
this.receive((callback => { this.receive((callback => {
this.received = true;
this.getDetail(); this.getDetail();
})); }));
} else { } else {
@ -135,7 +134,7 @@
onBackPress(e) { onBackPress(e) {
// //
if (e.from == 'backbutton') { if (e.from == 'backbutton') {
if (this.received) { if (this.jobStatus=="2") {
// //
cancleTakeInventoryMoveJob(this.id).then(res => { cancleTakeInventoryMoveJob(this.id).then(res => {
uni.navigateBack(); uni.navigateBack();
@ -223,6 +222,7 @@
} else { } else {
if (res.data.subList.length > 0) { if (res.data.subList.length > 0) {
that.jobContent = res.data; that.jobContent = res.data;
that.jobStatus = res.data.status
that.subList = res.data.subList; that.subList = res.data.subList;
that.detailSource = getDataSource(that.subList) that.detailSource = getDataSource(that.subList)
} else { } else {

55
pages/issue/coms/comIssueRequestPopup.vue

@ -37,22 +37,19 @@
</view> </view>
</view> </view>
<u-line /> <u-line />
<view class="uni-flex uni-row padding title u-col-center"> <view class="uni-flex uni-row padding title u-col-center">
<text>数量 </text> <text>数量 </text>
<view class="uni-flex uni-row uni-center" <view class="uni-flex uni-row uni-center"
style="align-items: center;margin-left: 20rpx;"> style="display: flex; align-items: center;margin-left: 20rpx;justify-content: center;">
<uni-number-box :value="counQty" @change="change" style='margin-left: 10rpx;'
:focus="numberFocus" @blur='numberFocus = false'> <input style="text-align: center;" class="qty_input" v-model="counQty" type="number"
</uni-number-box> @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> <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>
</view> </view>
<u-line /> <u-line />
@ -84,6 +81,7 @@
checkDirectoryItemExist checkDirectoryItemExist
} from '@/common/directory.js'; } from '@/common/directory.js';
import uom from '@/mycomponents/qty/uom.vue' import uom from '@/mycomponents/qty/uom.vue'
import stdPackQty from '@/mycomponents/qty/stdPackQty.vue'
import balanceStatus from '@/mycomponents/status/balanceStatus.vue' import balanceStatus from '@/mycomponents/status/balanceStatus.vue'
import comMessage from '@/mycomponents/common/comMessage.vue' import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanItem from '@/mycomponents/scan/winScanItem.vue' import winScanItem from '@/mycomponents/scan/winScanItem.vue'
@ -94,7 +92,8 @@
uom, uom,
balanceStatus, balanceStatus,
comMessage, comMessage,
winScanItem winScanItem,
stdPackQty
}, },
data() { data() {
return { return {
@ -114,7 +113,7 @@
requestInfo: null, requestInfo: null,
itemCodeList: [], itemCodeList: [],
isCheckItemCode: false, isCheckItemCode: false,
counQty: 0, counQty: undefined,
editPosition: true, editPosition: true,
numberFocus: false, numberFocus: false,
uom: "", uom: "",
@ -123,6 +122,8 @@
isModifiedPosition: true, isModifiedPosition: true,
positionList: [], positionList: [],
stdQty: 0, // stdQty: 0, //
maxlength:10,
stdPackInfo:undefined
} }
}, },
props: { props: {
@ -132,6 +133,21 @@
}, },
}, },
methods: { 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) { openRequestPopup(editPosition) {
if (this.positionList.length == 0) { if (this.positionList.length == 0) {
getWorkShopLineStation().then(res => { getWorkShopLineStation().then(res => {
@ -147,7 +163,9 @@
} else { } else {
this.itemCode = ""; this.itemCode = "";
this.uom = "" this.uom = ""
this.qty = 0 this.qty = 0;
this.counQty = undefined;
this.numberFocus = false
this.itemCodeGetFocus(); this.itemCodeGetFocus();
} }
@ -180,6 +198,11 @@
this.showErrorMessage("请输入物料", "itemCode") this.showErrorMessage("请输入物料", "itemCode")
return return
} }
if (this.counQty == undefined) {
this.showErrorMessage("请输入数量")
return
}
if (this.qty == 0) { if (this.qty == 0) {
this.showErrorMessage("数量必须大于0") this.showErrorMessage("数量必须大于0")
return return
@ -298,7 +321,7 @@
} }
this.itemCode = ""; this.itemCode = "";
this.checkItemCode(code) this.checkItemCode(code)
this.stdQty = scanResult.package.stdPackQty; this.stdPackInfo = scanResult.package;
} }
} }
} }

6
pages/issue/job/issueDetail.vue

@ -95,7 +95,7 @@
detailSource: [], // detailSource: [], //
detailOptions: [], detailOptions: [],
scanOptions: [], scanOptions: [],
received:false jobStatus:""
}; };
}, },
@ -109,7 +109,6 @@
// //
if (option.status == "1") { if (option.status == "1") {
this.receive((callback => { this.receive((callback => {
this.received = true;
this.getDetail(); this.getDetail();
})); }));
} else { } else {
@ -128,7 +127,7 @@
onBackPress(e) { onBackPress(e) {
// //
if (e.from === 'backbutton') { if (e.from === 'backbutton') {
if (this.received) { if (this.jobStatus=="2") {
// //
cancleTakeIssueJob(this.id).then(res => { cancleTakeIssueJob(this.id).then(res => {
uni.navigateBack(); uni.navigateBack();
@ -192,6 +191,7 @@
} else { } else {
if (res.data.subList.length > 0) { if (res.data.subList.length > 0) {
that.jobContent = res.data; that.jobContent = res.data;
that.jobStatus = res.data.status
that.subList = res.data.subList; that.subList = res.data.subList;
that.detailSource = getDataSource(that.detailSource, that.subList) that.detailSource = getDataSource(that.detailSource, that.subList)

5
pages/issue/record/issueRecord.vue

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

2
pages/package/record/mergePackageRecord.vue

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

2
pages/package/record/overPackageRecord.vue

@ -262,7 +262,7 @@
subItem.itemDesc2 = detail.package.itemDesc2; subItem.itemDesc2 = detail.package.itemDesc2;
subItem.fromInventoryStatus = detail.inventoryStatus; subItem.fromInventoryStatus = detail.inventoryStatus;
subItem.fromQty = detail.qty subItem.fromQty = detail.handleQty
subItem.fromPackingNumber = detail.packingNumber; subItem.fromPackingNumber = detail.packingNumber;
subItem.fromBatch = detail.batch; subItem.fromBatch = detail.batch;
subItem.fromLocationCode = detail.locationCode; 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() { data() {
return { return {
id: '', id: '',
received: false,
scanCount: 0, scanCount: 0,
jobContent: {}, // jobContent: {}, //
subList: [], //subList subList: [], //subList
@ -112,6 +111,7 @@
toLocationCode: "", toLocationCode: "",
toLocationInfo: {}, toLocationInfo: {},
tolocationTypeList: [], tolocationTypeList: [],
jobStatus:""
}; };
}, },
onLoad(option) { onLoad(option) {
@ -120,7 +120,6 @@
// //
if (option.status == "1") { if (option.status == "1") {
this.receive((callback => { this.receive((callback => {
this.received = true;
this.getDetail(); this.getDetail();
})); }));
} else { } else {
@ -138,7 +137,7 @@
onBackPress(e) { onBackPress(e) {
// //
if (e.from == 'backbutton') { if (e.from == 'backbutton') {
if (this.received) { if (this.jobStatus=="2") {
// //
cancleTakeProductPutawayJob(this.id).then(res => { cancleTakeProductPutawayJob(this.id).then(res => {
uni.navigateBack(); uni.navigateBack();
@ -183,6 +182,7 @@
if (res.data.subList.length > 0) { if (res.data.subList.length > 0) {
that.jobContent = res.data; that.jobContent = res.data;
that.subList = res.data.subList; that.subList = res.data.subList;
that.jobStatus = res.data.status
that.fromLocationCode = that.subList[0].fromLocationCode that.fromLocationCode = that.subList[0].fromLocationCode
that.toLocationCode = that.subList[0].toLocationCode that.toLocationCode = that.subList[0].toLocationCode
that.tolocationTypeList = getLocationTypeArray(that.jobContent.toLocationTypes) that.tolocationTypeList = getLocationTypeArray(that.jobContent.toLocationTypes)

2
pages/productPutaway/record/productPutawayRecord.vue

@ -335,7 +335,7 @@
submitItem.fromLocationCode = detail.locationCode; submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode; submitItem.toLocationCode = detail.toLocationCode;
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty; submitItem.qty = detail.handleQty;
submitItem.package =""; submitItem.package ="";
subList.push(submitItem) subList.push(submitItem)
} }

15
pages/productPutaway/request/putawayRequestCreate.vue

@ -53,6 +53,7 @@
import { import {
goHome, goHome,
updateTitle, updateTitle,
deepCopyData,
getCurrDateTime, getCurrDateTime,
getPackingNumberAndBatchByList getPackingNumberAndBatchByList
} from '@/common/basic.js'; } from '@/common/basic.js';
@ -210,14 +211,7 @@
}, },
calcHandleQty() { calcHandleQty() {
for (let item of this.detailSource) { calcHandleQty(this.detailSource)
item.qty = 0;
for (let detail of item.subList) {
if (detail != undefined) {
item.qty = calc.add(item.qty,detail.qty)
}
}
}
this.$forceUpdate(); this.$forceUpdate();
}, },
@ -283,7 +277,7 @@
productPutawayRequestSubmit(params).then(res => { productPutawayRequestSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成制品上架申请<br>" + res.data, ) this.showCommitSuccessMessage("提交成功<br>生成制品上架申请<br>" + res.data)
} else { } else {
this.showErrorMessage("提交失败[" + res.msg + "]") this.showErrorMessage("提交失败[" + res.msg + "]")
} }
@ -305,8 +299,7 @@
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
var subItem = {}; var subItem = deepCopyData(detail)
Object.assign(subItem, detail)
subItem.fromLocationCode = detail.locationCode; subItem.fromLocationCode = detail.locationCode;
subItem.qty = detail.handleQty; subItem.qty = detail.handleQty;
subItem.package = null; subItem.package = null;

8
pages/productReceipt/job/productReceiptDetail.vue

@ -97,7 +97,6 @@
return { return {
id: '', id: '',
receiptJob: {}, receiptJob: {},
received: false,
toLocationCode: '', toLocationCode: '',
isShowPackingCode: true, isShowPackingCode: true,
scanCount: 0, scanCount: 0,
@ -105,7 +104,8 @@
subList: [], //subList subList: [], //subList
detailSource: [], // detailSource: [], //
toLocationTypeList: [], toLocationTypeList: [],
managementList: [] managementList: [],
jobStatus:""
}; };
}, },
@ -115,7 +115,6 @@
// //
if (option.status == "1") { if (option.status == "1") {
this.receive((callback => { this.receive((callback => {
this.received = true;
this.getDetail(); this.getDetail();
})); }));
} else { } else {
@ -134,7 +133,7 @@
onBackPress(e) { onBackPress(e) {
// //
if (e.from == 'backbutton') { if (e.from == 'backbutton') {
if (this.received) { if (this.jobStatus=="2") {
// //
cancleTakeProductReceiptJob(this.id).then(res => { cancleTakeProductReceiptJob(this.id).then(res => {
uni.navigateBack(); uni.navigateBack();
@ -184,6 +183,7 @@
if (res.data.subList.length > 0) { if (res.data.subList.length > 0) {
that.jobContent = res.data; that.jobContent = res.data;
that.subList = res.data.subList; that.subList = res.data.subList;
that.jobStatus = res.data.status
that.toLocationCode = that.subList[0].toLocationCode that.toLocationCode = that.subList[0].toLocationCode
that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes) that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes)
that.detailSource = getDataSource(that.subList) that.detailSource = getDataSource(that.subList)

19
pages/productReceipt/record/productReceiptRecord.vue

@ -64,6 +64,8 @@
import { import {
calc calc
} from '@/common/calc.js'; } from '@/common/calc.js';
import { Decimal } from 'decimal.js';//
import { import {
getInventoryStatusDesc, getInventoryStatusDesc,
@ -186,8 +188,8 @@
itemName: pack.itemName, itemName: pack.itemName,
stdPackQty: pack.stdPackQty, stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit, stdPackUnit: pack.stdPackUnit,
qty: Number(label.qty), qty: new Decimal(label.qty).toNumber(),
handleQty: 0, handleQty: new Decimal(0).toNumber(),
uom: pack.uom, uom: pack.uom,
subList: [] subList: []
} }
@ -195,11 +197,10 @@
}, },
createDetailInfo(label, pack) { createDetailInfo(label, pack) {
let detail = {}; let detail = deepCopyData(label);
Object.assign(detail, label)
detail.scaned = true; detail.scaned = true;
detail.qty = Number(label.qty); detail.qty = new Decimal(label.qty).toNumber();
detail.handleQty = 0; detail.handleQty = new Decimal(label.qty).toNumber();
detail.inventoryStatus = "OK" detail.inventoryStatus = "OK"
detail.stdPackQty = pack.stdPackQty; detail.stdPackQty = pack.stdPackQty;
detail.stdPackUnit = pack.stdPackUnit; detail.stdPackUnit = pack.stdPackUnit;
@ -211,10 +212,10 @@
calcHandleQty() { calcHandleQty() {
for (let item of this.detailSource) { for (let item of this.detailSource) {
item.qty = 0; item.handleQty = new Decimal(0).toNumber();
for (let detail of item.subList) { for (let detail of item.subList) {
if (detail != undefined) { 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.productionlineCode = this.productionLineCode;
submitItem.workStationCode = this.workStationCode; submitItem.workStationCode = this.workStationCode;
submitItem.qty = detail.handleQty != 0 ? detail.handleQty : detail.qty; submitItem.qty = detail.handleQty;
submitItem.package = ""; submitItem.package = "";
subList.push(submitItem) subList.push(submitItem)

6
pages/productionReceipt/job/productionReceiptDetail.vue

@ -100,7 +100,6 @@
data() { data() {
return { return {
id: '', id: '',
received: false,
scanCount: 0, scanCount: 0,
jobContent: {}, // jobContent: {}, //
subList: [], //subList subList: [], //subList
@ -109,6 +108,7 @@
fromLocationCode: "", fromLocationCode: "",
toLocationCode: "", toLocationCode: "",
tolocationTypeList: [], tolocationTypeList: [],
jobStatus:""
}; };
}, },
onLoad(option) { onLoad(option) {
@ -117,7 +117,6 @@
// //
if (option.status == "1") { if (option.status == "1") {
this.receive((callback => { this.receive((callback => {
this.received = true;
this.getDetail(); this.getDetail();
})); }));
} else { } else {
@ -135,7 +134,7 @@
onBackPress(e) { onBackPress(e) {
// //
if (e.from == 'backbutton') { if (e.from == 'backbutton') {
if (this.received) { if (this.jobStatus=="2") {
// //
cancleTakeProductionReceiptJob(this.id).then(res => { cancleTakeProductionReceiptJob(this.id).then(res => {
uni.navigateBack(); uni.navigateBack();
@ -179,6 +178,7 @@
} else { } else {
if (res.data.subList.length > 0) { if (res.data.subList.length > 0) {
that.jobContent = res.data; that.jobContent = res.data;
that.jobStatus = res.data.status
that.subList = res.data.subList; that.subList = res.data.subList;
that.fromLocationCode = that.subList[0].fromLocationCode that.fromLocationCode = that.subList[0].fromLocationCode
that.toLocationCode = that.subList[0].toLocationCode that.toLocationCode = that.subList[0].toLocationCode

1
pages/productionReceipt/record/productionReceiptRecord.vue

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

13
pages/productionReturn/coms/comReturnRecord.vue

@ -5,8 +5,7 @@
<template v-slot:title> <template v-slot:title>
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="removeData($event,dataContent)" :right-options="removeOptions"> <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>
:isShowBalance="true"></item-qty>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
@ -17,7 +16,7 @@
<uni-swipe-action-item @click="swipeClick($event,item,index)" <uni-swipe-action-item @click="swipeClick($event,item,index)"
:right-options="item.scaned?scanOptions:detailOptions"> :right-options="item.scaned?scanOptions:detailOptions">
<balance :dataContent="item" :isShowStdPack="false" :isShowStatus="true" :isShowPack="true" <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" <!-- <production-label :dataContent="item" :packageContent="item.package"
:isShowLocation="false"> :isShowLocation="false">
</production-label> --> </production-label> -->
@ -86,6 +85,10 @@
isShowToLocation: { isShowToLocation: {
type: Boolean, type: Boolean,
default: true default: true
},
isShowFromLocation: {
type: Boolean,
default: true
} }
}, },
watch: { watch: {
@ -147,7 +150,7 @@
edit(item) { edit(item) {
this.editItem = item; this.editItem = item;
this.$refs.recommendQtyEdit.openRecordEditPopup(item.qty); this.$refs.recommendQtyEdit.openRecordEditPopup(item.handleQty);
// this.$refs.recommendQtyEdit.openEditPopup(item.qty); // this.$refs.recommendQtyEdit.openEditPopup(item.qty);
}, },
@ -165,7 +168,7 @@
}); });
}, },
confirm(qty) { confirm(qty) {
this.editItem.qty = qty; this.editItem.handleQty = qty;
this.$emit('updateData') this.$emit('updateData')
} }
} }

35
pages/productionReturn/coms/comReturnRequestPopup.vue

@ -28,7 +28,7 @@
<view class="title padding" style="display: flex;"> <view class="title padding" style="display: flex;">
<text style=" flex-shrink: 0;">箱码</text> <text style=" flex-shrink: 0;">物料</text>
<view class="" style="width: 100% ;"> <view class="" style="width: 100% ;">
{{itemCode}} {{itemCode}}
</view> </view>
@ -46,10 +46,13 @@
<text>数量 : </text> <text>数量 : </text>
<view class="uni-flex uni-row uni-center" <view class="uni-flex uni-row uni-center"
style="align-items: center;margin-left: 20rpx;"> style="align-items: center;margin-left: 20rpx;">
<uni-number-box :value="counQty" @change="change" style='margin-left: 10rpx;' <input style="text-align: center;" class="qty_input" v-model="counQty" type="number"
:focus="numberFocus" @blur='numberFocus = false'> @confirm="confirm()" :focus="numberFocus" @input="checkNum" :maxlength="maxlength" />
</uni-number-box>
<uom :uom="uom"></uom> <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>
</view> </view>
@ -63,7 +66,7 @@
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
<win-scan-item ref="scanPopup" title='物料代码' @getScanCode='getScanCode'> <win-scan-item ref="scanPopup" title='物料代码' @getScanResult='getScanCode'>
</win-scan-item> </win-scan-item>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
@ -82,6 +85,7 @@
checkDirectoryItemExist checkDirectoryItemExist
} from '@/common/directory.js'; } from '@/common/directory.js';
import uom from '@/mycomponents/qty/uom.vue' import uom from '@/mycomponents/qty/uom.vue'
import stdPackQty from '@/mycomponents/qty/stdPackQty.vue'
import balanceStatus from '@/mycomponents/status/balanceStatus.vue' import balanceStatus from '@/mycomponents/status/balanceStatus.vue'
import comMessage from '@/mycomponents/common/comMessage.vue' import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanItem from '@/mycomponents/scan/winScanItem.vue' import winScanItem from '@/mycomponents/scan/winScanItem.vue'
@ -90,6 +94,7 @@
export default { export default {
components: { components: {
uom, uom,
stdPackQty,
balanceStatus, balanceStatus,
comMessage, comMessage,
winScanItem winScanItem
@ -120,6 +125,8 @@
show: false, show: false,
isModifiedPosition: true, isModifiedPosition: true,
positionList: [], positionList: [],
maxlength:10,
stdPackInfo:undefined,
list: [{ list: [{
value: 1, value: 1,
label: '车间1', label: '车间1',
@ -193,6 +200,21 @@
}, },
}, },
methods: { 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) { openRequestPopup(editPosition) {
if (this.positionList.length == 0) { if (this.positionList.length == 0) {
getWorkShopLineStation().then(res => { getWorkShopLineStation().then(res => {
@ -352,13 +374,14 @@
} }
}, },
getScanCode(code) { getScanCode(code, scanResult) {
if (code == "") { if (code == "") {
this.showErrorMessage('物料号不能为空') this.showErrorMessage('物料号不能为空')
return; return;
} }
this.itemCode = ""; this.itemCode = "";
this.checkItemCode(code) this.checkItemCode(code)
this.stdPackInfo = scanResult.package;
}, },
} }

8
pages/productionReturn/job/returnDetail.vue

@ -104,7 +104,6 @@
return { return {
id: '', id: '',
jobContent: {}, jobContent: {},
received: false,
toLocationCode: '', toLocationCode: '',
scanCount: 0, scanCount: 0,
jobContent: {}, // jobContent: {}, //
@ -115,7 +114,8 @@
toLocationTypeList: [], toLocationTypeList: [],
toLocationInfo: {}, toLocationInfo: {},
businessTypeInfo: {}, businessTypeInfo: {},
titleInfo: "" titleInfo: "",
jobStatus:""
}; };
}, },
onLoad(option) { onLoad(option) {
@ -124,7 +124,6 @@
// // // //
if (option.status == "1") { if (option.status == "1") {
this.receive((callback => { this.receive((callback => {
this.received = true;
this.getDetail(); this.getDetail();
})); }));
} else { } else {
@ -142,7 +141,7 @@
onBackPress(e) { onBackPress(e) {
// //
if (e.from == 'backbutton') { if (e.from == 'backbutton') {
if (this.received) { if (this.jobStatus=="2") {
// //
cancleTakeProductionReturnJob(this.id).then(res => { cancleTakeProductionReturnJob(this.id).then(res => {
uni.navigateBack(); uni.navigateBack();
@ -190,6 +189,7 @@
} else { } else {
if (res.data.subList.length > 0) { if (res.data.subList.length > 0) {
that.jobContent = res.data; that.jobContent = res.data;
that.jobStatus = res.data.status
that.subList = res.data.subList; that.subList = res.data.subList;
that.detailSource = getDataSource(that.subList) that.detailSource = getDataSource(that.subList)

101
pages/productionReturn/record/returnToHold.vue

@ -62,11 +62,15 @@
getPackingNumberAndBatchByList, getPackingNumberAndBatchByList,
deepCopyData deepCopyData
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
calc calc
} from '@/common/calc.js'; } from '@/common/calc.js';
import {
Decimal
} from 'decimal.js'; //
import { import {
getDirectoryItemArray getDirectoryItemArray
} from '@/common/directory.js'; } from '@/common/directory.js';
@ -168,7 +172,7 @@
this.$refs.scanPopup.openScanPopup(isEditPosition); this.$refs.scanPopup.openScanPopup(isEditPosition);
}, },
async getScanResult(result, param) { async getScanResult(result, param) {
this.positionInfo = param.positionInfo; this.positionInfo = param.positionInfo;
this.workshopCode = param.workshopCode; this.workshopCode = param.workshopCode;
this.productionLineCode = param.productionLineCode; this.productionLineCode = param.productionLineCode;
@ -186,30 +190,30 @@
if (item == undefined) { if (item == undefined) {
var filters = [] var filters = []
filters.push({ filters.push({
column: "itemCode", column: "itemCode",
action: "==", action: "==",
value: label.itemCode value: label.itemCode
}) })
filters.push({ filters.push({
column: "locationCode", column: "locationCode",
action: "==", action: "==",
value: this.rawLocationCode value: this.rawLocationCode
}) })
var params = { var params = {
filters: filters, filters: filters,
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 100,
} }
var isCheckItemCode = await getBalanceByFilter(params); var isCheckItemCode = await getBalanceByFilter(params);
if(isCheckItemCode.data==null||isCheckItemCode.data.list==0){ if (isCheckItemCode.data == null || isCheckItemCode.data.list == 0) {
this.showErrorMessage("未查询到物料号[" + label.itemCode + "]" + this.showErrorMessage("未查询到物料号[" + label.itemCode + "]" +
"库位[" + this.rawLocationCode + "]的信息") "库位[" + this.rawLocationCode + "]的信息")
return return
} }
var itemp = this.createItemInfo(label, pack); var itemp = this.createItemInfo(label, pack);
let newDetail = this.createDetailInfo(label, pack); let newDetail = this.createDetailInfo(label, pack);
newDetail.toLocationCode = "HOLD"; newDetail.toLocationCode = "HOLD";
@ -247,8 +251,8 @@
itemName: pack.itemName, itemName: pack.itemName,
stdPackQty: pack.stdPackQty, stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit, stdPackUnit: pack.stdPackUnit,
qty: Number(label.qty), qty: new Decimal(label.qty).toNumber(),
handleQty: 0, handleQty: new Decimal(0).toNumber(),
uom: pack.uom, uom: pack.uom,
subList: [] subList: []
} }
@ -256,11 +260,10 @@
}, },
createDetailInfo(label, pack) { createDetailInfo(label, pack) {
let detail = {}; let detail = deepCopyData(label);
Object.assign(detail, label)
detail.scaned = true; detail.scaned = true;
detail.qty = Number(label.qty); detail.qty = new Decimal(label.qty).toNumber();
detail.handleQty = 0; detail.handleQty = new Decimal(label.qty).toNumber();
detail.inventoryStatus = "OK" detail.inventoryStatus = "OK"
detail.stdPackQty = pack.stdPackQty; detail.stdPackQty = pack.stdPackQty;
detail.stdPackUnit = pack.stdPackUnit; detail.stdPackUnit = pack.stdPackUnit;
@ -273,10 +276,10 @@
calcHandleQty() { calcHandleQty() {
for (let item of this.detailSource) { for (let item of this.detailSource) {
item.qty = 0; item.handleQty = new Decimal(0).toNumber();
for (let detail of item.subList) { for (let detail of item.subList) {
if (detail != undefined) { if (detail != undefined) {
item.qty = calc.add(item.qty,detail.qty) item.handleQty = calc.add(item.handleQty, detail.handleQty)
} }
} }
} }
@ -361,7 +364,7 @@
} }
}, },
setFromPrecisionStrategParams() { setFromPrecisionStrategParams() {
var itemList = [] var itemList = []
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
@ -381,13 +384,13 @@
} }
itemList.push(result) itemList.push(result)
} }
} }
}) })
}) })
return itemList; return itemList;
}, },
setToPrecisionStrategParams() { setToPrecisionStrategParams() {
var itemList = [] var itemList = []
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
@ -407,7 +410,7 @@
} }
itemList.push(result) itemList.push(result)
} }
} }
}) })
}) })
@ -421,35 +424,37 @@
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
var submitItem = deepCopyData(detail) var submitItem = deepCopyData(detail)
var fromInfo = getPackingNumberAndBatchByList(this.fromManagementList, detail.itemCode, var fromInfo = getPackingNumberAndBatchByList(this.fromManagementList, detail
.itemCode,
detail.packingNumber, detail.fromLocationCode, detail.batch); 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); detail.packingNumber, detail.toLocationCode, detail.batch);
submitItem.itemCode = detail.itemCode; submitItem.itemCode = detail.itemCode;
submitItem.itemName = detail.package.itemName; submitItem.itemName = detail.package.itemName;
submitItem.itemDesc1 = detail.package.itemDesc1; submitItem.itemDesc1 = detail.package.itemDesc1;
submitItem.itemDesc2 = detail.package.itemDesc2; submitItem.itemDesc2 = detail.package.itemDesc2;
submitItem.inventoryStatus = detail.inventoryStatus; submitItem.inventoryStatus = detail.inventoryStatus;
submitItem.fromPackingNumber = fromInfo.packingNumber; submitItem.fromPackingNumber = fromInfo.packingNumber;
submitItem.toPackingNumber = toInfo.packingNumber; submitItem.toPackingNumber = toInfo.packingNumber;
submitItem.fromContainerNumber = detail.containerNumber; submitItem.fromContainerNumber = detail.containerNumber;
submitItem.toContainerNumber = detail.containerNumber submitItem.toContainerNumber = detail.containerNumber
submitItem.fromBatch = fromInfo.batch; submitItem.fromBatch = fromInfo.batch;
submitItem.toBatch = toInfo.batch; submitItem.toBatch = toInfo.batch;
submitItem.fromLocationCode = detail.fromLocationCode; submitItem.fromLocationCode = detail.fromLocationCode;
submitItem.toLocationCode = detail.toLocationCode; submitItem.toLocationCode = detail.toLocationCode;
submitItem.productionlineCode = this.productionLineCode; submitItem.productionlineCode = this.productionLineCode;
submitItem.workStationCode = this.workStationCode; submitItem.workStationCode = this.workStationCode;
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty; submitItem.qty = detail.handleQty;
subList.push(submitItem) 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="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<comReturnRecord :dataContent="item" :index="index" @removeItem="removeItem(index,item)" <comReturnRecord :dataContent="item" :index="index" @removeItem="removeItem(index,item)"
:isShowFromLocation="true"
@updateData="updateData" @removePack="removePack"> @updateData="updateData" @removePack="removePack">
</comReturnRecord> </comReturnRecord>
</view> </view>
@ -61,6 +62,8 @@
import { import {
calc calc
} from '@/common/calc.js'; } from '@/common/calc.js';
import { Decimal } from 'decimal.js';//
import { import {
getBusinessType, getBusinessType,
@ -212,9 +215,11 @@
let newDetail = this.createDetailInfo(label, pack); let newDetail = this.createDetailInfo(label, pack);
newDetail.toLocationCode = toLocation.code; newDetail.toLocationCode = toLocation.code;
newDetail.fromLocationCode = this.rawLocationCode; newDetail.fromLocationCode = this.rawLocationCode;
newDetail.locationCode = this.rawLocationCode;
newDetail.toWarehouseCode = toLocation.warehouseCode; newDetail.toWarehouseCode = toLocation.warehouseCode;
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
this.detailSource.push(itemp) this.detailSource.push(itemp)
this.calcHandleQty();
}) })
} else { } else {
@ -232,6 +237,7 @@
newDetail.fromLocationCode = this.rawLocationCode; newDetail.fromLocationCode = this.rawLocationCode;
newDetail.toWarehouseCode = toLocation.warehouseCode; newDetail.toWarehouseCode = toLocation.warehouseCode;
item.subList.push(newDetail); item.subList.push(newDetail);
this.calcHandleQty();
}); });
} else { } else {
@ -240,7 +246,6 @@
} }
} }
} }
this.calcHandleQty();
}, },
createItemInfo(label, pack) { createItemInfo(label, pack) {
let item = { let item = {
@ -248,8 +253,8 @@
itemName: pack.itemName, itemName: pack.itemName,
stdPackQty: pack.stdPackQty, stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit, stdPackUnit: pack.stdPackUnit,
qty: Number(label.qty), qty: new Decimal(label.qty).toNumber(),
handleQty: 0, handleQty: new Decimal(0).toNumber(),
uom: pack.uom, uom: pack.uom,
subList: [] subList: []
} }
@ -257,11 +262,10 @@
}, },
createDetailInfo(label, pack) { createDetailInfo(label, pack) {
let detail = {}; let detail = deepCopyData(label);
Object.assign(detail, label)
detail.scaned = true; detail.scaned = true;
detail.qty = Number(label.qty); detail.qty = new Decimal(label.qty).toNumber();
detail.handleQty =0; detail.handleQty = new Decimal(label.qty).toNumber();
detail.inventoryStatus = "OK" detail.inventoryStatus = "OK"
detail.stdPackQty = pack.stdPackQty; detail.stdPackQty = pack.stdPackQty;
detail.stdPackUnit = pack.stdPackUnit; detail.stdPackUnit = pack.stdPackUnit;
@ -274,10 +278,10 @@
calcHandleQty() { calcHandleQty() {
for (let item of this.detailSource) { for (let item of this.detailSource) {
item.qty = 0; item.handleQty = new Decimal(0).toNumber();
for (let detail of item.subList) { for (let detail of item.subList) {
if (detail != undefined) { 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]; var item = this.detailSource[i];
if (item.subList.length == 0) { if (item.subList.length == 0) {
this.detailSource.splice(i, 1) this.detailSource.splice(i, 1)
this.clearData();
this.$refs.scanPopup.initData();
} }
} }
this.updateData(); this.updateData();
@ -387,7 +393,6 @@
this.showErrorMessage("没有要提交的数据,请先扫描") this.showErrorMessage("没有要提交的数据,请先扫描")
} }
}, },
setFromPrecisionStrategParams() { setFromPrecisionStrategParams() {
@ -477,7 +482,7 @@
submitItem.productionlineCode = this.productionLineCode; submitItem.productionlineCode = this.productionLineCode;
submitItem.workStationCode = this.workStationCode; submitItem.workStationCode = this.workStationCode;
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty; submitItem.qty = detail.handleQty;
subList.push(submitItem) subList.push(submitItem)
} }
}) })
@ -530,6 +535,7 @@
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
this.clearData(); this.clearData();
this.$refs.scanPopup.initData();
}) })
}, },
clearData() { clearData() {

10
pages/purchaseReceipt/job/receiptDetail.vue

@ -95,7 +95,6 @@
return { return {
id: '', id: '',
receiptJob: {}, receiptJob: {},
received: false,
scanCount: 0, scanCount: 0,
jobContent: {}, // jobContent: {}, //
subList: [], //subList subList: [], //subList
@ -104,7 +103,8 @@
toLocationCode: '', toLocationCode: '',
toLocationInfo: {}, toLocationInfo: {},
businessTypeInfo: {}, businessTypeInfo: {},
managementList: [] managementList: [],
jobStatus:""
}; };
}, },
onLoad(option) { onLoad(option) {
@ -113,7 +113,6 @@
// //
if (option.status == "1") { if (option.status == "1") {
this.receive((callback => { this.receive((callback => {
this.received = true;
this.getDetail(); this.getDetail();
})); }));
} else { } else {
@ -131,7 +130,7 @@
onBackPress(e) { onBackPress(e) {
// //
if (e.from == 'backbutton') { if (e.from == 'backbutton') {
if (this.received) { if (this.jobStatus=="2") {
// //
cancleTakePurchaseReceiptJob(this.id).then(res => { cancleTakePurchaseReceiptJob(this.id).then(res => {
uni.navigateBack(); uni.navigateBack();
@ -187,7 +186,8 @@
that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes); that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes);
// that.jobContent.toLocationTypeList = that.toLocationTypeList; // that.jobContent.toLocationTypeList = that.toLocationTypeList;
that.subList = res.data.subList; 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) that.detailSource = getDataSource(that.subList)
} else { } else {
that.showMessage('列表数据为0'); that.showMessage('列表数据为0');

8
pages/purchaseReturn/job/returnDetail.vue

@ -90,13 +90,13 @@
data() { data() {
return { return {
id: '', id: '',
received: false,
scanCount: 0, scanCount: 0,
jobContent: {}, // jobContent: {}, //
subList: [], //subList subList: [], //subList
detailSource: [], // detailSource: [], //
businessTypeInfo: {}, businessTypeInfo: {},
managementList: [] managementList: [],
jobStatus:""
}; };
}, },
onLoad(option) { onLoad(option) {
@ -105,7 +105,6 @@
// //
if (option.status == "1") { if (option.status == "1") {
this.receive((callback => { this.receive((callback => {
this.received = true;
this.getDetail(); this.getDetail();
})); }));
} else { } else {
@ -123,7 +122,7 @@
onBackPress(e) { onBackPress(e) {
// //
if (e.from == 'backbutton') { if (e.from == 'backbutton') {
if (this.received) { if (this.jobStatus=="2") {
// //
cancleTakePurchasereturnJob(this.id).then(res => { cancleTakePurchasereturnJob(this.id).then(res => {
uni.navigateBack(); uni.navigateBack();
@ -179,6 +178,7 @@
} else { } else {
if (res.data.subList.length > 0) { if (res.data.subList.length > 0) {
that.jobContent = res.data; that.jobContent = res.data;
that.jobStatus = res.data.status
that.subList = res.data.subList; that.subList = res.data.subList;
that.toLocationCode = that.jobContent.toLocationCode that.toLocationCode = that.jobContent.toLocationCode
that.detailSource = getDataSource(that.subList); 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) { if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
console.log("提交参数", JSON.stringify(params));
// //
// //
@ -254,7 +253,7 @@
if (res.data) { if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成采购退货记录<br>" + res.data) this.showCommitSuccessMessage("提交成功<br>生成采购退货记录<br>" + res.data)
} else { } else {
this.showErrorMessage("提交失败" + res.msg) this.showErrorMessage("提交失败[" + res.msg+"]")
} }
}).catch(error => { }).catch(error => {
uni.hideLoading() uni.hideLoading()
@ -290,7 +289,7 @@
submitItem.fromLocationCode = this.fromLocationCode; submitItem.fromLocationCode = this.fromLocationCode;
submitItem.toLocationCode = ''; //退 submitItem.toLocationCode = ''; //退
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty; submitItem.qty = detail.handleQty;
submitItem.package = ""; submitItem.package = "";
subList.push(submitItem) subList.push(submitItem)
} }

8
pages/purchaseReturn/request/returnRequestCreate.vue

@ -45,6 +45,7 @@
goHome, goHome,
updateTitle, updateTitle,
navigateBack, navigateBack,
deepCopyData,
getCurrDateOneMonthsTimes getCurrDateOneMonthsTimes
} from '@/common/basic.js'; } from '@/common/basic.js';
@ -209,7 +210,6 @@
commit() { commit() {
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
console.log("提交参数", JSON.stringify(params));
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
@ -240,11 +240,13 @@
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
var submitItem = deepCopyData(detail)
if(supplierCode==""){ if(supplierCode==""){
supplierCode = detail.package.supplierCode supplierCode = detail.package.supplierCode
} }
detail.fromLocationCode = detail.locationCode submitItem.fromLocationCode = detail.locationCode
subList.push(detail) submitItem.qty =detail.handleQty;
subList.push(submitItem)
} }
}) })
}) })

6
pages/putaway/job/putawayDetail.vue

@ -97,7 +97,6 @@
data() { data() {
return { return {
id: '', id: '',
received: false,
scanCount: 0, scanCount: 0,
jobContent: {}, // jobContent: {}, //
subList: [], //subList subList: [], //subList
@ -106,6 +105,7 @@
fromLocationCode: "", fromLocationCode: "",
toLocationCode: "", toLocationCode: "",
tolocationTypeList: [], tolocationTypeList: [],
jobStatus:""
}; };
}, },
onLoad(option) { onLoad(option) {
@ -114,7 +114,6 @@
// //
if (option.status == "1") { if (option.status == "1") {
this.receive((callback => { this.receive((callback => {
this.received = true;
this.getDetail(); this.getDetail();
})); }));
} else { } else {
@ -132,7 +131,7 @@
onBackPress(e) { onBackPress(e) {
// //
if (e.from == 'backbutton') { if (e.from == 'backbutton') {
if (this.received) { if (this.jobStatus=="2") {
// //
cancleTakePutawayJob(this.id).then(res => { cancleTakePutawayJob(this.id).then(res => {
uni.navigateBack(); uni.navigateBack();
@ -180,6 +179,7 @@
} else { } else {
if (res.data.subList.length > 0) { if (res.data.subList.length > 0) {
that.jobContent = res.data; that.jobContent = res.data;
that.jobStatus = res.data.status
that.subList = res.data.subList; that.subList = res.data.subList;
that.detailSource = getDataSource(that.subList) that.detailSource = getDataSource(that.subList)

2
pages/putaway/record/putawayRecord.vue

@ -386,7 +386,7 @@
// detail.toInventoryStatus = detail.inventoryStatus // detail.toInventoryStatus = detail.inventoryStatus
// detail.toLocationCode = detail.toLocationCode // detail.toLocationCode = detail.toLocationCode
submitItem.qty = detail.handleQty != 0 ? detail.handleQty : detail.qty; submitItem.qty = detail.handleQty ;
submitItem.package = ""; submitItem.package = "";
subList.push(submitItem) subList.push(submitItem)
} }

35
pages/repleinsh/coms/comRepleinshRequestPopup.vue

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

6
pages/repleinsh/job/repleinshDetail.vue

@ -100,7 +100,7 @@
scanOptions: [], scanOptions: [],
toLocationCode: '', toLocationCode: '',
tolocationTypeList: [], tolocationTypeList: [],
received:false, jobStatus:""
}; };
}, },
@ -114,7 +114,6 @@
// //
if (option.status == "1") { if (option.status == "1") {
this.receive((callback => { this.receive((callback => {
this.received = true;
this.getDetail(); this.getDetail();
})); }));
} else { } else {
@ -133,7 +132,7 @@
onBackPress(e) { onBackPress(e) {
// //
if (e.from === 'backbutton') { if (e.from === 'backbutton') {
if (this.received) { if (this.jobStatus=="2") {
// //
cancleTakeRepleinshJob(this.id).then(res => { cancleTakeRepleinshJob(this.id).then(res => {
uni.navigateBack(); uni.navigateBack();
@ -183,6 +182,7 @@
} else { } else {
if (res.data.subList.length > 0) { if (res.data.subList.length > 0) {
that.jobContent = res.data; that.jobContent = res.data;
that.jobStatus = res.data.status
that.subList = res.data.subList; that.subList = res.data.subList;
that.toLocationCode = that.subList[0].toLocationCode that.toLocationCode = that.subList[0].toLocationCode
that.tolocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes) that.tolocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes)

2
pages/repleinsh/record/repleinshRecord.vue

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

8
pages/scrap/job/scrapJobDetail.vue

@ -86,14 +86,14 @@
return { return {
id: '', id: '',
receiptJob: {}, receiptJob: {},
received: false,
scanCount: 0, scanCount: 0,
jobContent: {}, // jobContent: {}, //
subList: [], //subList subList: [], //subList
detailSource: [], // detailSource: [], //
toLocationInfo: {}, toLocationInfo: {},
businessTypeInfo: {}, businessTypeInfo: {},
managementList: [] managementList: [],
jobStatus:""
}; };
}, },
onLoad(option) { onLoad(option) {
@ -102,7 +102,6 @@
// //
if (option.status == "1") { if (option.status == "1") {
this.receive((callback => { this.receive((callback => {
this.received = true;
this.getDetail(); this.getDetail();
})); }));
} else { } else {
@ -120,7 +119,7 @@
onBackPress(e) { onBackPress(e) {
// //
if (e.from == 'backbutton') { if (e.from == 'backbutton') {
if (this.received) { if (this.jobStatus=="2") {
// //
cancleTakeScrapJob(this.id).then(res => { cancleTakeScrapJob(this.id).then(res => {
uni.navigateBack(); uni.navigateBack();
@ -173,6 +172,7 @@
} else { } else {
if (res.data.subList.length > 0) { if (res.data.subList.length > 0) {
that.jobContent = res.data; that.jobContent = res.data;
that.jobStatus = res.data.status
that.subList = res.data.subList; that.subList = res.data.subList;
that.detailSource = getDataSource(that.subList) that.detailSource = getDataSource(that.subList)
} else { } 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="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" <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" :isShowToLocation="false"
@removePack="removePack"> @removePack="removePack">
</record-com-detail-card> </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) { showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, res => {
if (res) { if (res) {
@ -297,7 +283,7 @@
submitItem.toLocationCode = ""; submitItem.toLocationCode = "";
submitItem.reason = this.reasonCode; submitItem.reason = this.reasonCode;
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty; submitItem.qty = detail.handleQty;
submitItem.package =""; submitItem.package ="";
subList.push(submitItem) 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="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" <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"> @removePack="removePack">
</record-com-detail-card> </record-com-detail-card>
</view> </view>

8
pages/transfer/job/issueDetail.vue

@ -92,7 +92,6 @@
data() { data() {
return { return {
id: '', id: '',
received: false,
scanCount: 0, scanCount: 0,
jobContent: {}, // jobContent: {}, //
subList: [], //subList subList: [], //subList
@ -100,7 +99,8 @@
toLocationCode: "", toLocationCode: "",
businessTypeInfo: {}, businessTypeInfo: {},
managementList: [], managementList: [],
tolocationTypeList:[] tolocationTypeList:[],
jobStatus:""
}; };
}, },
onLoad(option) { onLoad(option) {
@ -109,7 +109,6 @@
// // // //
if (option.status == "1") { if (option.status == "1") {
this.receive((callback => { this.receive((callback => {
this.received = true;
this.getDetail(); this.getDetail();
})); }));
} else { } else {
@ -127,7 +126,7 @@
onBackPress(e) { onBackPress(e) {
// //
if (e.from == 'backbutton') { if (e.from == 'backbutton') {
if (this.received) { if (this.jobStatus=="2") {
// //
cancleTakeTransferIssueJob(this.id).then(res => { cancleTakeTransferIssueJob(this.id).then(res => {
uni.navigateBack(); uni.navigateBack();
@ -182,6 +181,7 @@
} else { } else {
if (res.data.subList.length > 0) { if (res.data.subList.length > 0) {
that.jobContent = res.data; that.jobContent = res.data;
that.jobStatus = res.data.status
that.subList =res.data.subList that.subList =res.data.subList
that.detailSource = getDataSource(that.subList) that.detailSource = getDataSource(that.subList)
that.fromLocationCode = that.subList[0].fromLocationCode that.fromLocationCode = that.subList[0].fromLocationCode

8
pages/transfer/job/receiptDetail.vue

@ -101,7 +101,6 @@
data() { data() {
return { return {
id: '', id: '',
received: false,
scanCount: 0, scanCount: 0,
jobContent: {}, // jobContent: {}, //
subList: [], //subList subList: [], //subList
@ -109,7 +108,8 @@
toLocationCode: "", toLocationCode: "",
businessTypeInfo: {}, businessTypeInfo: {},
managementList: [], managementList: [],
toLocationTypeList: [] toLocationTypeList: [],
jobStatus:""
}; };
}, },
onLoad(option) { onLoad(option) {
@ -118,7 +118,6 @@
// // // //
if (option.status == "1") { if (option.status == "1") {
this.receive((callback => { this.receive((callback => {
this.received = true;
this.getDetail(); this.getDetail();
})); }));
} else { } else {
@ -136,7 +135,7 @@
onBackPress(e) { onBackPress(e) {
// //
if (e.from == 'backbutton') { if (e.from == 'backbutton') {
if (this.received) { if (this.jobStatus=="2") {
// //
cancleTakeTransferReceiptJob(this.id).then(res => { cancleTakeTransferReceiptJob(this.id).then(res => {
uni.navigateBack(); uni.navigateBack();
@ -192,6 +191,7 @@
} else { } else {
if (res.data.subList.length > 0) { if (res.data.subList.length > 0) {
that.jobContent = res.data; that.jobContent = res.data;
that.jobStatus = res.data.status
that.subList = res.data.subList; that.subList = res.data.subList;
that.detailSource = getDataSource(that.subList) that.detailSource = getDataSource(that.subList)
that.fromLocationCode = that.subList[0].fromLocationCode that.fromLocationCode = that.subList[0].fromLocationCode

2
pages/transfer/record/deliverRecord.vue

@ -334,7 +334,7 @@
submitItem.fromLocationCode = detail.locationCode; submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode; submitItem.toLocationCode = detail.toLocationCode;
submitItem.qty = detail.handleQty != 0 ? detail.handleQty : detail.qty; submitItem.qty = detail.handleQty;
submitItem.package = ""; submitItem.package = "";
subList.push(submitItem) subList.push(submitItem)

2
pages/transfer/record/receiptRecord.vue

@ -316,7 +316,7 @@
submitItem.fromLocationCode = detail.locationCode; submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode; submitItem.toLocationCode = detail.toLocationCode;
submitItem.qty = detail.handleQty != 0 ? detail.handleQty : detail.qty; submitItem.qty = detail.handleQty;
submitItem.package = ""; submitItem.package = "";
subList.push(submitItem) subList.push(submitItem)

11
pages/unPlanned/coms/comReceiptRecord.vue

@ -5,7 +5,7 @@
<template v-slot:title> <template v-slot:title>
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="removeData($event,dataContent)" :right-options="removeOptions"> <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> :isShowBalance="true"></item-qty>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
@ -16,9 +16,8 @@
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item,index)" <uni-swipe-action-item @click="swipeClick($event,item,index)"
:right-options="item.scaned?scanOptions:detailOptions"> :right-options="item.scaned?scanOptions:detailOptions">
<purchase-label :dataContent="item.label" :packageContent="item.package" <balance :dataContent="item" :isShowStdPack="false" :isShowStatus="true" :isShowPack="true"
:isShowLocation="false"> :isShowFromLocation="false" :isShowToLocation="false"></balance>
</purchase-label>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
<!-- <u-line color="#D8D8D8"></u-line> --> <!-- <u-line color="#D8D8D8"></u-line> -->
@ -147,7 +146,7 @@
edit(item) { edit(item) {
this.editItem = item; this.editItem = item;
this.$refs.qtyEdit.openRecordEditPopup(item.label.qty); this.$refs.qtyEdit.openRecordEditPopup(item.handleQty);
}, },
detail(packageInfo) { detail(packageInfo) {
@ -164,7 +163,7 @@
}); });
}, },
confirm(qty) { confirm(qty) {
this.editItem.qty = qty; this.editItem.handleQty = qty;
this.$emit('updateData') this.$emit('updateData')
} }
} }

34
pages/unPlanned/coms/comReceiptRequestPopup.vue

@ -48,10 +48,13 @@
<text>数量 : </text> <text>数量 : </text>
<view class="uni-flex uni-row uni-center" <view class="uni-flex uni-row uni-center"
style="align-items: center;margin-left: 20rpx;"> style="align-items: center;margin-left: 20rpx;">
<uni-number-box :value="counQty" @change="change" style='margin-left: 10rpx;' <input style="text-align: center;" class="qty_input" v-model="counQty" type="number"
:focus="numberFocus" @blur='numberFocus = false'> @confirm="confirm()" :focus="numberFocus" @input="checkNum" :maxlength="maxlength" />
</uni-number-box>
<uom :uom="uom"></uom> <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>
</view> </view>
@ -65,7 +68,7 @@
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
<win-scan-item ref="itemPopup" title='物料代码' @getScanCode='getItemCode'> <win-scan-item ref="itemPopup" title='物料代码' @getScanResult='getItemCode'>
</win-scan-item> </win-scan-item>
<winScanLocation ref="locationPopup" title="库位代码" @getLocation='getLocationCode'></winScanLocation> <winScanLocation ref="locationPopup" title="库位代码" @getLocation='getLocationCode'></winScanLocation>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
@ -82,6 +85,7 @@
checkDirectoryItemExist checkDirectoryItemExist
} from '@/common/directory.js'; } from '@/common/directory.js';
import uom from '@/mycomponents/qty/uom.vue' import uom from '@/mycomponents/qty/uom.vue'
import stdPackQty from '@/mycomponents/qty/stdPackQty.vue'
import balanceStatus from '@/mycomponents/status/balanceStatus.vue' import balanceStatus from '@/mycomponents/status/balanceStatus.vue'
import comMessage from '@/mycomponents/common/comMessage.vue' import comMessage from '@/mycomponents/common/comMessage.vue'
import winScanItem from '@/mycomponents/scan/winScanItem.vue' import winScanItem from '@/mycomponents/scan/winScanItem.vue'
@ -90,6 +94,7 @@
export default { export default {
components: { components: {
uom, uom,
stdPackQty,
balanceStatus, balanceStatus,
comMessage, comMessage,
winScanItem, winScanItem,
@ -112,6 +117,8 @@
toLocationCode: '请扫描库位信息', toLocationCode: '请扫描库位信息',
isCheckLocationCode: false, isCheckLocationCode: false,
editPosition: true, editPosition: true,
maxlength:10,
stdPackInfo:undefined
} }
}, },
props: { props: {
@ -121,12 +128,28 @@
}, },
}, },
methods: { 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) { openRequestPopup(editPosition) {
this.editPosition = editPosition; this.editPosition = editPosition;
if (!editPosition) { if (!editPosition) {
this.itemCode = ""; this.itemCode = "";
this.uom = "" this.uom = ""
this.qty = 0 this.qty = 0
this.count = 0;
this.itemCodeGetFocus(); this.itemCodeGetFocus();
} }
this.$refs.popup.open('bottom') this.$refs.popup.open('bottom')
@ -231,13 +254,14 @@
this.closeRequestPopup(); this.closeRequestPopup();
}, },
getItemCode(code) { getItemCode(code, scanResult) {
if (code == "") { if (code == "") {
this.showErrorMessage('物料号不能为空') this.showErrorMessage('物料号不能为空')
return; return;
} }
this.itemCode = ""; this.itemCode = "";
this.checkItemCode(code) this.checkItemCode(code)
this.stdPackInfo = scanResult.package;
}, },
getLocationCode(location, code) { getLocationCode(location, code) {
this.toLocationCode = code; this.toLocationCode = code;

8
pages/unPlanned/job/issueJobDetail.vue

@ -87,13 +87,13 @@
data() { data() {
return { return {
id: '', id: '',
received: false,
scanCount: 0, scanCount: 0,
jobContent: {}, // jobContent: {}, //
subList: [], //subList subList: [], //subList
detailSource: [], // detailSource: [], //
businessTypeInfo: {}, businessTypeInfo: {},
managementList: [] managementList: [],
jobStatus:""
}; };
}, },
onLoad(option) { onLoad(option) {
@ -102,7 +102,6 @@
// // // //
if (option.status == "1") { if (option.status == "1") {
this.receive((callback => { this.receive((callback => {
this.received = true;
this.getDetail(); this.getDetail();
})); }));
} else { } else {
@ -120,7 +119,7 @@
onBackPress(e) { onBackPress(e) {
// //
if (e.from == 'backbutton') { if (e.from == 'backbutton') {
if (this.received) { if (this.jobStatus=="2") {
// //
cancleTakeUnPlannedIssueJob(this.id).then(res => { cancleTakeUnPlannedIssueJob(this.id).then(res => {
uni.navigateBack(); uni.navigateBack();
@ -167,6 +166,7 @@
} else { } else {
if (res.data.subList.length > 0) { if (res.data.subList.length > 0) {
that.jobContent = res.data; that.jobContent = res.data;
that.jobStatus = res.data.status
that.subList = res.data.subList; that.subList = res.data.subList;
that.detailSource = getDataSource(that.subList) that.detailSource = getDataSource(that.subList)
} else { } else {

8
pages/unPlanned/job/receiptJobDetail.vue

@ -88,7 +88,6 @@
data() { data() {
return { return {
id: '', id: '',
received: false,
scanCount: 0, scanCount: 0,
jobContent: {}, // jobContent: {}, //
subList: [], //subList subList: [], //subList
@ -97,7 +96,8 @@
toLocationCode: '', toLocationCode: '',
toLocationInfo: {}, toLocationInfo: {},
businessTypeInfo: {}, businessTypeInfo: {},
managementList: [] managementList: [],
jobStatus:""
}; };
}, },
onLoad(option) { onLoad(option) {
@ -106,7 +106,6 @@
// // // //
if (option.status == "1") { if (option.status == "1") {
this.receive((callback => { this.receive((callback => {
this.received = true;
this.getDetail(); this.getDetail();
})); }));
} else { } else {
@ -124,7 +123,7 @@
onBackPress(e) { onBackPress(e) {
// //
if (e.from == 'backbutton') { if (e.from == 'backbutton') {
if (this.received) { if (this.jobStatus=="2") {
// //
cancleTakeUnPlannedReceiptJob(this.id).then(res => { cancleTakeUnPlannedReceiptJob(this.id).then(res => {
uni.navigateBack(); uni.navigateBack();
@ -167,6 +166,7 @@
} else { } else {
if (res.data.subList.length > 0) { if (res.data.subList.length > 0) {
that.jobContent = res.data; that.jobContent = res.data;
that.jobStatus = res.data.status
that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes); that.toLocationTypeList = getDirectoryItemArray(that.jobContent.toLocationTypes);
that.subList = res.data.subList; that.subList = res.data.subList;
this.toLocationCode = that.subList[0].toLocationCode this.toLocationCode = that.subList[0].toLocationCode

2
pages/unPlanned/record/issueRecord.vue

@ -255,7 +255,7 @@
submitItem.toLocationCode = ""; submitItem.toLocationCode = "";
submitItem.reason = this.reasonCode; submitItem.reason = this.reasonCode;
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty; submitItem.qty = detail.handleQty;
submitItem.package =""; submitItem.package ="";
subList.push(submitItem) subList.push(submitItem)

152
pages/unPlanned/record/receiptRecord.vue

@ -22,12 +22,12 @@
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<view class="page-footer"> <view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10" <view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; "> style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode' <requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationTypeList="tolocationTypeList"></requiredLocation> :locationTypeList="tolocationTypeList"></requiredLocation>
</view> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
@ -37,7 +37,7 @@
</view> </view>
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
</view> </view>
<win-scan-pack ref="scanPopup" @getResult='getScanResult' :title="'箱码'" 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> <com-message ref="comMessage"></com-message>
</view> </view>
</template> </template>
@ -55,7 +55,7 @@
import { import {
unPlannedReceiptRecordbSubmit unPlannedReceiptRecordbSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
getDirectoryItemArray, getDirectoryItemArray,
getUnPlannedReceiptReasonList getUnPlannedReceiptReasonList
@ -64,17 +64,19 @@
import { import {
getBusinessType, getBusinessType,
} from '@/common/record.js'; } from '@/common/record.js';
import { import {
calc calc
} from '@/common/calc.js'; } from '@/common/calc.js';
import { Decimal } from 'decimal.js';//
import { import {
goHome, goHome,
updateTitle, updateTitle,
deepCopyData, deepCopyData,
getPackingNumberAndBatchByList getPackingNumberAndBatchByList
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
getPrecisionStrategyList getPrecisionStrategyList
} from '@/common/balance.js'; } from '@/common/balance.js';
@ -102,10 +104,10 @@
detailSource: [], // detailSource: [], //
businessTypeCode: "UnplannedReceipt", businessTypeCode: "UnplannedReceipt",
reasonText: "", reasonText: "",
reasonCode:"", reasonCode: "",
reasonList: [], reasonList: [],
dataContent:{}, dataContent: {},
managementList:[] managementList: []
} }
}, },
@ -123,8 +125,7 @@
}); });
}, },
onLoad(option) { onLoad(option) {},
},
methods: { methods: {
openScanPopup() { openScanPopup() {
@ -174,8 +175,8 @@
itemName: pack.itemName, itemName: pack.itemName,
stdPackQty: pack.stdPackQty, stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit, stdPackUnit: pack.stdPackUnit,
qty: label.qty, qty: new Decimal(label.qty).toNumber(),
handleQty: 0, handleQty: new Decimal(0).toNumber(),
uom: label.uom, uom: label.uom,
subList: [] subList: []
} }
@ -183,11 +184,11 @@
}, },
createDetailInfo(label, pack) { createDetailInfo(label, pack) {
let detail = {}; let detail = deepCopyData(label);
detail.scaned = true; detail.scaned = true;
// Object.assign(detail, label) // Object.assign(detail, label)
detail.qty = Number(label.qty) detail.qty = new Decimal(label.qty).toNumber();
detail.handleQty = 0, detail.handleQty = new Decimal(label.qty).toNumber();
detail.inventoryStatus = "OK" detail.inventoryStatus = "OK"
detail.stdPackQty = pack.stdPackQty; detail.stdPackQty = pack.stdPackQty;
detail.stdPackUnit = pack.stdPackUnit; detail.stdPackUnit = pack.stdPackUnit;
@ -200,10 +201,10 @@
calcHandleQty() { calcHandleQty() {
for (let item of this.detailSource) { for (let item of this.detailSource) {
item.qty = 0; item.handleQty = new Decimal(0).toNumber();
for (let detail of item.subList) { for (let detail of item.subList) {
if (detail != undefined) { 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("请选择入库原因") this.showErrorMessage("请选择入库原因")
return; return;
} }
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
// //
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
mask: true mask: true
}); });
this.managementList = []; this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams() var precisionStrategParams = this.setPrecisionStrategParams()
getPrecisionStrategyList(precisionStrategParams, res => { getPrecisionStrategyList(precisionStrategParams, res => {
if (res.success) { if (res.success) {
this.managementList = res.list; this.managementList = res.list;
var params = this.setParams() var params = this.setParams()
console.log("提交" + JSON.stringify(params)) console.log("提交" + JSON.stringify(params))
unPlannedReceiptRecordbSubmit(params).then(res => { unPlannedReceiptRecordbSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成计划外入库记录<br>" + res.data) this.showCommitSuccessMessage("提交成功<br>生成计划外入库记录<br>" + res.data)
} else { } else {
this.showErrorMessage("提交失败[" + res.msg + "]") this.showErrorMessage("提交失败[" + res.msg + "]")
} }
}).catch(error => { }).catch(error => {
uni.hideLoading() uni.hideLoading()
this.showErrorMessage(error) this.showErrorMessage(error)
}) })
} else { } else {
uni.hideLoading(); uni.hideLoading();
this.showErrorMessage(res.message); this.showErrorMessage(res.message);
} }
}) })
}else { } else {
this.showErrorMessage("没有要提交的数据,请先扫描") this.showErrorMessage("没有要提交的数据,请先扫描")
} }
}, },
setPrecisionStrategParams() { setPrecisionStrategParams() {
var itemList = [] var itemList = []
@ -301,47 +302,48 @@
} }
itemList.push(result) itemList.push(result)
} }
} }
}) })
}) })
return itemList; return itemList;
}, },
setParams() { setParams() {
var subList = [] var subList = []
var creator = this.$store.state.user.id var creator = this.$store.state.user.id
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
var submitItem = deepCopyData(detail) 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); detail.label.packingNumber, detail.toLocationCode, detail.label.batch);
submitItem.itemCode = detail.package.itemCode; submitItem.itemCode = detail.package.itemCode;
submitItem.itemName = detail.package.itemName; submitItem.itemName = detail.package.itemName;
submitItem.itemDesc1 = detail.package.itemDesc1; submitItem.itemDesc1 = detail.package.itemDesc1;
submitItem.itemDesc2 = detail.package.itemDesc2; submitItem.itemDesc2 = detail.package.itemDesc2;
submitItem.inventoryStatus = detail.inventoryStatus; submitItem.inventoryStatus = detail.inventoryStatus;
submitItem.fromPackingNumber = info.packingNumber; submitItem.fromPackingNumber = info.packingNumber;
submitItem.toPackingNumber = info.packingNumber; submitItem.toPackingNumber = info.packingNumber;
// detail.fromContainerNumber = detail.containerNumber; // detail.fromContainerNumber = detail.containerNumber;
// detail.toContainerNumber = detail.containerNumber // detail.toContainerNumber = detail.containerNumber
submitItem.fromBatch = info.batch; submitItem.fromBatch = info.batch;
submitItem.toBatch = info.batch; submitItem.toBatch = info.batch;
submitItem.fromLocationCode = ""; submitItem.fromLocationCode = "";
submitItem.toLocationCode = detail.toLocationCode; submitItem.toLocationCode = detail.toLocationCode;
submitItem.reason = this.reasonCode; submitItem.reason = this.reasonCode;
submitItem.qty = detail.handleQty!=0?detail.handleQty:detail.qty; submitItem.qty = detail.handleQty;
submitItem.package =""; submitItem.package = "";
subList.push(submitItem) subList.push(submitItem)
} }
}) })
@ -364,16 +366,16 @@
this.clearData(); this.clearData();
}) })
}, },
clearData(){ clearData() {
this.reasonCode = "" this.reasonCode = ""
this.reasonText = ""; this.reasonText = "";
this.detailSource = []; this.detailSource = [];
this.managementList=[]; this.managementList = [];
this.dataContent ={} this.dataContent = {}
this.toLocationCode ="" this.toLocationCode = ""
} }
} }
} }
</script> </script>

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="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<record-com-detail-card :dataContent="item" :index="index" <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"> @removePack="removePack">
</record-com-detail-card> </record-com-detail-card>
</view> </view>
@ -78,6 +78,7 @@
import { import {
goHome, goHome,
updateTitle, updateTitle,
deepCopyData,
getCurrDateTimes, getCurrDateTimes,
getCurrDateOneMonthsTimes, getCurrDateOneMonthsTimes,
navigateBack navigateBack
@ -255,16 +256,18 @@
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
item.subList.forEach(detail => { item.subList.forEach(detail => {
if (detail.scaned) { if (detail.scaned) {
detail.fromLocationCode = detail.locationCode; var submitItem = deepCopyData(detail)
detail.reason = this.reasonCode; submitItem.fromLocationCode = detail.locationCode;
detail.containerNumber =""; submitItem.reason = this.reasonCode;
subList.push(detail) submitItem.containerNumber ="";
submitItem.qty = detail.handleQty;
subList.push(submitItem)
} }
}) })
}) })
this.dataContent.subList = subList this.dataContent.subList = subList
this.dataContent.status = 1; this.dataContent.status = "1";
this.dataContent.requestTime = getCurrDateTimes(); this.dataContent.requestTime = getCurrDateTimes();
this.dataContent.dueTime = getCurrDateOneMonthsTimes(); this.dataContent.dueTime = getCurrDateOneMonthsTimes();

16
pages/unPlanned/request/receiptRequestCreate.vue

@ -58,6 +58,7 @@
getISODateTime, getISODateTime,
navigateBack, navigateBack,
getBatch, getBatch,
deepCopyData,
getCurrDateTimes, getCurrDateTimes,
getCurrDateOneMonthsTimes getCurrDateOneMonthsTimes
} from '@/common/basic.js'; } from '@/common/basic.js';
@ -186,16 +187,17 @@
setRequestParams() { setRequestParams() {
var subList = [] var subList = []
this.detailSource.subList.forEach(detail => { this.detailSource.subList.forEach(detail => {
detail.toLocationCode = this.detailSource.toLocationCode; var submitItem = deepCopyData(detail)
detail.reason = this.reasonCode; submitItem.toLocationCode = this.detailSource.toLocationCode;
detail.containerNumber = ""; submitItem.reason = this.reasonCode;
detail.batch = getBatch(); submitItem.containerNumber = "";
detail.inventoryStatus = "OK"; submitItem.batch = getBatch();
submitItem.inventoryStatus = "OK";
console.log("", getBatch()) console.log("", getBatch())
subList.push(detail) subList.push(submitItem)
}) })
this.dataContent.subList = subList this.dataContent.subList = subList
this.dataContent.status = 1; this.dataContent.status = "1";
this.dataContent.requestTime = getCurrDateTimes(); this.dataContent.requestTime = getCurrDateTimes();
this.dataContent.dueTime = getCurrDateOneMonthsTimes(); this.dataContent.dueTime = getCurrDateOneMonthsTimes();

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

@ -1,13 +1,14 @@
<template> <template>
<view class="uni-numbox"> <view class="uni-numbox">
<view @click="_calcValue('minus')" class="uni-numbox__minus uni-numbox-btns" :style="{background}"> <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> </view>
<input :disabled="disabled" @focus="_onFocus" @blur="_onBlur" class="uni-numbox__value" type="number" <input :disabled="disabled" @focus="_onFocus" @blur="_onBlur" class="uni-numbox__value" type="number"
:focus="focus" :focus="focus" v-model="inputValue" :style="{background, color}" @input="checkNum" :maxlength="maxlength" />
v-model="inputValue" :style="{background, color}" />
<view @click="_calcValue('plus')" class="uni-numbox__plus uni-numbox-btns" :style="{background}"> <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>
</view> </view>
</template> </template>
@ -27,7 +28,9 @@
* @event {Function} focus 输入框聚焦时触发的事件参数为 event 对象 * @event {Function} focus 输入框聚焦时触发的事件参数为 event 对象
* @event {Function} blur 输入框失焦时触发的事件参数为 event 对象 * @event {Function} blur 输入框失焦时触发的事件参数为 event 对象
*/ */
import {
Decimal
} from 'decimal.js'; //
export default { export default {
name: "UniNumberBox", name: "UniNumberBox",
emits: ['change', 'input', 'update:modelValue', 'blur', 'focus'], emits: ['change', 'input', 'update:modelValue', 'blur', 'focus'],
@ -71,26 +74,55 @@
}, },
data() { data() {
return { return {
inputValue: 0 inputValue: 0,
maxlength: 10
}; };
}, },
watch: { watch: {
value(val) { value(val) {
this.inputValue = +val; this.inputValue = this.add(this.inputValue, val)
}, },
modelValue(val) { modelValue(val) {
this.inputValue = +val; this.inputValue = this.add(this.inputValue, val)
} }
}, },
created() { created() {
if (this.value === 1) { if (this.value === 1) {
this.inputValue = +this.modelValue; this.inputValue = this.add(this.inputValue, this.modelValue)
} }
if (this.modelValue === 1) { if (this.modelValue === 1) {
this.inputValue = +this.value; this.inputValue = this.add(this.inputValue, this.value)
} }
}, },
methods: { 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) { _calcValue(type) {
if (this.disabled) { if (this.disabled) {
return; return;
@ -99,7 +131,7 @@
let value = this.inputValue * scale; let value = this.inputValue * scale;
let step = this.step * scale; let step = this.step * scale;
if (type === "minus") { if (type === "minus") {
value -= step; value = this.sub(value - step)
if (value < (this.min * scale)) { if (value < (this.min * scale)) {
return; return;
} }
@ -109,53 +141,54 @@
} }
if (type === "plus") { if (type === "plus") {
value += step; value = this.add(value, step)
if (value > (this.max * scale)) {
return; if (value > (this.max * scale)) {
}
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;
return; return;
} }
value = +value; if (value < (this.min * scale)) {
if (value > this.max) { value = this.min * scale
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)
} }
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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

Loading…
Cancel
Save