Commit 8998b725 authored by xinzhedeai's avatar xinzhedeai

详情-添加

parent c28219ee
......@@ -48,7 +48,7 @@ var userInfo = {
}
var token =
"Bearer eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiJjNDdlMTA3MGZjZDc0MDdmOTBlNWViN2Y0M2ZkNmQ2MSIsInVzZXIiOiJhZG1pbiIsInN1YiI6ImFkbWluIn0.ABEEx0r9KFg2aZNk9IwdV37z4wy7PyLK8l0lpoAMiaA_ct3bCUMVqu9TPBOXY5Dmzv3C2UxC3oXF9w9Vc_DHRA";
"Bearer eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiI5OGI1OGIwYjRlYmY0Nzg4YjQyM2VmMjVmYzkwYWE4NCIsInVzZXIiOiJhZG1pbiIsInN1YiI6ImFkbWluIn0.c-gsRfSGfkQuaLr2BTVfJuAhE-i8imzawovC56O3UEUVYsZW8XJ9RYgIE65M8n77z6YNmrXGysqdP8vCgRVyag";
localStorage.setItem('Authorization', token)
localStorage.setItem('appCounty', userInfo.user.county)
......
......@@ -110,7 +110,7 @@
<van-cell-group>
<van-cell>隐患照片:
<div style="width: 2.5rem;">
<van-uploader v-model="fileList" :max-count="1" :deletable="editAble" >
<van-uploader v-model="fileList" :max-count="1" :deletable="editAble" :preview-full-image="false">
<!-- <van-button icon="plus" type="info" size="small">上传文件</van-button> -->
</van-uploader>
</div></van-cell>
......
......@@ -9,29 +9,29 @@ window.addEventListener("load", function() {
return {
form: {
// 检查日期
hdInspectDate: '2024-03-08 00:00:00',
hdInspectDate: '',//2024-03-08 00:00:00',
// 检查人员
hdInspectExpert: '发发发',
hdInspectExpert: '',//'发发发',
// 隐患类型
hdLevel: '1',
// 安全类别
curSelectSecType: '安全资料类',
curSelectSecType: '',//'安全资料类',
// 安全检查类别
curSelectSecCheckTypeReplace: '测试资料',
curSelectSecCheckTypeReplace: '',//'测试资料',
// 当前选择的安全检查内容
curSelectCheckContent: '测试内容',
curSelectCheckContent: '',//'测试内容',
// 发现问题
hdName: '测试问题',
hdName: '',//'测试问题',
// 隐患描述
hdDesc: "水电费双方都",
hdDesc: '',//"水电费双方都",
// 检查依据
basis: '测试依据',
basis: '',//'测试依据',
// 隐患整改建议
suggestion: '测试建议',
suggestion: '',//'测试建议',
// 隐患图片
// hdPic: null,
// 隐患整改日期
hdRectificationDate: '2024-03-08',
hdRectificationDate: '',//'2024-03-08',
// 隐患整改图片
// hdRectificationPic: null,
// 整改图片文件路径
......@@ -81,10 +81,23 @@ window.addEventListener("load", function() {
}
},
mounted() {
this.detail()
if(getParameter('type') === 'detail'){
this.editAble = false
this.detail()
}else if(getParameter('type') === 'edit'){
this.editAble = true
this.detail()
}else{ // 新增
this.editAble = true
this.resetData()
}
},
methods: {
resetData() {
// 使用 Object.assign 来重写 this.$data,以达到重置 data 的目的
Object.assign(this.$data, this.$options.data.call(this));
},
showPopup(popupType){
if(this.editAble){
this[popupType] = true
......@@ -183,16 +196,17 @@ window.addEventListener("load", function() {
vant.Toast({
message: '操作成功',
})
// this.secCheckTypeReplace = res.content || []
if(!this.form.hdId){ // 添加时则
location.reload()
}
})
},
formatDate(date) {
console.log(((date.getMonth()+1)>9?'':'0'))
return `${date.getFullYear() + 1}-${((date.getMonth()+1)>9?'':'0')+(date.getMonth() + 1)}-${(date.getDate()>9?'':'0')+date.getDate()} 00:00:00`;
formatDate(date, type) {
var ymd = `${date.getFullYear() + 1}-${((date.getMonth()+1)>9?'':'0')+(date.getMonth() + 1)}-${(date.getDate()>9?'':'0')+date.getDate()}`;
if(type === 'YYYY-MM-DD HH:MM:SS'){
return ymd +' 00:00:00';
}
return ymd
},
onConfirm4secType(value, index) {
console.log('value', value)
......@@ -287,7 +301,7 @@ window.addEventListener("load", function() {
confirm4hdInspectDate(value) {
console.log('value', value)
this.form.hdInspectDate = this.formatDate(new Date(value))
this.form.hdInspectDate = this.formatDate(new Date(value), 'YYYY-MM-DD HH:MM:SS')
this.showPopup4hdInspectDate = false
},
......
......@@ -24,10 +24,10 @@ window.addEventListener("load", function() {
// location.href='./yh-list.html'
},
add(){
location.href='./yh-list-detail.html?companyId='+getParameter('companyId')
location.href='./yh-list-detail.html?companyId='+getParameter('companyId')+'&type=add'
},
detail(item){
location.href='./yh-list-detail.html?companyId='+getParameter('companyId')+'&hdId='+item.hdId
location.href='./yh-list-detail.html?companyId='+getParameter('companyId')+'&hdId='+item.hdId+'&type=detail'
},
edit(item){
location.href='./yh-list-detail.html?companyId='+getParameter('companyId')+'&hdId='+item.hdId+'&type=edit'
......
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