|
@ -2,29 +2,19 @@ |
|
|
<view class="page-wraper" @touchstart="touchScreen"> |
|
|
<view class="page-wraper" @touchstart="touchScreen"> |
|
|
<view class="page-header flex" |
|
|
<view class="page-header flex" |
|
|
style="font-size: 32rpx; padding-left: 10rpx; padding-top: 10rpx; flex-direction: column;"> |
|
|
style="font-size: 32rpx; padding-left: 10rpx; padding-top: 10rpx; flex-direction: column;"> |
|
|
<!-- <view class="flex u-col-center space-between"> --> |
|
|
|
|
|
<!-- <view class=""> |
|
|
|
|
|
<view class="" style="margin: 5rpx; font-weight: bold;"> |
|
|
|
|
|
设备编号 : {{deviceCode}} |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="" style="margin: 5rpx; font-weight: bold;" v-if="deviceName!=''"> |
|
|
|
|
|
设备名称 : {{deviceName}} |
|
|
|
|
|
</view> --> |
|
|
|
|
|
|
|
|
|
|
|
<!-- <text v-if="deviceName!=''">({{deviceName}})</text> --> |
|
|
|
|
|
<!-- </view> --> |
|
|
|
|
|
<!-- <view class=""> |
|
|
|
|
|
<button type="primary" size="mini" @click="openScanPopup">扫描</button> |
|
|
|
|
|
</view> --> |
|
|
|
|
|
|
|
|
|
|
|
<!-- </view> --> |
|
|
|
|
|
<!-- <view class="" style="margin: 5rpx;" v-if="deviceName!=''"> |
|
|
|
|
|
点检日期 : {{dateTime}} |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="" style="margin: 5rpx;" v-if="deviceName!=''"> |
|
|
|
|
|
点检人 : {{worker}} |
|
|
|
|
|
</view> --> |
|
|
|
|
|
<view class=""> |
|
|
<view class=""> |
|
|
|
|
|
<uni-section title="产品条码" subTitle="" subTitleFontSize="26rpx" titleFontSize="35rpx" type="line"> |
|
|
|
|
|
</uni-section> |
|
|
|
|
|
<view class="uni-flex uni-row space-between u-col-center" > |
|
|
|
|
|
<uni-easyinput |
|
|
|
|
|
class="" |
|
|
|
|
|
trim="all" |
|
|
|
|
|
ref="productCode" |
|
|
|
|
|
v-model="productCode" |
|
|
|
|
|
@clear="productClear" |
|
|
|
|
|
:focus="true" |
|
|
|
|
|
@confirm="onConfirmProduct"></uni-easyinput> |
|
|
|
|
|
</view> |
|
|
<uni-section title="设备编号" subTitle="" subTitleFontSize="26rpx" titleFontSize="35rpx" type="line"> |
|
|
<uni-section title="设备编号" subTitle="" subTitleFontSize="26rpx" titleFontSize="35rpx" type="line"> |
|
|
</uni-section> |
|
|
</uni-section> |
|
|
<view class="uni-flex uni-row space-between u-col-center" > |
|
|
<view class="uni-flex uni-row space-between u-col-center" > |
|
@ -37,9 +27,11 @@ |
|
|
ref="inputDevice" |
|
|
ref="inputDevice" |
|
|
v-model="deviceCode" |
|
|
v-model="deviceCode" |
|
|
@clear="deviceClear" |
|
|
@clear="deviceClear" |
|
|
:focus="true" |
|
|
|
|
|
@confirm="onConfirmDevice"></uni-easyinput> |
|
|
@confirm="onConfirmDevice"></uni-easyinput> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
<view class="" style="margin: 5rpx; font-weight: bold;" v-if="deviceName&&productCheckCode"> |
|
|
|
|
|
产品条码 : {{productCheckCode}} |
|
|
|
|
|
</view> |
|
|
<view class="" style="margin: 5rpx; font-weight: bold;" v-if="deviceName!=''"> |
|
|
<view class="" style="margin: 5rpx; font-weight: bold;" v-if="deviceName!=''"> |
|
|
设备编号 : {{deviceCheckCode}} |
|
|
设备编号 : {{deviceCheckCode}} |
|
|
</view> |
|
|
</view> |
|
@ -76,15 +68,12 @@ |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<winScanNormal ref="scanPopup" title="设备编号" @getResult='getScanResult'></winScanNormal> |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import customerFrom from "@/mycomponents/form/customerFrom.vue" |
|
|
import customerFrom from "@/mycomponents/form/customerFrom.vue" |
|
|
import winScanNormal from "@/mycomponents/scan/winScanNormal.vue" |
|
|
|
|
|
import config from '@/static/config.js' |
|
|
import config from '@/static/config.js' |
|
|
import { |
|
|
import { |
|
|
getCurrDateTime, |
|
|
getCurrDateTime, |
|
@ -101,13 +90,14 @@ |
|
|
export default { |
|
|
export default { |
|
|
components: { |
|
|
components: { |
|
|
customerFrom, |
|
|
customerFrom, |
|
|
winScanNormal, |
|
|
|
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
dateTime: "", |
|
|
dateTime: "", |
|
|
deviceCode: "", |
|
|
deviceCode: "", |
|
|
deviceCheckCode:"", |
|
|
deviceCheckCode:"", |
|
|
|
|
|
productCode: "", |
|
|
|
|
|
productCheckCode:"", |
|
|
deviceName: "", |
|
|
deviceName: "", |
|
|
worker: this.$store.state.user.name, |
|
|
worker: this.$store.state.user.name, |
|
|
lastTime: null, // 最后一次点击的时间 |
|
|
lastTime: null, // 最后一次点击的时间 |
|
@ -240,7 +230,7 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
mounted() { |
|
|
mounted() { |
|
|
this.$refs.inputDevice.focused = true |
|
|
this.$refs.productCode.focused = true |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
touchScreen() { |
|
|
touchScreen() { |
|
@ -257,36 +247,14 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
getScanResult(result) { |
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
title: "加载中", |
|
|
|
|
|
mask: true |
|
|
|
|
|
}) |
|
|
|
|
|
getPlasticsDeviceInfo(result).then(res => { |
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
this.deviceCode = ""; |
|
|
|
|
|
this.deviceCheckCode = result; |
|
|
|
|
|
console.log(result) |
|
|
|
|
|
this.closeScanPopup(); |
|
|
|
|
|
var groupSelect = { |
|
|
|
|
|
Type: "4", |
|
|
|
|
|
Content: "选择班组", |
|
|
|
|
|
SelectName: "", |
|
|
|
|
|
SelectValue: "", |
|
|
|
|
|
} |
|
|
|
|
|
this.dataList = res.Result; |
|
|
|
|
|
this.dataList.push(groupSelect) |
|
|
|
|
|
|
|
|
|
|
|
this.deviceName = this.dataList[0].Name; |
|
|
|
|
|
this.dateTime = getCurrDateTime() |
|
|
|
|
|
this.worker = this.$store.state.user.name |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
this.showMessage(error) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
submit() { |
|
|
submit() { |
|
|
|
|
|
if (this.productCode == "") { |
|
|
|
|
|
this.productCheckCode="" |
|
|
|
|
|
this.showMessage("请先扫描产品条码") |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (this.deviceCode == "") { |
|
|
if (this.deviceCode == "") { |
|
|
this.deviceCheckCode="" |
|
|
this.deviceCheckCode="" |
|
|
this.showMessage("请先扫描设备编号") |
|
|
this.showMessage("请先扫描设备编号") |
|
@ -306,6 +274,7 @@ |
|
|
createTime:getCurrDateTime(), |
|
|
createTime:getCurrDateTime(), |
|
|
groupName:groupName, |
|
|
groupName:groupName, |
|
|
groupValue:groupValue, |
|
|
groupValue:groupValue, |
|
|
|
|
|
ProductCode:this.productCheckCode, |
|
|
dataList:data |
|
|
dataList:data |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -324,6 +293,8 @@ |
|
|
this.deviceCode = "" |
|
|
this.deviceCode = "" |
|
|
this.deviceCheckCode = "" |
|
|
this.deviceCheckCode = "" |
|
|
this.deviceName=""; |
|
|
this.deviceName=""; |
|
|
|
|
|
this.productCode=""; |
|
|
|
|
|
this.productCheckCode="" |
|
|
this.dateTime =""; |
|
|
this.dateTime =""; |
|
|
this.dateTime = "", |
|
|
this.dateTime = "", |
|
|
this.deviceName = "", |
|
|
this.deviceName = "", |
|
@ -334,12 +305,10 @@ |
|
|
reset() { |
|
|
reset() { |
|
|
this.$refs.customerFrom.reset() |
|
|
this.$refs.customerFrom.reset() |
|
|
}, |
|
|
}, |
|
|
openScanPopup() { |
|
|
|
|
|
this.$refs.scanPopup.openScanPopup(); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
closeScanPopup() { |
|
|
productClear(){ |
|
|
this.$refs.scanPopup.closeScanPopup(); |
|
|
this.productCode=""; |
|
|
|
|
|
this.productCheckCode="" |
|
|
}, |
|
|
}, |
|
|
deviceClear(){ |
|
|
deviceClear(){ |
|
|
this.deviceCode=""; |
|
|
this.deviceCode=""; |
|
@ -350,7 +319,20 @@ |
|
|
|
|
|
|
|
|
} ) |
|
|
} ) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
onConfirmProduct(data){ |
|
|
|
|
|
this.productCode = data; |
|
|
|
|
|
this.productCheckCode = data; |
|
|
|
|
|
this.$refs.inputDevice.focused = true |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
onConfirmDevice(data){ |
|
|
onConfirmDevice(data){ |
|
|
|
|
|
if (this.productCode == "") { |
|
|
|
|
|
this.productCheckCode="" |
|
|
|
|
|
this.showMessage("请扫描产品条码") |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if(data==undefined||data==""){ |
|
|
if(data==undefined||data==""){ |
|
|
this.showMessage("请扫描设备编号") |
|
|
this.showMessage("请扫描设备编号") |
|
|
return; |
|
|
return; |
|
@ -360,12 +342,18 @@ |
|
|
title: "加载中", |
|
|
title: "加载中", |
|
|
mask: true |
|
|
mask: true |
|
|
}) |
|
|
}) |
|
|
getPlasticsDeviceInfo(data).then(res => { |
|
|
getPlasticsDeviceInfo(data,this.productCode).then(res => { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
|
|
|
if(!res.Result){ |
|
|
|
|
|
this.showMessage( "产品条码["+this.productCode+"]设备编号[" +data+"]获取失败") |
|
|
|
|
|
this.deviceCode = ""; |
|
|
|
|
|
this.productCode="" |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
this.deviceCode = ""; |
|
|
this.deviceCode = ""; |
|
|
|
|
|
this.productCode="" |
|
|
this.deviceCheckCode = data; |
|
|
this.deviceCheckCode = data; |
|
|
console.log(data) |
|
|
console.log(data) |
|
|
this.closeScanPopup(); |
|
|
|
|
|
var groupSelect = { |
|
|
var groupSelect = { |
|
|
Type: "4", |
|
|
Type: "4", |
|
|
Content: "选择班组", |
|
|
Content: "选择班组", |
|
@ -378,8 +366,9 @@ |
|
|
this.dateTime = getCurrDateTime() |
|
|
this.dateTime = getCurrDateTime() |
|
|
}).catch(error => { |
|
|
}).catch(error => { |
|
|
this.deviceCode = ""; |
|
|
this.deviceCode = ""; |
|
|
|
|
|
this.productCode="" |
|
|
uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
this.showMessage("扫描设备["+data+"]"+error) |
|
|
this.showMessage( "产品条码["+this.productCode+"]设备编号[" +data+"]获取失败"+error) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|