|
@ -1,5 +1,5 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view class="" > |
|
|
<view class=""> |
|
|
<view class="uni-list"> |
|
|
<view class="uni-list"> |
|
|
<view class="uni-list-cell " style="padding:10rpx; "> |
|
|
<view class="uni-list-cell " style="padding:10rpx; "> |
|
|
<view class="" style="color: red; font-size: 40rpx; "> |
|
|
<view class="" style="color: red; font-size: 40rpx; "> |
|
@ -9,7 +9,8 @@ |
|
|
器具类型 : |
|
|
器具类型 : |
|
|
</view> |
|
|
</view> |
|
|
<view class="uni-list-cell-db"> |
|
|
<view class="uni-list-cell-db"> |
|
|
<picker @change="containerTypeChange" :value="typeIndex" :range="containerTypeList" range-key="name" > |
|
|
<picker @change="containerTypeChange" :value="typeIndex" :range="containerTypeList" |
|
|
|
|
|
range-key="name"> |
|
|
<view class="uni-input" style="font-size:35rpx">{{containerType}}</view> |
|
|
<view class="uni-input" style="font-size:35rpx">{{containerType}}</view> |
|
|
</picker> |
|
|
</picker> |
|
|
</view> |
|
|
</view> |
|
@ -24,18 +25,21 @@ |
|
|
器具规格 : |
|
|
器具规格 : |
|
|
</view> |
|
|
</view> |
|
|
<view class="uni-list-cell-db"> |
|
|
<view class="uni-list-cell-db"> |
|
|
<picker @change="containerModelChange" :value="modelIndex" :range="containerModelList" range-key="name"> |
|
|
<picker @change="containerModelChange" :value="modelIndex" :range="containerModelList" |
|
|
|
|
|
range-key="name"> |
|
|
<view class="uni-input" style="font-size:35rpx">{{containerModel}}</view> |
|
|
<view class="uni-input" style="font-size:35rpx">{{containerModel}}</view> |
|
|
</picker> |
|
|
</picker> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="uni-list"> |
|
|
<view class="uni-list"> |
|
|
<view class="uni-list-cell" style="padding-left: 15rpx; padding-top: 20rpx;padding-bottom:20rpx; padding-right: 15rpx; ; align-items: center; display: flex;"> |
|
|
<view class="uni-list-cell" |
|
|
|
|
|
style="padding-left: 15rpx; padding-top: 20rpx;padding-bottom:20rpx; padding-right: 15rpx; ; align-items: center; display: flex;"> |
|
|
<view class="" style="color: red; font-size: 40rpx; "> |
|
|
<view class="" style="color: red; font-size: 40rpx; "> |
|
|
* |
|
|
* |
|
|
</view> |
|
|
</view> |
|
|
<view class="uni-list-cell-left" style="font-size:35rpx; align-items: center;display: flex; text-align: center;"> |
|
|
<view class="uni-list-cell-left" |
|
|
|
|
|
style="font-size:35rpx; align-items: center;display: flex; text-align: center;"> |
|
|
呼叫库位 : |
|
|
呼叫库位 : |
|
|
</view> |
|
|
</view> |
|
|
<view class="uni-list-cell-db" style="font-size:35rpx" @click="openScanLocation"> |
|
|
<view class="uni-list-cell-db" style="font-size:35rpx" @click="openScanLocation"> |
|
@ -57,9 +61,13 @@ |
|
|
<script> |
|
|
<script> |
|
|
import { |
|
|
import { |
|
|
locations, |
|
|
locations, |
|
|
|
|
|
getDictByCode, |
|
|
|
|
|
containerRequest |
|
|
} from '@/api/index.js'; |
|
|
} from '@/api/index.js'; |
|
|
import { |
|
|
import { |
|
|
goHome, |
|
|
goHome, |
|
|
|
|
|
getContainerTypeArray, |
|
|
|
|
|
getISODateTime, |
|
|
} from '@/common/basic.js'; |
|
|
} from '@/common/basic.js'; |
|
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
|
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
|
|
import winScanByCode from '@/mycomponents/wincom/winScanByCode.vue' |
|
|
import winScanByCode from '@/mycomponents/wincom/winScanByCode.vue' |
|
@ -70,53 +78,54 @@ |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
containerTypeList: [ { |
|
|
containerTypeList: [], |
|
|
name: '内物流', |
|
|
containerModelList: [], |
|
|
value: "1", |
|
|
typeIndex: 0, |
|
|
test:"test1" |
|
|
modelIndex: 0, |
|
|
}, { |
|
|
location: "", |
|
|
name: '外物流', |
|
|
locationCode: "请扫描库位", |
|
|
value: "2", |
|
|
locationName: "", |
|
|
test:"test2" |
|
|
containerType: "请选择器具类型", |
|
|
}], |
|
|
containerTypeCode: "", |
|
|
containerModelList: [ { |
|
|
containerModel: "请选择器具规格", |
|
|
name: '小器具', |
|
|
containerModelCode: "" |
|
|
value: "1", |
|
|
|
|
|
test:"test1" |
|
|
|
|
|
}, { |
|
|
|
|
|
name: '大器具', |
|
|
|
|
|
value: "2", |
|
|
|
|
|
test:"test2" |
|
|
|
|
|
}], |
|
|
|
|
|
typeIndex:0, |
|
|
|
|
|
modelIndex:0, |
|
|
|
|
|
location:"", |
|
|
|
|
|
locationCode:"请扫描库位", |
|
|
|
|
|
locationName:"", |
|
|
|
|
|
containerType:"请选择器具类型", |
|
|
|
|
|
containerModel:"请选择器具规格" |
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onLoad() {}, |
|
|
onShow() { |
|
|
|
|
|
this.getContainerModelList(); |
|
|
|
|
|
this.containerTypeList = getContainerTypeArray(); |
|
|
|
|
|
}, |
|
|
//返回首页 |
|
|
//返回首页 |
|
|
onNavigationBarButtonTap(e) { |
|
|
onNavigationBarButtonTap(e) { |
|
|
if (e.index === 0) { |
|
|
if (e.index === 0) { |
|
|
goHome(); |
|
|
goHome(); |
|
|
}else if(e.index === 1){ |
|
|
} else if (e.index === 1) { |
|
|
window.location.reload(); |
|
|
window.location.reload(); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
getContainerModelList() { |
|
|
|
|
|
getDictByCode("ContainerSpecificationsType").then(res => { |
|
|
|
|
|
res.items.forEach(item => { |
|
|
|
|
|
item.value = item.code; |
|
|
|
|
|
}) |
|
|
|
|
|
this.containerModelList = res.items; |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
containerTypeChange(e) { |
|
|
containerTypeChange(e) { |
|
|
this.typeIndex = e.detail.value |
|
|
this.typeIndex = e.detail.value |
|
|
var select =this.containerTypeList[this.typeIndex]; |
|
|
var select = this.containerTypeList[this.typeIndex]; |
|
|
this.containerType =select.name |
|
|
this.containerType = select.name |
|
|
|
|
|
this.containerTypeCode = select.value |
|
|
console.log(select) |
|
|
console.log(select) |
|
|
}, |
|
|
}, |
|
|
containerModelChange(e) { |
|
|
containerModelChange(e) { |
|
|
this.modelIndex = e.detail.value |
|
|
this.modelIndex = e.detail.value |
|
|
var select =this.containerModelList[this.typeIndex]; |
|
|
var select = this.containerModelList[this.modelIndex]; |
|
|
this.containerModel =select.name |
|
|
this.containerModel = select.name |
|
|
|
|
|
this.containerModelCode = select.value |
|
|
console.log(select) |
|
|
console.log(select) |
|
|
}, |
|
|
}, |
|
|
openScanLocation() { |
|
|
openScanLocation() { |
|
@ -135,15 +144,16 @@ |
|
|
mask: true |
|
|
mask: true |
|
|
}); |
|
|
}); |
|
|
locations(code).then(res => { |
|
|
locations(code).then(res => { |
|
|
if (res == null) { |
|
|
uni.hideLoading(); |
|
|
that.scanPopupLoseFocus(); |
|
|
if (res) { |
|
|
that.showMessage('未查询到库位【' + code + '】'); |
|
|
|
|
|
} else { |
|
|
|
|
|
that.locationCode = res.code; |
|
|
that.locationCode = res.code; |
|
|
that.locationName = res.name |
|
|
that.locationName = res.name |
|
|
that.closeScanLocation(); |
|
|
that.closeScanLocation(); |
|
|
|
|
|
} else { |
|
|
|
|
|
that.scanPopupLoseFocus(); |
|
|
|
|
|
that.showMessage('未查询到库位【' + code + '】'); |
|
|
} |
|
|
} |
|
|
uni.hideLoading(); |
|
|
|
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
|
that.showMessage(err.message); |
|
|
that.showMessage(err.message); |
|
@ -161,22 +171,77 @@ |
|
|
scanPopupLoseFocus() { |
|
|
scanPopupLoseFocus() { |
|
|
this.$refs.scanLocation.losefocus(); |
|
|
this.$refs.scanLocation.losefocus(); |
|
|
}, |
|
|
}, |
|
|
submit(){ |
|
|
clearData() { |
|
|
if(this.containerCode =="请选择器具类型"){ |
|
|
this.containerType = "请选择器具类型" |
|
|
|
|
|
this.containerModel = "请选择器具规格"; |
|
|
|
|
|
this.locationCode = "请扫描库位" |
|
|
|
|
|
this.locationName =""; |
|
|
|
|
|
this.containerTypeCode = "" |
|
|
|
|
|
this.containerModelCode = "" |
|
|
|
|
|
this.modelIndex =0; |
|
|
|
|
|
this.typeIndex =0; |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setParams() { |
|
|
|
|
|
var data = { |
|
|
|
|
|
worker: localStorage.userName_CN == "" ? localStorage.userName : localStorage.userName_CN, |
|
|
|
|
|
activeDate: getISODateTime(), |
|
|
|
|
|
autoSubmit: true, |
|
|
|
|
|
autoAgree: true, |
|
|
|
|
|
autoHandle: true, |
|
|
|
|
|
autoCompleteJob: true, |
|
|
|
|
|
directCreateNote: true, |
|
|
|
|
|
containerType: this.containerTypeCode, |
|
|
|
|
|
specificationsType: this.containerModelCode, |
|
|
|
|
|
requestLocationCode: this.locationCode, |
|
|
|
|
|
details: [{ |
|
|
|
|
|
remark: "string", |
|
|
|
|
|
itemCode: "string", |
|
|
|
|
|
itemName: "string", |
|
|
|
|
|
itemDesc1: "string", |
|
|
|
|
|
itemDesc2: "string", |
|
|
|
|
|
uom: "string", |
|
|
|
|
|
qty: 0, |
|
|
|
|
|
stdPackQty: 0, |
|
|
|
|
|
toLocationCode: "string", |
|
|
|
|
|
}] |
|
|
|
|
|
} |
|
|
|
|
|
return data; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
submit() { |
|
|
|
|
|
if (this.containerType == "请选择器具类型") { |
|
|
this.showMessage("请选择器具类型") |
|
|
this.showMessage("请选择器具类型") |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if(this.containerModel =="请选择器具规格"){ |
|
|
if (this.containerModel == "请选择器具规格") { |
|
|
this.showMessage("请选择器具规格") |
|
|
this.showMessage("请选择器具规格") |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if(this.locationCode =="请扫描库位"){ |
|
|
if (this.locationCode == "请扫描库位") { |
|
|
this.showMessage("请扫描库位") |
|
|
this.showMessage("请扫描库位") |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
console.log(this.containerTypeCode) |
|
|
|
|
|
console.log(this.containerModelCode) |
|
|
|
|
|
console.log(this.locationCode) |
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
title: '提交中...', |
|
|
|
|
|
mask: true |
|
|
|
|
|
}); |
|
|
|
|
|
var params = this.setParams(); |
|
|
|
|
|
|
|
|
|
|
|
containerRequest(params).then(res => { |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
this.showMessage("提交成功"); |
|
|
|
|
|
this.clearData(); |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
this.showMessage(err.message); |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|