This commit is contained in:
xiaofajia 2024-12-17 16:07:08 +08:00
parent cd7502f958
commit 1fc379e0ae
2 changed files with 918 additions and 751 deletions

View File

@ -12,51 +12,79 @@
<view class="dil">
<view class="tinput">
<view class="text1" > <text class="hong1">*</text> 设备名称</view>
<view class="text1">
<text class="hong1">*</text>
设备名称
</view>
<view class="you">
<input type="text" placeholder="请输入设备名称" v-model="box.equName">
</view>
</view>
<view class="tinput">
<view class="text1" > <text class="hong1">*</text> 设备型号</view>
<view class="text1">
<text class="hong1">*</text>
设备型号
</view>
<view class="you">
<input type="text" placeholder="请输入设备型号" v-model="box.equModel">
</view>
</view>
<view class="tinput">
<view class="text1" > <text class="hong1">*</text> 设备编号</view>
<view class="text1">
<text class="hong1">*</text>
设备编号
</view>
<view class="you">
<input type="text" placeholder="请输入设备编号" v-model="box.equNumber">
</view>
</view>
<view class="tinput" @click="typeShow = true">
<view class="text1">
设备类别
</view>
<view class="you">
<input type="text" placeholder="请选择设备类别" v-model="typeName">
</view>
</view>
<view class="tinput">
<view class="text1" > <text class="hong1">*</text> 设备检定周期</view>
<view class="text1">
<text class="hong1">*</text>
设备检定周期
</view>
<view class="you">
<input type="text" placeholder="请输入设备检定周期" v-model="box.equZq">
</view>
</view>
<view class="tinput">
<view class="text1" > <text class="hong1">*</text> 上次检定单位</view>
<view class="text1">
<text class="hong1">*</text>
上次检定单位
</view>
<view class="you">
<input type="text" placeholder="请输入上次检定单位" v-model="box.lastUnit">
</view>
</view>
<view class="tinput">
<view class="text1"> <text class="hong1">*</text> 有效期</view>
<view class="text1">
<text class="hong1">*</text>
有效期
</view>
<!-- validTime -->
<view class="you" @click="show = true ">
<text>{{ time || '' }}</text>
</view>
</view>
<view class="tinput">
<view class="text1"> <text class="hong1">*</text> 下次检定时间</view>
<view class="text1">
<text class="hong1">*</text>
下次检定时间
</view>
<!-- nextCheckTime -->
<view class="you" @click="show1 = true ">
<text>{{ time1 || '' }}</text>
@ -79,7 +107,8 @@
return-type='string'
></u-datetime-picker>
<u-picker :show="typeShow" :columns="columns" @confirm="confirmsType" @cancel="typeShow = false"
keyName="label"></u-picker>
<view class="anniu" @click="getnewsadd()">
<text>保存</text>
</view>
@ -95,6 +124,8 @@
import config from '@/config'
import {getToken} from '@/utils/auth'
import upload from '@/utils/upload.js'
import {getDictDataByType} from "../../utils/utils";
var wvCurrent;
export default {
data() {
@ -110,6 +141,9 @@
id: '',
type: 'add',
box: {},
typeShow: false,
columns: [],
typeName: null,
}
},
onLoad(option) {
@ -117,13 +151,25 @@
if (option.type == 'edit') {
this.box.id = option.id
}
this.getInsType()
},
onShow() {
if (this.type == 'edit') this.getDetail();
},
methods: {
confirmsType(e){
console.log(e)
this.box.type = e.value[0].value
this.typeName = e.value[0].label
this.typeShow = false
},
getInsType(){
if (!this.columns || this.columns.length === 0){
this.columns = [getDictDataByType("ins_equ_type")]
}
console.log(this.columns)
},
async getDetail() {
let res = await request({
url: '/system/equInfo/' + this.box.id,
@ -135,6 +181,13 @@
this.time = this.box.validTime
this.time1 = this.box.nextCheckTime
}
if (this.box.type){
const data = this.columns[0]
const index = data.findIndex(item => item.value === this.box.type)
if (index !== -1){
this.typeName = data[index].label
}
}
},
cancels() {
this.show = false
@ -176,7 +229,6 @@
// })
if (this.type == 'add') {
let res = await request({
@ -243,9 +295,11 @@
padding: 0px 12px;
}
.top-icon {
margin-bottom: 45px;
}
.c-top {
width: 100%;
box-sizing: border-box;
@ -256,16 +310,19 @@
background-color: white;
padding-top: 40px;
}
.c-title {
font-size: 18px;
font-weight: bold
}
.top {
box-sizing: border-box;
padding: 0px 15px;
width: 100%;
background-color: white;
}
.top-box {
display: flex;
justify-content: space-between;
@ -273,12 +330,14 @@
box-sizing: border-box;
padding: 20px 0px;
}
.tb-left {
height: 100%;
width: 80%;
display: flex;
align-items: center;
}
.uicon {
width: 18px;
height: 18px;
@ -293,6 +352,7 @@
margin-right: 6px;
}
.tb-right {
width: 20px;
height: 26px;
@ -302,23 +362,27 @@
height: 100%;
}
}
.text1 {
font-size: 16px;
font-weight: bold;
color: #363636;
}
.hong1 {
margin-top: 5px;
font-size: 12px;
font-weight: 400;
color: #FF5453;
}
.hong2 {
margin-top: 5px;
font-size: 12px;
font-weight: 400;
}
.tinput {
width: 100%;
display: flex;
@ -330,6 +394,7 @@
margin-top: 14px;
margin-bottom: 14px;
}
.xinput {
width: 100%;
background: white;
@ -337,16 +402,19 @@
padding: 16px;
margin-top: 14px;
}
.you {
text-align: right;
}
.xz {
margin-top: 10px;
display: flex;
align-items: center;
}
.kuang {
width: 80px;
height: 23px;
@ -359,11 +427,13 @@
font-size: 14px;
margin-right: 15px;
}
.xlan {
background: #CDE7FF !important;
color: #1D62FF !important;
border: 1px solid #2A96FE;
}
.anniu {
width: 100%;
background: linear-gradient(180deg, #3F61C0 0%, #0D2E8D 100%);

View File

@ -22,9 +22,16 @@
<view class="cont">
<view @click="goadd('add')" style="width: 100%; display: flex; justify-content: center;background:white; margin: 10px 0px; box-sizing: border-box; padding: 10px;font-weight: bold;border-radius: 8px;">
<view @click="goadd('add')"
style="width: 100%; display: flex; justify-content: center;background:white; margin: 10px 0px; box-sizing: border-box; padding: 10px;font-weight: bold;border-radius: 8px;">
<text> + 新增设备</text>
</view>
<view class="box-bottom">
<view class="tap-box" v-for="(item,index) in tabList" :key="index" @click="gettap(item.value)">
<view :class="{'lan' : tapindex == item.value}">{{ item.label }}</view>
<view class="gang" v-if="tapindex == item.value"></view>
</view>
</view>
<view class="bjimg" v-if="arrlist == ''">
<image src="http://www.nuoyunr.com/lananRsc/detection/qs.png" mode=""></image>
</view>
@ -63,7 +70,8 @@
</view>
<uni-popup ref="alertDialog" type="dialog">
<uni-popup-dialog cancelText="关闭" confirmText="同意" title="通知" content="您确认要删除吗" @confirm="dialogConfirm"
<uni-popup-dialog cancelText="关闭" confirmText="同意" title="通知" content="您确认要删除吗"
@confirm="dialogConfirm"
@close="dialogClose"></uni-popup-dialog>
</uni-popup>
@ -77,24 +85,35 @@
import config from '@/config'
import code from '../../uni_modules/uview-ui/libs/config/props/code';
import request from '../../utils/request';
import {getDictDataByType} from "../../utils/utils";
export default {
data() {
return {
partnerId: '',
arrlist:[],
arrlist: [
],
pageNum: 1,//
pageSize: 20,//
totalPages: 0,//
deleteid: '',
equName: null
equName: null,
tabList:[
{
label: "全部",
value: "0"
}
],
tapindex: 0,
type: null
}
},
onLoad() {
this.partnerId = uni.getStorageSync('partnerId')
this.getlistindex()
this.getTab()
},
onShow() {
this.getlistindex()
@ -113,6 +132,17 @@ import code from '../../uni_modules/uview-ui/libs/config/props/code';
}
},
methods: {
gettap(value){
this.tapindex = value
this.type = value === '0' ? null : value
this.getlistindex()
},
getTab(){
if (!this.tabList || this.tabList.length === 1){
this.tabList = [...this.tabList, ...getDictDataByType("ins_equ_type")]
}
console.log(this.tabList)
},
dialogToggle(id) {
this.deleteid = id
this.$refs.alertDialog.open()
@ -154,7 +184,8 @@ import code from '../../uni_modules/uview-ui/libs/config/props/code';
partnerId: this.partnerId,
pageSize: this.pageSize,
pageNum: this.pageNum,
equName: this.equName
equName: this.equName,
type: this.type
}
})
// this.arrlist = res.rows
@ -183,9 +214,11 @@ import code from '../../uni_modules/uview-ui/libs/config/props/code';
box-sizing: border-box;
// padding-top: 45px;
}
.top-icon {
margin-bottom: 45px;
}
.q-fab {
position: fixed;
bottom: 50px;
@ -194,11 +227,13 @@ import code from '../../uni_modules/uview-ui/libs/config/props/code';
height: 55px;
border-radius: 50%;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
.fab-z1 {
position: fixed;
bottom: 115px;
@ -207,11 +242,13 @@ import code from '../../uni_modules/uview-ui/libs/config/props/code';
height: 50px;
border-radius: 50%;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
.fab-z2 {
position: fixed;
bottom: 50px;
@ -220,11 +257,13 @@ import code from '../../uni_modules/uview-ui/libs/config/props/code';
height: 50px;
border-radius: 50%;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
.c-tap {
width: 100%;
height: 40px;
@ -234,15 +273,18 @@ import code from '../../uni_modules/uview-ui/libs/config/props/code';
background-color: white;
align-items: center;
}
.c-top {
display: flex;
align-items: center;
justify-content: space-between;
}
.c-title {
font-size: 18px;
font-weight: bold
}
.cont {
width: 100%;
padding: 15px;
@ -251,6 +293,7 @@ import code from '../../uni_modules/uview-ui/libs/config/props/code';
background-color: #F6F6F6;
}
.hongdian {
width: 15px;
height: 15px;
@ -262,6 +305,7 @@ import code from '../../uni_modules/uview-ui/libs/config/props/code';
right: 5px;
z-index: 9999;
}
.c-box {
width: 100%;
box-sizing: border-box;
@ -272,27 +316,32 @@ import code from '../../uni_modules/uview-ui/libs/config/props/code';
}
.c-b-top {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
}
.t-left {
width: 40%;
height: 100px;
border-radius: 7px;
margin-right: 10px;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
.t-right {
width: 60%;
}
.t-tilte {
font-size: 20px;
font-weight: bold;
@ -302,6 +351,7 @@ import code from '../../uni_modules/uview-ui/libs/config/props/code';
text-overflow: ellipsis;
}
.tw-tilte {
width: 100%;
text-align: right;
@ -313,6 +363,7 @@ import code from '../../uni_modules/uview-ui/libs/config/props/code';
text-overflow: ellipsis;
}
.t-zi {
font-size: 14px;
font-weight: 400;
@ -324,16 +375,19 @@ import code from '../../uni_modules/uview-ui/libs/config/props/code';
-webkit-box-orient: vertical;
}
.bjimg {
width: 255px;
height: 236px;
margin: 0px auto;
margin-top: 100px;
image {
width: 100%;
height: 100%;
}
}
.c-b-bom {
width: 100%;
display: flex;
@ -341,15 +395,18 @@ import code from '../../uni_modules/uview-ui/libs/config/props/code';
align-items: center;
margin-top: 5px;
}
.b-left {
color: #0D2E8D;
font-size: 14px;
}
.b-right {
display: flex;
justify-content: space-between;
align-items: center;
}
.z-lv {
display: flex;
align-items: center;
@ -357,6 +414,7 @@ import code from '../../uni_modules/uview-ui/libs/config/props/code';
font-size: 15px;
margin-right: 10px;
}
.y-hong {
display: flex;
align-items: center;
@ -364,28 +422,35 @@ import code from '../../uni_modules/uview-ui/libs/config/props/code';
font-size: 15px;
margin-right: 15px;
}
.z-img {
width: 20px;
height: 15px;
image {
width: 100%;
height: 100%;
}
margin-right: 2px;
}
.tap-box {
width: 30%;
text-align: center;
}
.gang {
height: 4px;
background: #0D2E8D;
width: 80%;
margin: 0px auto;
}
.lan {
color: #0D2E8D;
}
.top-heder {
width: 100%;
height: 68px;
@ -397,19 +462,23 @@ import code from '../../uni_modules/uview-ui/libs/config/props/code';
padding: 5px 15px;
margin-top: 2rem;
}
.t-title {
font-size: 17px;
font-weight: bold;
color: #333333;
}
.t-left {
width: 20%;
height: 20px;
}
.t-you {
width: 20%;
height: 20px;
}
.box-top {
font-size: 16px;
font-weight: bold;
@ -422,6 +491,7 @@ import code from '../../uni_modules/uview-ui/libs/config/props/code';
align-items: center;
justify-content: space-between;
}
.box-hui {
font-size: 15px;
font-weight: 400;
@ -429,6 +499,7 @@ import code from '../../uni_modules/uview-ui/libs/config/props/code';
display: flex;
margin-bottom: 5px;
}
.box-left {
margin-right: 10px;
}
@ -456,4 +527,30 @@ import code from '../../uni_modules/uview-ui/libs/config/props/code';
display: flex;
justify-content: center;
}
.box-bottom {
display: flex;
justify-content: space-between;
//width: 100%;
//height: 30px;
//box-sizing: border-box;
//white-space: nowrap;
}
.tap-box {
width: 20%;
display: inline-block;
text-align: center;
}
.gang {
height: 4px;
background: #0D2E8D;
width: 80%;
margin: 0px auto;
}
.lan {
color: #0D2E8D;
}
</style>