Commit d56ecbdf authored by xinzhedeai's avatar xinzhedeai

响应错误提示 日期工具栏滚动隐藏问题处理 禁用样式调整

parent 707dd569
......@@ -42,3 +42,11 @@
justify-content: flex-end;
padding-right: 0.18rem;
}
/* 禁用元素样式: 输入框 单选 下拉picker */
.disable-van-cell .van-cell__value--alone,
.van-radio__label--disabled,
.van-field__control:disabled,
.van-field--disabled .van-field__label{color: #9b9fab; cursor: not-allowed;opacity: 1; }
\ No newline at end of file
......@@ -58,8 +58,12 @@ var http = {
.then(res => {
let response = res.data
console.log('res.statusCode', response)
if(response.statusCode >= 300){
if(response.statusCode >= 300||response.status >= 300){
// alert('系统发生错误')
vant.Dialog.alert({
title: '信息提示',
message: response.message,
})
return
}
resolve(res.data)
......@@ -85,8 +89,12 @@ var http = {
.then(res => {
let response = res.data
console.log('res.statusCode', response)
if(response.statusCode >= 300){
if(response.statusCode >= 300||response.status >= 300){
// alert('系统发生错误')
vant.Dialog.alert({
title: '信息提示',
message: response.message,
})
return
}
resolve(res.data)
......@@ -112,8 +120,12 @@ var http = {
.then(res => {
let response = res.data
console.log('res.statusCode', response)
if(response.statusCode >= 300){
if(response.statusCode >= 300||response.status >= 300){
// alert('系统发生错误')
vant.Dialog.alert({
title: '信息提示',
message: response.message,
})
return
}
resolve(res.data)
......@@ -136,8 +148,12 @@ var http = {
}).then(res => {
let response = res.data
console.log('res.statusCode', response)
if(response.statusCode >= 300){
if(response.statusCode >= 300||response.status >= 300){
// alert('系统发生错误')
vant.Dialog.alert({
title: '信息提示',
message: response.message,
})
return
}
resolve(res.data)
......
......@@ -31,11 +31,6 @@
.van-cell__value{overflow: unset; }
.van-cell:after{border-bottom:none;}
.van-radio-group--horizontal{float: right;}
.disable-van-cell{
background-color: #f3f3f3;
}
.disable-van-cell .van-cell__value--alone{color: #c8c9cc; cursor: not-allowed;}
</style>
</head>
<body>
......@@ -43,8 +38,8 @@
<div class="content" v-cloak :class="{'disable-van-cell': !editAble}">
<van-cell-group>
<van-cell is-link @click="showPopup('showPopup4hdInspectDate')" >检查日期<span class="formValue">{{form.hdInspectDate}}</span></van-cell>
<van-popup v-model="showPopup4hdInspectDate" position="bottom" :style="{ height: '30%' }">
<van-datetime-picker v-model="hdInspectDateModel" type="date" title="选择年月日" @confirm="confirm4hdInspectDate" @cancel="showPopup4hdInspectDate=false" />
<van-popup v-model="showPopup4hdInspectDate" position="bottom" :style="{ height: '50%' }">
<van-datetime-picker v-model="hdInspectDateModel" :safe-area-inset-bottom="true" :min-date="curDate" type="date" title="选择年月日" @confirm="confirm4hdInspectDate" @cancel="showPopup4hdInspectDate=false" />
</van-cell-group>
<van-cell-group>
......@@ -94,7 +89,7 @@
</van-cell-group>
<van-cell-group>
<van-cell is-link @click="showPopup('showPopup4hdRectificationDate')">整改期限<span class="formValue">{{form.hdRectificationDate}}</span></van-cell>
<van-popup v-model="showPopup4hdRectificationDate" position="bottom" :style="{ height: '30%' }">
<van-popup v-model="showPopup4hdRectificationDate" position="bottom" :style="{ height: '50%' }">
<van-datetime-picker v-model="hdRectificationDateModel" type="date" title="选择年月日" @confirm="confirm4hdRectificationDate" @cancel="showPopup4hdRectificationDate=false" />
</van-popup>
......@@ -120,21 +115,18 @@
</div></van-cell>
</van-cell-group>
<div v-if="form.hdStatus===1||form.hdStatus===2">
<div v-if="form.hdStatus===1||form.hdStatus===2" >
<van-cell-group>
<van-field v-model="form.hdInspectDate" label="审核日期" placeholder="" />
<van-field v-model="form.hdInspectDate" :disabled="true" label="审核日期" placeholder="" />
</van-cell-group>
<van-cell-group>
<van-field v-model="form.hdAcceptancePerson" label="审核人员" placeholder="" />
<van-field v-model="form.hdAcceptancePerson" :disabled="true" label="审核人员" placeholder="" />
</van-cell-group>
<van-cell-group>
<van-field v-model="form.hdRectificationRecord" type="textarea" label="审核记录" autosize placeholder="" />
<van-field v-model="form.hdRectificationRecord" :disabled="true" type="textarea" label="审核记录" autosize placeholder="" />
</van-cell-group>
</div>
<div class="formSubmitBtnWrapper" v-if="editAble"><van-button type="info" size="small" @click="submit">提交</van-button></div>
</div>
</div>
</body>
......
......@@ -7,6 +7,7 @@ window.addEventListener("load", function() {
el: '#app',
data() {
return {
curDate: new Date(),
form: {
// 检查日期
hdInspectDate: '',//2024-03-08 00:00:00',
......@@ -127,6 +128,7 @@ window.addEventListener("load", function() {
})
return
}
this.form.hdInspectDate = this.form.hdInspectDate.replace(' 00:00:00', '') + ' 00:00:00'
if (!this.form.curSelectSecType) {
vant.Dialog.alert({
message: '请选择安全类别',
......@@ -151,12 +153,25 @@ window.addEventListener("load", function() {
})
return;
}
if (!this.form.hdDesc) {
vant.Dialog.alert({
message: '请填写隐患描述',
})
return
}
if (!this.fileList.length) {
vant.Dialog.alert({
message: '没有隐患照片',
})
return
}
if (!this.form.hdRectificationDate) {
vant.Dialog.alert({
message: '请选择整改日期',
})
return
}
let formData = new FormData()
for (const key of Object.keys(this.form)) {
......@@ -298,7 +313,7 @@ window.addEventListener("load", function() {
confirm4hdInspectDate(value) {
console.log('value', value)
this.form.hdInspectDate = this.formatDate(new Date(value), 'YYYY-MM-DD HH:MM:SS')
this.form.hdInspectDate = this.formatDate(new Date(value))
this.showPopup4hdInspectDate = false
},
......
......@@ -27,15 +27,6 @@
.van-cell:after {
border-bottom: none;
}
.disable-van-cell {
background-color: #f3f3f3;
}
.disable-van-cell .van-cell__value--alone {
color: #c8c9cc;
cursor: not-allowed;
}
</style>
</head>
<body>
......@@ -50,6 +41,9 @@
<van-cell-group>
<van-field v-model="form.hdName" :disabled="!editAble" label="发现问题" placeholder="" />
</van-cell-group>
<van-cell-group>
<van-field v-model="form.hdDesc" :disabled="!editAble" label="隐患描述" placeholder="" />
</van-cell-group>
<van-cell-group>
<van-cell>隐患照片:
<div style="width: 2.5rem;">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment