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