|
|
@ -3,7 +3,7 @@ |
|
|
|
<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=""> |
|
|
|
<view class="" style="margin: 5rpx; font-weight: bold;"> |
|
|
|
设备编号 : {{deviceCode}} |
|
|
|
</view> |
|
|
@ -11,9 +11,9 @@ |
|
|
|
设备名称 : {{deviceName}} |
|
|
|
</view> --> |
|
|
|
|
|
|
|
<!-- <text v-if="deviceName!=''">({{deviceName}})</text> --> |
|
|
|
<!-- </view> --> |
|
|
|
<!-- <view class=""> |
|
|
|
<!-- <text v-if="deviceName!=''">({{deviceName}})</text> --> |
|
|
|
<!-- </view> --> |
|
|
|
<!-- <view class=""> |
|
|
|
<button type="primary" size="mini" @click="openScanPopup">扫描</button> |
|
|
|
</view> --> |
|
|
|
|
|
|
@ -25,18 +25,17 @@ |
|
|
|
点检人 : {{worker}} |
|
|
|
</view> --> |
|
|
|
<view class=""> |
|
|
|
<view class="uni-flex uni-row space-between u-col-center" > |
|
|
|
<view class="" style="margin: 5rpx; font-weight: bold;"> |
|
|
|
<uni-section title="设备编号" subTitle="" subTitleFontSize="26rpx" titleFontSize="35rpx" type="line"> |
|
|
|
</uni-section> |
|
|
|
<view class="uni-flex uni-row space-between u-col-center"> |
|
|
|
<!-- <view class="" style="margin: 5rpx; font-weight: bold;"> |
|
|
|
设备编号: |
|
|
|
</view> |
|
|
|
<uni-easyinput |
|
|
|
class="" |
|
|
|
trim="all" |
|
|
|
ref="inputDevice" |
|
|
|
v-model="deviceCode" |
|
|
|
@clear="deviceClear" |
|
|
|
:focus="true" |
|
|
|
@confirm="onConfirmDevice"></uni-easyinput> |
|
|
|
</view> --> |
|
|
|
<uni-easyinput class="" trim="all" 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!=''"> |
|
|
|
设备编号 : {{deviceCheckCode}} |
|
|
|
</view> |
|
|
|
<view class="" style="margin: 5rpx; font-weight: bold;" v-if="deviceName!=''"> |
|
|
|
设备名称 : {{deviceName}} |
|
|
@ -48,8 +47,8 @@ |
|
|
|
点检人 : {{worker}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view class="" style="width: 100%;background-color: gray;height: 2rpx; margin-top: 10rpx;" /> |
|
|
|
|
|
|
|
</view> |
|
|
@ -89,7 +88,7 @@ |
|
|
|
foamCheckSubmit, |
|
|
|
getFoamDeviceInfo |
|
|
|
} from '@/api/request2.js'; |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
showConfirmMsg |
|
|
|
} from "@/common/utils.js" |
|
|
@ -102,7 +101,7 @@ |
|
|
|
return { |
|
|
|
dateTime: "", |
|
|
|
deviceCode: "", |
|
|
|
deviceCheckCode:"", |
|
|
|
deviceCheckCode: "", |
|
|
|
deviceName: "", |
|
|
|
worker: this.$store.state.user.name, |
|
|
|
dataList: [], |
|
|
@ -241,7 +240,8 @@ |
|
|
|
}) |
|
|
|
getFoamDeviceInfo(result).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
this.deviceCode = result; |
|
|
|
this.deviceCode = ""; |
|
|
|
this.deviceCheckCode = result |
|
|
|
console.log(result) |
|
|
|
var groupSelect = { |
|
|
|
Type: "4", |
|
|
@ -252,45 +252,48 @@ |
|
|
|
// this.dataList = this.formData |
|
|
|
this.dataList = res.Result; |
|
|
|
this.dataList.push(groupSelect) |
|
|
|
|
|
|
|
this.deviceName=this.dataList[0].Name; |
|
|
|
|
|
|
|
this.deviceName = this.dataList[0].Name; |
|
|
|
this.dateTime = getCurrDateTime() |
|
|
|
this.worker = this.$store.state.user.name |
|
|
|
this.$forceUpdate(); |
|
|
|
}).catch(error => { |
|
|
|
this.deviceCode = "" |
|
|
|
this.deviceCheckCode = result |
|
|
|
uni.hideLoading() |
|
|
|
this.showMessage(error) |
|
|
|
this.showMessage("扫描设备[" + data + "]" + error) |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
submit() { |
|
|
|
if (this.deviceCode == "") { |
|
|
|
this.deviceCheckCode="" |
|
|
|
if (this.deviceCheckCode == "") { |
|
|
|
this.deviceCheckCode = "" |
|
|
|
this.showMessage("请先扫描设备编号") |
|
|
|
return |
|
|
|
} |
|
|
|
this.$refs.customerFrom.submit(data => { |
|
|
|
var groupName=""; |
|
|
|
var groupValue="" |
|
|
|
data.forEach(res=>{ |
|
|
|
if(res.Type=="4"){ |
|
|
|
groupName=res.SelectName; |
|
|
|
groupValue=res.SelectValue; |
|
|
|
var groupName = ""; |
|
|
|
var groupValue = "" |
|
|
|
data.forEach(res => { |
|
|
|
if (res.Type == "4") { |
|
|
|
groupName = res.SelectName; |
|
|
|
groupValue = res.SelectValue; |
|
|
|
} |
|
|
|
}) |
|
|
|
var commitData={ |
|
|
|
id:this.$store.state.user.id, |
|
|
|
createTime:getCurrDateTime(), |
|
|
|
groupName:groupName, |
|
|
|
groupValue:groupValue, |
|
|
|
dataList:data |
|
|
|
var commitData = { |
|
|
|
id: this.$store.state.user.id, |
|
|
|
createTime: getCurrDateTime(), |
|
|
|
groupName: groupName, |
|
|
|
groupValue: groupValue, |
|
|
|
dataList: data |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
console.log("提交", JSON.stringify(commitData)) |
|
|
|
foamCheckSubmit(commitData).then(res=>{ |
|
|
|
foamCheckSubmit(commitData).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showMessage("提交成功") |
|
|
|
this.clearData() |
|
|
|
}).catch(error=>{ |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showMessage(error) |
|
|
|
}) |
|
|
@ -298,15 +301,15 @@ |
|
|
|
}, |
|
|
|
clearData() { |
|
|
|
this.deviceCode = "" |
|
|
|
this.deviceName=""; |
|
|
|
this.dateTime =""; |
|
|
|
this.deviceCheckCode = "" |
|
|
|
this.deviceName = ""; |
|
|
|
this.dateTime = ""; |
|
|
|
this.dateTime = "", |
|
|
|
this.deviceCode = "", |
|
|
|
this.deviceName = "", |
|
|
|
this.worker="" |
|
|
|
this.dataList=[] |
|
|
|
// this.reset(); |
|
|
|
}, |
|
|
|
this.worker = "" |
|
|
|
this.dataList = [] |
|
|
|
// this.reset(); |
|
|
|
}, |
|
|
|
reset() { |
|
|
|
this.$refs.customerFrom.reset() |
|
|
|
}, |
|
|
@ -317,28 +320,28 @@ |
|
|
|
closeScanPopup() { |
|
|
|
this.$refs.scanPopup.closeScanPopup(); |
|
|
|
}, |
|
|
|
deviceClear(){ |
|
|
|
this.deviceCode=""; |
|
|
|
this.deviceCheckCode="" |
|
|
|
deviceClear() { |
|
|
|
this.deviceCode = ""; |
|
|
|
this.deviceCheckCode = "" |
|
|
|
}, |
|
|
|
showMessage(hint){ |
|
|
|
showConfirmMsg("提示", hint,false,callBack=>{ |
|
|
|
|
|
|
|
} ) |
|
|
|
showMessage(hint) { |
|
|
|
showConfirmMsg("提示", hint, false, callBack => { |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
onConfirmDevice(data){ |
|
|
|
if(data==undefined||data==""){ |
|
|
|
this.showMessage("请扫描设备编号") |
|
|
|
onConfirmDevice(data) { |
|
|
|
if (data == undefined || data == "") { |
|
|
|
this.showMessage("扫描数据为空,请输入设备编号") |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
uni.showLoading({ |
|
|
|
title: "加载中", |
|
|
|
mask: true |
|
|
|
}) |
|
|
|
getFoamDeviceInfo(data).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
this.deviceCode = data; |
|
|
|
this.deviceCode = ""; |
|
|
|
this.deviceCheckCode = data; |
|
|
|
console.log(data) |
|
|
|
var groupSelect = { |
|
|
@ -349,11 +352,12 @@ |
|
|
|
} |
|
|
|
this.dataList = res.Result; |
|
|
|
this.dataList.push(groupSelect) |
|
|
|
this.deviceName=this.dataList[0].Name; |
|
|
|
this.deviceName = this.dataList[0].Name; |
|
|
|
this.dateTime = getCurrDateTime() |
|
|
|
}).catch(error => { |
|
|
|
this.deviceCode = ""; |
|
|
|
uni.hideLoading() |
|
|
|
this.showMessage(error) |
|
|
|
this.showMessage("扫描设备[" + data + "]" + error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|