Commit cfb83799 authored by xinzhedeai's avatar xinzhedeai

add 字段正式化处理

parent f75e4a6e
...@@ -44,17 +44,17 @@ ...@@ -44,17 +44,17 @@
<div id="app"> <div id="app">
<div class="content" v-cloak> <div class="content" v-cloak>
<van-cell-group> <van-cell-group>
<van-cell is-link @click="showPopup=true">检查日期<span class="formValue">{{createDate}}</span></van-cell> <van-cell is-link @click="showPopup4hdInspectDate=true">检查日期<span class="formValue">{{form.hdInspectDate}}</span></van-cell>
<van-popup v-model="showPopup" position="bottom" :style="{ height: '30%' }"> <van-popup v-model="showPopup4hdInspectDate" position="bottom" :style="{ height: '30%' }">
<van-datetime-picker v-model="currentDate" type="date" title="选择年月日" @confirm="confirmDate" @cancel="showPopup=false" /> <van-datetime-picker v-model="hdInspectDateModel" type="date" title="选择年月日" @confirm="confirm4hdInspectDate" @cancel="showPopup4hdInspectDate=false" />
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-field v-model="hdInspectExpert" label="检查人员" placeholder="" /> <van-field v-model="form.hdInspectExpert" label="检查人员" placeholder="" />
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-cell>隐患类型: <van-cell>隐患类型:
<van-radio-group v-model="hdLevel" direction="horizontal"> <van-radio-group v-model="form.hdLevel" direction="horizontal">
<van-radio name="1">一般隐患</van-radio> <van-radio name="1">一般隐患</van-radio>
<van-radio name="2">重大隐患</van-radio> <van-radio name="2">重大隐患</van-radio>
</van-radio-group> </van-radio-group>
...@@ -62,42 +62,42 @@ ...@@ -62,42 +62,42 @@
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-cell is-link @click="showPopup4findQuestion=true">安全类别:<span class="formValue">{{findQuestion}}</span></van-cell> <van-cell is-link @click="showPopup4secType=true">安全类别:<span class="formValue">{{form.curSelectSecType}}</span></van-cell>
<van-popup v-model="showPopup4findQuestion" round position="bottom"> <van-popup v-model="showPopup4secType" round position="bottom">
<van-picker show-toolbar :columns="columns4findQuestion" @cancel="showPopup4findQuestion = false" @confirm="onConfirm4findQuestion" /> <van-picker show-toolbar :columns="secType" value-key="name" @cancel="showPopup4secType = false" @confirm="onConfirm4secType" />
</van-popup> </van-popup>
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-cell is-link @click="showPopup4findQuestion=true">安全检查类别:<span class="formValue">{{findQuestion}}</span></van-cell> <van-cell is-link @click="showPopup4secCheckTypeReplace=true">安全检查类别:<span class="formValue">{{form.curSelectSecType}}</span></van-cell>
<van-popup v-model="showPopup4findQuestion" round position="bottom"> <van-popup v-model="showPopup4secCheckTypeReplace" round position="bottom">
<van-picker show-toolbar :columns="columns4findQuestion" @cancel="showPopup4findQuestion = false" @confirm="onConfirm4findQuestion" /> <van-picker show-toolbar :columns="secCheckTypeReplace" @cancel="showPopup4secCheckTypeReplace = false" @confirm="onConfirm4secCheckTypeReplace" />
</van-popup> </van-popup>
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-cell is-link @click="showPopup4findQuestion=true">安全检查内容:<span class="formValue">{{findQuestion}}</span></van-cell> <van-cell is-link @click="showPopup4secCheckContent=true">安全检查内容:<span class="formValue">{{form.curSelectCheckContent}}</span></van-cell>
<van-popup v-model="showPopup4findQuestion" round position="bottom"> <van-popup v-model="showPopup4secCheckContent" round position="bottom">
<van-picker show-toolbar :columns="columns4findQuestion" @cancel="showPopup4findQuestion = false" @confirm="onConfirm4findQuestion" /> <van-picker show-toolbar :columns="secCheckContent" @cancel="showPopup4secCheckContent = false" @confirm="onConfirm4secCheckContent" />
</van-popup> </van-popup>
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-cell is-link @click="showPopup4findQuestion=true">发现问题:<span class="formValue">{{findQuestion}}</span></van-cell> <van-cell is-link @click="showPopup4secCheckDiscover=true">发现问题:<span class="formValue">{{form.hdName}}</span></van-cell>
<van-popup v-model="showPopup4findQuestion" round position="bottom"> <van-popup v-model="showPopup4secCheckDiscover" round position="bottom">
<van-picker show-toolbar :columns="columns4findQuestion" @cancel="showPopup4findQuestion = false" @confirm="onConfirm4findQuestion" /> <van-picker show-toolbar :columns="secCheckDiscover" @cancel="showPopup4secCheckDiscover = false" @confirm="onConfirm4secCheckDiscover" />
</van-popup> </van-popup>
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-field v-model="value" label="隐患描述" placeholder="" /> <van-field v-model="form.hdDesc" label="隐患描述" placeholder="" />
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-field v-model="value" label="检查依据" placeholder="" /> <van-field v-model="form.basis" label="检查依据" placeholder="" />
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-field v-model="value" label="整改建议" placeholder="" /> <van-field v-model="form.hdRectificationSug" label="整改建议" placeholder="" />
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-cell is-link @click="showPopup=true">整改期限<span class="formValue">{{createDate}}</span></van-cell> <van-cell is-link @click="showPopup4hdRectificationDate=true">整改期限<span class="formValue">{{form.hdRectificationDate}}</span></van-cell>
<van-popup v-model="showPopup" position="bottom" :style="{ height: '30%' }"> <van-popup v-model="showPopup4hdRectificationDate" position="bottom" :style="{ height: '30%' }">
<van-datetime-picker v-model="currentDate" type="date" title="选择年月日" @confirm="confirmDate" @cancel="showPopup=false" /> <van-datetime-picker v-model="hdRectificationDateModel" type="date" title="选择年月日" @confirm="confirm4hdRectificationDate" @cancel="showPopup4hdRectificationDate=false" />
</van-popup> </van-popup>
</van-cell-group> </van-cell-group>
...@@ -121,15 +121,15 @@ ...@@ -121,15 +121,15 @@
</div></van-cell> </div></van-cell>
</van-cell-group> </van-cell-group>
<div v-if="hdStatus===1||hdStatus===2"> <div v-if="form.hdStatus===1||form.hdStatus===2">
<van-cell-group> <van-cell-group>
<van-field v-model="hdRectificationDate" label="审核日期" placeholder="" /> <van-field v-model="form.hdInspectDate" label="审核日期" placeholder="" />
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-field v-model="hdAcceptancePerson" label="审核人员" placeholder="" /> <van-field v-model="form.hdAcceptancePerson" label="审核人员" placeholder="" />
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-field v-model="hdRectificationRecord" type="textarea" label="审核记录" autosize placeholder="" /> <van-field v-model="form.hdRectificationRecord" type="textarea" label="审核记录" autosize placeholder="" />
</van-cell-group> </van-cell-group>
</div> </div>
......
...@@ -6,111 +6,114 @@ window.addEventListener("load", function() { ...@@ -6,111 +6,114 @@ window.addEventListener("load", function() {
el: '#app', el: '#app',
data() { data() {
return { return {
editAble: true, form: {
// checkImg:false, // 检查日期
// showButton:false, hdInspectDate: '',
// // 企业id // 检查人员
// companyId: app.globalData.currentEnter.companyId, hdInspectExpert: '',
// // 隐患验收人 // 隐患类型
hdAcceptancePerson: "刘德华", hdLevel: '1',
// // 隐患描述 // 安全类别
// comment: '', curSelectSecType: '',
// // 隐患id // 安全检查类别
// hdId: -1, curSelectSecCheckTypeReplace: '',
// // 隐患描述 // 当前选择的安全检查内容
// hdDesc: "", curSelectCheckContent: '',
// // 检查日期 // 发现问题
// hdInspectDate: '', hdName: '',
// // 检查专家 // 隐患描述
hdInspectExpert: '刘德华', hdDesc: "",
// // 隐患级别 1 2 // 检查依据
// hdLevel: 1, basis: '',
// // 隐患名称 // 隐患整改建议
// hdName: '', hdRectificationSug: '',
// // 隐患图片 // 隐患图片
// hdPic: null, hdPic: null,
// // 隐患整改日期 // 隐患整改日期
hdRectificationDate: '2024-3-8 10:04:09', hdRectificationDate: '2024-3-8 10:04:09',
// // 隐患整改图片 // 隐患整改图片
hdRectificationPic: null, hdRectificationPic: null,
hdRectificationRecord: '24年02月22日 审核未通过;24年02月22日 审核未通过', // 整改图片文件路径
hdStatus: 1, rectFilePath: '',
// // 隐患整改建议 // 审核人
suggestion:'', hdAcceptancePerson: "刘德华",
// hdRectificationSug: '', hdRectificationRecord: '24年02月22日 审核未通过;24年02月22日 审核未通过',
// // 隐患状态 0 正在整改 1 整改完毕 hdInspectDate: '2024-3-11 14:37:53',
// hdStatus: 1, hdStatus: 1,
// // 隐患预览图片 },
// imgsrcurl: '', // 企业id
// // 整改预览照片 companyId: localStorage.getItem('companyId'),
// imgrecturl: '', editAble: true,
// // 隐患图片文件路径
// hdFilePath: '', // 安全类别列表数据
// // 整改图片文件路径 secType: [{
// rectFilePath: '', name: '安全资料类',
// // 放大图片的路径 },{
// enlargeUrl: '', name: '现场检查类',
// topAnimation: {}, }],
// curRole:'', showPopup4secType: false,
// isToEnLarge: false,
// xcx:'xcx', // 安全检查类别列表数据
// // 总的安全类别 secCheckTypeReplace: [],
// secType: [ showPopup4secCheckTypeReplace: false,
// { // 安全检查内容列表数据
// name: '安全资料类' secCheckContent: [],
// }, showPopup4secCheckContent: false,
// { // 安全发现问题列表数据
// name: '现场检查类' secCheckDiscover: [],
// } showPopup4secCheckDiscover: false,
// ],
// // // 检查日期的模态框
// curSelectSecType: '', hdInspectDateModel: '', // 时间的临时model值
// // 安全检查类别 showPopup4hdInspectDate: false,
// secCheckType: [],
// // 安全检查类别替代 // 整改日期模态框
// secCheckTypeReplace: [], hdRectificationDateModel: '',
// // 当前选择的安全检查类别 showPopup4hdRectificationDate: false,
// curSelectSecCheckTypeReplace: '',
// // 安全检查内容
// secCheckContent: [],
// // 当前选择的安全检查内容
// curSelectCheckContent: '',
hdInspectExpert: '',
hdLevel: '1',
username: '',
password: '',
value: '',
fileList: [], fileList: [],
value2: '', // columns4findQuestion: ['杭州', '宁波', '温州', '绍兴', '湖州', '嘉兴', '金华', '衢州'],
value3: '', // findQuestion: '',
pattern: /\d{6}/,
showPopup: false,
currentDate: '',
createDate: '',
showPopup4findQuestion: false,
columns4findQuestion: ['杭州', '宁波', '温州', '绍兴', '湖州', '嘉兴', '金华', '衢州'],
findQuestion: '',
} }
}, },
mounted() { mounted() {},
},
methods: { methods: {
formatDate(date) { formatDate(date) {
return `${date.getFullYear() + 1}/${date.getMonth() + 1}/${date.getDate()}`; return `${date.getFullYear() + 1}/${date.getMonth() + 1}/${date.getDate()}`;
}, },
onConfirm4findQuestion(value, index) { onConfirm4secType(value, index) {
this.findQuestion = value; console.log('value', value)
this.showPopup4findQuestion = false; this.form.curSelectSecType = value.name
this.showPopup4secType = false
},
onConfirm4secCheckTypeReplace(value, index) {
console.log('value', value)
this.form.curSelectSecCheckTypeReplace = value.name
this.showPopup4secCheckTypeReplace = false
},
onConfirm4secCheckContent(value){
this.form.curSelectCheckContent = value.name
this.showPopup4secCheckContent = false
},
onConfirm4secCheckDiscover(value){
this.form.hdName = value
this.showPopup4secCheckDiscover = false
}, },
confirmDate(value) {
confirm4hdInspectDate(value) {
console.log('value', value) console.log('value', value)
this.createDate = this.formatDate(new Date(value)) this.form.hdInspectDate = this.formatDate(new Date(value))
this.showPopup4hdInspectDate = false
VUE.showPopup = false },
confirm4hdRectificationDate(value) {
console.log('value', value)
this.form.hdRectificationDate = this.formatDate(new Date(value))
this.showPopup4hdRectificationDate = false
console.log('value', VUE.showPopup)
}, },
}, },
}); });
......
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