Browse Source

修改页面

master
lijuncheng 4 months ago
parent
commit
34706b4beb
  1. 117
      src/pages/plastics/check.vue

117
src/pages/plastics/check.vue

@ -2,29 +2,19 @@
<view class="page-wraper" @touchstart="touchScreen">
<view class="page-header flex"
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="">
<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>
<view class="uni-flex uni-row space-between u-col-center" >
@ -37,9 +27,11 @@
ref="inputDevice"
v-model="deviceCode"
@clear="deviceClear"
:focus="true"
@confirm="onConfirmDevice"></uni-easyinput>
</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!=''">
设备编号 : {{deviceCheckCode}}
</view>
@ -76,15 +68,12 @@
</view>
</view>
</view>
<winScanNormal ref="scanPopup" title="设备编号" @getResult='getScanResult'></winScanNormal>
</view>
</template>
<script>
import customerFrom from "@/mycomponents/form/customerFrom.vue"
import winScanNormal from "@/mycomponents/scan/winScanNormal.vue"
import config from '@/static/config.js'
import {
getCurrDateTime,
@ -101,13 +90,14 @@
export default {
components: {
customerFrom,
winScanNormal,
},
data() {
return {
dateTime: "",
deviceCode: "",
deviceCheckCode:"",
productCode: "",
productCheckCode:"",
deviceName: "",
worker: this.$store.state.user.name,
lastTime: null, //
@ -240,7 +230,7 @@
},
mounted() {
this.$refs.inputDevice.focused = true
this.$refs.productCode.focused = true
},
methods: {
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() {
if (this.productCode == "") {
this.productCheckCode=""
this.showMessage("请先扫描产品条码")
return
}
if (this.deviceCode == "") {
this.deviceCheckCode=""
this.showMessage("请先扫描设备编号")
@ -306,6 +274,7 @@
createTime:getCurrDateTime(),
groupName:groupName,
groupValue:groupValue,
ProductCode:this.productCheckCode,
dataList:data
}
@ -324,6 +293,8 @@
this.deviceCode = ""
this.deviceCheckCode = ""
this.deviceName="";
this.productCode="";
this.productCheckCode=""
this.dateTime ="";
this.dateTime = "",
this.deviceName = "",
@ -334,12 +305,10 @@
reset() {
this.$refs.customerFrom.reset()
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
closeScanPopup() {
this.$refs.scanPopup.closeScanPopup();
productClear(){
this.productCode="";
this.productCheckCode=""
},
deviceClear(){
this.deviceCode="";
@ -350,7 +319,20 @@
} )
},
onConfirmProduct(data){
this.productCode = data;
this.productCheckCode = data;
this.$refs.inputDevice.focused = true
},
onConfirmDevice(data){
if (this.productCode == "") {
this.productCheckCode=""
this.showMessage("请扫描产品条码")
return
}
if(data==undefined||data==""){
this.showMessage("请扫描设备编号")
return;
@ -360,12 +342,18 @@
title: "加载中",
mask: true
})
getPlasticsDeviceInfo(data).then(res => {
getPlasticsDeviceInfo(data,this.productCode).then(res => {
uni.hideLoading()
if(!res.Result){
this.showMessage( "产品条码["+this.productCode+"]设备编号[" +data+"]获取失败")
this.deviceCode = "";
this.productCode=""
return;
}
this.deviceCode = "";
this.productCode=""
this.deviceCheckCode = data;
console.log(data)
this.closeScanPopup();
var groupSelect = {
Type: "4",
Content: "选择班组",
@ -378,8 +366,9 @@
this.dateTime = getCurrDateTime()
}).catch(error => {
this.deviceCode = "";
this.productCode=""
uni.hideLoading()
this.showMessage("扫描设备["+data+"]"+error)
this.showMessage( "产品条码["+this.productCode+"]设备编号[" +data+"]获取失败"+error)
})
},

Loading…
Cancel
Save