This commit is contained in:
2022-07-29 17:07:00 +08:00
parent 93ec17b792
commit afa557a520
10 changed files with 480 additions and 21 deletions

View File

@@ -2,7 +2,7 @@
* @Author: gtz
* @Date: 2022-07-28 10:22:30
* @LastEditors: gtz
* @LastEditTime: 2022-07-28 17:22:14
* @LastEditTime: 2022-07-29 13:26:58
* @Description: file content
* @FilePath: \hf-pda\src\pages\eqInspection\components\eqItem.vue
-->
@@ -59,7 +59,15 @@ export default {
}
},
methods: {
toDetail () {}
toDetail () {
this.$router.push({
name: 'eqInspectionEdit',
query: {
equipmentId: this.injectData.equipmentId,
id: this.injectData.id
}
})
}
}
}
</script>

View File

@@ -0,0 +1,155 @@
<!--
* @Author: gtz
* @Date: 2022-07-28 10:22:30
* @LastEditors: gtz
* @LastEditTime: 2022-07-29 16:02:15
* @Description: file content
* @FilePath: \hf-pda\src\pages\eqInspection\eqInspection-add.vue
-->
<template>
<div class="eqInspectionAdd">
<!-- @keypress.enter="submitEqCode" -->
<!-- navbar -->
<van-sticky :offset-top="0">
<van-nav-bar
title="PDA巡检扫描设备信息"
left-arrow
sticky
class="eq-header"
@click-left="onClickLeft"
/>
<!-- @click-right="onClickRight" -->
</van-sticky>
<div class="eq-add-main">
<van-row class="eq-field-item">
<van-col :span="7" class="eq-field-item-lable">
<short-line />
设备编码
</van-col>
<van-col :span="15" :offset="1" class="eq-field-item-input">
<van-field
v-model="eqCode"
ref="eqCodeInput"
clearable
autofocus
placeholder="扫描或手动获取"
>
<template #button>
<van-button size="small" type="primary" @click="submitEqCode">确定</van-button>
</template>
</van-field>
</van-col>
</van-row>
<div class="eq-main-img">
<img src="../../assets/img/back.png" alt="">
</div>
</div>
</div>
</template>
<script>
import shortLine from '@/components/shortLine.vue'
import { getEqInfo } from '@/api/eqInspection'
export default {
name: 'eqInspectionAdd',
components: { shortLine },
data () {
return {
eqCode: null
}
},
methods: {
// 返回上一页
onClickLeft () {
this.$router.goBack()
},
// 提交设备CODE
async submitEqCode () {
const result = await getEqInfo({
key: this.eqCode
})
if (result.success) {
this.$router.push({
name: 'eqInspectionEdit',
query: {
equipmentId: result.data.id
}
})
}
console.log(result)
}
}
}
</script>
<style lang="scss">
.eqInspectionAdd {
width: 100%;
.eq-header {
background: #4271FF;
.van-icon {
color: #fff;
font-size: .4375rem;
}
.van-nav-bar__content {
height: 1.5rem;
line-height: 1.5rem;
.van-nav-bar__title {
color: #fff;
font-size: .4375rem;
}
}
}
.eq-add-main {
width: 100%;
position: absolute;
top: 1.5rem;
bottom: 0;
overflow: scroll;
input::-webkit-input-placeholder {
font-size: .375rem;
}
input:-moz-placeholder {
font-size: .375rem;
}
input::-moz-placeholder {
font-size: .375rem;
}
input:-ms-input-placeholder {
font-size: .375rem;
}
.eq-field-item {
padding-top: .25rem;
line-height: .875rem;
.eq-field-item-lable {
text-align: right;
font-size: .375rem;
}
.van-cell {
padding: 0 .25rem;
height: .875rem;
background: #F6F6F6;
border-radius: .1875rem;
.van-field__body {
height: .875rem;
.van-field__control {
height: .875rem;
}
}
}
}
.eq-main-img {
width: 100%;
min-height: 70vh;
display: flex;
align-items: center;
justify-content: center;
img {
width: 4.4rem;
height: 3.6rem;
}
}
}
}
</style>

View File

@@ -0,0 +1,252 @@
<!--
* @Author: gtz
* @Date: 2022-07-28 10:22:30
* @LastEditors: gtz
* @LastEditTime: 2022-07-29 17:06:04
* @Description: file content
* @FilePath: \hf-pda\src\pages\eqInspection\eqInspection-edit.vue
-->
<template>
<div class="eqInspectionEdit">
<!-- navbar -->
<van-sticky :offset-top="0">
<van-nav-bar
title="PDA巡检信息"
left-arrow
sticky
class="eq-header"
@click-left="onClickLeft"
/>
<!-- @click-right="onClickRight" -->
</van-sticky>
<div class="eq-edit-main">
<div class="eq-main-item">
<van-row class="eq-field-item">
<van-col :span="7" class="eq-field-item-lable">
<short-line />
设备名称
</van-col>
<van-col :span="15" :offset="1" class="eq-field-item-input">
<van-field
v-model="dataForm.equipmentId"
ref="eqCodeInput"
disabled
/>
</van-col>
</van-row>
<van-row class="eq-field-item">
<van-col :span="7" class="eq-field-item-lable">
<short-line />
巡检人员
</van-col>
<van-col :span="15" :offset="1" class="eq-field-item-input">
<van-field
v-model="dataForm.inspectionWorker"
ref="eqCodeInput"
clearable
placeholder="填写巡检人员以逗号隔开"
/>
</van-col>
</van-row>
<van-row class="eq-field-item">
<van-col :span="7" class="eq-field-item-lable">
<short-line />
巡检时间
</van-col>
<van-col :span="15" :offset="1" class="eq-field-item-input">
<van-field
v-model="insTime"
ref="eqCodeInput"
clearable
clear-trigger="always"
disabled
placeholder="选择巡检时间"
/>
</van-col>
</van-row>
</div>
<div class="eq-main-edit-item">
<van-row class="eq-field-item">
<van-col :span="7" class="eq-field-item-lable">
<short-line />
巡检详情
</van-col>
<van-col :span="15" :offset="1" />
<van-field
v-model="dataForm.inspectionDesc"
type="textarea"
rows="5"
autosize
/>
</van-row>
</div>
<div class="eq-main-edit-item">
<van-row class="eq-field-item">
<van-col :span="7" class="eq-field-item-lable">
<short-line />
附件
</van-col>
<van-col :span="15" :offset="1" />
<van-col :span="24" style="padding-left: .25rem">
<van-uploader
v-model="fileList"
:max-count="1"
accept=".doc,.docx,.xls,.xlsx,.pdf,image/*"
:after-read="uploadFile"
/>
</van-col>
</van-row>
</div>
</div>
</div>
</template>
<script>
import { detail, eqList } from '@/api/eqInspection'
// , getEqInsItemList
import shortLine from '@/components/shortLine.vue'
export default {
name: 'eqInspectionEdit',
components: { shortLine },
data () {
return {
eqList: [],
dataForm: {
id: null,
annexUrl: null,
equipmentId: null,
inspectionDesc: null,
inspectionWorker: null,
inspectionEndTime: null,
inspectionStartTime: null
},
insTime: null,
fileList: []
}
},
mounted () {
this.getEqList()
},
methods: {
// 返回上一页
onClickLeft () {
this.$router.goBack()
},
async getEqList () {
const result = await eqList({
current: 1,
size: 999
})
if (result.success) {
this.eqList = result.data.records
if (this.$route.query.id) {
this.getDetail()
} else {
this.dataForm.equipmentId = this.$route.query.equipmentId
}
}
},
// 获取详情
async getDetail () {
const result = await detail({
id: this.$route.query.id
})
if (result.success) {
this.dataForm = result.data
console.log(result)
}
},
// 文件上传
uploadFile (file) {
console.log(file)
}
}
}
</script>
<style lang="scss">
.eqInspectionEdit {
width: 100%;
background: #F6F6F6;
.eq-header {
background: #4271FF;
.van-icon {
color: #fff;
font-size: .4375rem;
}
.van-nav-bar__content {
height: 1.5rem;
line-height: 1.5rem;
.van-nav-bar__title {
color: #fff;
font-size: .4375rem;
}
}
}
.eq-edit-main {
width: 100%;
position: absolute;
top: 1.5rem;
bottom: 0;
overflow: scroll;
input::-webkit-input-placeholder {
font-size: .375rem;
}
input:-moz-placeholder {
font-size: .375rem;
}
input::-moz-placeholder {
font-size: .375rem;
}
input:-ms-input-placeholder {
font-size: .375rem;
}
.eq-main-item {
background: #fff;
padding-bottom: .25rem;
margin-bottom: .25rem;
.eq-field-item {
padding-top: .25rem;
line-height: .875rem;
.eq-field-item-lable {
text-indent: .375rem;
font-size: .375rem;
}
.van-cell {
padding: 0 .25rem;
height: .875rem;
background: #F6F6F6;
border-radius: .1875rem;
.van-field__body {
height: .875rem;
.van-field__control {
height: .875rem;
}
}
}
}
}
.eq-main-edit-item {
background: #fff;
padding-bottom: .25rem;
margin-bottom: .25rem;
.eq-field-item {
padding-top: .25rem;
line-height: .875rem;
.eq-field-item-lable {
text-indent: .375rem;
font-size: .375rem;
}
.van-cell {
width: calc(100% - .75rem);
margin: 0 .375rem;
padding: 0 .25rem;
background: #F6F6F6;
border-radius: .125rem;
}
}
}
}
}
</style>

View File

@@ -44,7 +44,7 @@
</van-row>
<van-row class="eq-search-btn">
<van-col :span="9" :offset="1">
<van-button class="eq-search-btn-item eq-search-btn-left" round>扫描新增</van-button>
<van-button class="eq-search-btn-item eq-search-btn-left" round @click="toAdd">扫描新增</van-button>
</van-col>
<van-col :span="12" :offset="1">
<van-button class="eq-search-btn-item eq-search-btn-right" round @click="getDataList"> </van-button>
@@ -179,6 +179,12 @@ export default {
name: 'index'
})
},
// 扫描新增
toAdd () {
this.$router.push({
name: 'eqInspectionAdd'
})
},
// 重置筛选项
resetQuery () {
this.queryList = {
@@ -245,14 +251,14 @@ export default {
background: #4271FF;
.van-icon {
color: #fff;
font-size: .5rem;
font-size: .4375rem;
}
.van-nav-bar__content {
height: 1.5rem;
line-height: 1.5rem;
.van-nav-bar__title {
color: #fff;
font-size: .5rem;
font-size: .4375rem;
}
}
}
@@ -288,19 +294,15 @@ export default {
background: #fff;
box-shadow: .02rem .02rem .1rem rgba($color: #000000, $alpha: .2);
input::-webkit-input-placeholder {
color: #131415;
font-size: .375rem;
}
input:-moz-placeholder {
color: #131415;
font-size: .375rem;
}
input::-moz-placeholder {
color: #131415;
font-size: .375rem;
}
input:-ms-input-placeholder {
color: #131415;
font-size: .375rem;
}
}