Commit c28219ee authored by xinzhedeai's avatar xinzhedeai

详情页面

parent 597da313
...@@ -48,7 +48,7 @@ var userInfo = { ...@@ -48,7 +48,7 @@ var userInfo = {
} }
var token = var token =
"Bearer eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiI5MzYzZTcwYTUzNzU0ODkxYTQ2YWJjMGI2ZmYxNGY4OCIsInVzZXIiOiJhZG1pbiIsInN1YiI6ImFkbWluIn0._QR-As4S1_XI3AFKDukHwJpYuOkeAW76nNGrVrhF3lJMijAuWdjriVeYBDuHVN8MsIeIi7wVn9Di4wPKvJJXDg"; "Bearer eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiJjNDdlMTA3MGZjZDc0MDdmOTBlNWViN2Y0M2ZkNmQ2MSIsInVzZXIiOiJhZG1pbiIsInN1YiI6ImFkbWluIn0.ABEEx0r9KFg2aZNk9IwdV37z4wy7PyLK8l0lpoAMiaA_ct3bCUMVqu9TPBOXY5Dmzv3C2UxC3oXF9w9Vc_DHRA";
localStorage.setItem('Authorization', token) localStorage.setItem('Authorization', token)
localStorage.setItem('appCounty', userInfo.user.county) localStorage.setItem('appCounty', userInfo.user.county)
......
...@@ -38,23 +38,28 @@ ...@@ -38,23 +38,28 @@
.van-cell__value{overflow: unset; } .van-cell__value{overflow: unset; }
.van-cell:after{border-bottom:none;} .van-cell:after{border-bottom:none;}
.van-radio-group--horizontal{float: right;} .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> </style>
</head> </head>
<body> <body>
<div id="app"> <div id="app">
<div class="content" v-cloak> <div class="content" v-cloak :class="{'disable-van-cell': !editAble}">
<van-cell-group> <van-cell-group>
<van-cell is-link @click="showPopup4hdInspectDate=true">检查日期<span class="formValue">{{form.hdInspectDate}}</span></van-cell> <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-popup v-model="showPopup4hdInspectDate" position="bottom" :style="{ height: '30%' }">
<van-datetime-picker v-model="hdInspectDateModel" type="date" title="选择年月日" @confirm="confirm4hdInspectDate" @cancel="showPopup4hdInspectDate=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="form.hdInspectExpert" label="检查人员" placeholder="" /> <van-field v-model="form.hdInspectExpert" :disabled="!editAble" label="检查人员" placeholder="" />
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-cell>隐患类型: <van-cell>隐患类型:
<van-radio-group v-model="form.hdLevel" direction="horizontal"> <van-radio-group v-model="form.hdLevel" :disabled="!editAble" 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,40 +67,40 @@ ...@@ -62,40 +67,40 @@
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-cell is-link @click="showPopup4secType=true">安全类别:<span class="formValue">{{form.curSelectSecType}}</span></van-cell> <van-cell is-link @click="showPopup('showPopup4secType')" >安全类别:<span class="formValue">{{form.curSelectSecType}}</span></van-cell>
<van-popup v-model="showPopup4secType" round position="bottom"> <van-popup v-model="showPopup4secType" round position="bottom">
<van-picker show-toolbar :columns="secType" value-key="name" @cancel="showPopup4secType = false" @confirm="onConfirm4secType" /> <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="showPopup4secCheckTypeReplace=true">安全检查类别:<span class="formValue">{{form.curSelectSecCheckTypeReplace}}</span></van-cell> <van-cell is-link @click="showPopup('showPopup4secCheckTypeReplace')" >安全检查类别:<span class="formValue">{{form.curSelectSecCheckTypeReplace}}</span></van-cell>
<van-popup v-model="showPopup4secCheckTypeReplace" round position="bottom"> <van-popup v-model="showPopup4secCheckTypeReplace" round position="bottom">
<van-picker show-toolbar :columns="secCheckTypeReplace" value-key="name" @cancel="showPopup4secCheckTypeReplace = false" @confirm="onConfirm4secCheckTypeReplace" /> <van-picker show-toolbar :columns="secCheckTypeReplace" value-key="name" @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="showPopup4secCheckContent=true">安全检查内容:<span class="formValue">{{form.curSelectCheckContent}}</span></van-cell> <van-cell is-link @click="showPopup('showPopup4secCheckContent')" >安全检查内容:<span class="formValue">{{form.curSelectCheckContent}}</span></van-cell>
<van-popup v-model="showPopup4secCheckContent" round position="bottom"> <van-popup v-model="showPopup4secCheckContent" round position="bottom">
<van-picker show-toolbar :columns="secCheckContent" value-key="name" @cancel="showPopup4secCheckContent = false" @confirm="onConfirm4secCheckContent" /> <van-picker show-toolbar :columns="secCheckContent" value-key="name" @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="showPopup4secCheckDiscover=true">发现问题:<span class="formValue">{{form.hdName}}</span></van-cell> <van-cell is-link @click="showPopup('showPopup4secCheckDiscover')" >发现问题:<span class="formValue">{{form.hdName}}</span></van-cell>
<van-popup v-model="showPopup4secCheckDiscover" round position="bottom"> <van-popup v-model="showPopup4secCheckDiscover" round position="bottom">
<van-picker show-toolbar :columns="secCheckDiscover" value-key="name" @cancel="showPopup4secCheckDiscover = false" @confirm="onConfirm4secCheckDiscover" /> <van-picker show-toolbar :columns="secCheckDiscover" value-key="name" @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="form.hdDesc" label="隐患描述" placeholder="" /> <van-field v-model="form.hdDesc" :disabled="!editAble" label="隐患描述" placeholder="" />
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-field v-model="form.basis" label="检查依据" placeholder="" /> <van-field v-model="form.basis" :disabled="!editAble" label="检查依据" placeholder="" />
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-field v-model="form.suggestion" label="整改建议" placeholder="" /> <van-field v-model="form.suggestion" :disabled="!editAble" label="整改建议" placeholder="" />
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-cell is-link @click="showPopup4hdRectificationDate=true">整改期限<span class="formValue">{{form.hdRectificationDate}}</span></van-cell> <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: '30%' }">
<van-datetime-picker v-model="hdRectificationDateModel" type="date" title="选择年月日" @confirm="confirm4hdRectificationDate" @cancel="showPopup4hdRectificationDate=false" /> <van-datetime-picker v-model="hdRectificationDateModel" type="date" title="选择年月日" @confirm="confirm4hdRectificationDate" @cancel="showPopup4hdRectificationDate=false" />
...@@ -104,19 +109,20 @@ ...@@ -104,19 +109,20 @@
<van-cell-group> <van-cell-group>
<van-cell>隐患照片: <van-cell>隐患照片:
<div style="width: 1.5rem;"> <div style="width: 2.5rem;">
<van-uploader v-model="fileList" :max-count="1" /> <van-uploader v-model="fileList" :max-count="1" :deletable="editAble" >
<!-- <van-button icon="plus" type="info" size="small">上传文件</van-button> -->
</van-uploader>
</div></van-cell> </div></van-cell>
</van-cell-group> </van-cell-group>
<van-cell-group> <van-cell-group>
<van-cell>整改照片: <van-cell>整改照片:
<div style="width: 1.5rem;"> <div style="width: 2.5rem;">
<van-image <van-image
width="100" width="100"
height="100" height="100"
src="https://img01.yzcdn.cn/vant/cat.jpeg" :src="'data:image/jpg;base64,' + form.hdRectificationPic"
/> />
</div></van-cell> </div></van-cell>
...@@ -134,7 +140,7 @@ ...@@ -134,7 +140,7 @@
</div> </div>
<div class="formSubmitBtnWrapper"><van-button type="info" size="small" @click="submit">提交</van-button></div> <div class="formSubmitBtnWrapper" v-if="editAble"><van-button type="info" size="small" @click="submit">提交</van-button></div>
</div> </div>
</div> </div>
......
...@@ -85,6 +85,11 @@ window.addEventListener("load", function() { ...@@ -85,6 +85,11 @@ window.addEventListener("load", function() {
}, },
methods: { methods: {
showPopup(popupType){
if(this.editAble){
this[popupType] = true
}
},
detail(){ detail(){
var hdId = getParameter('companyId') var hdId = getParameter('companyId')
http.get('/api/thHiddenDanger',{ http.get('/api/thHiddenDanger',{
...@@ -102,6 +107,10 @@ window.addEventListener("load", function() { ...@@ -102,6 +107,10 @@ window.addEventListener("load", function() {
this.form.curSelectSecCheckTypeReplace = this.form.category // 安全检查类别 this.form.curSelectSecCheckTypeReplace = this.form.category // 安全检查类别
this.form.curSelectCheckContent = this.form.inspectionContent // 安全检查内容 this.form.curSelectCheckContent = this.form.inspectionContent // 安全检查内容
this.form.hdName = this.form.hdName // 安全发现问题 this.form.hdName = this.form.hdName // 安全发现问题
// 详情图片设置
this.fileList.push({
content: 'data:image/jpg;base64,' + this.form.hdPic
})
}) })
}, },
submit() { submit() {
...@@ -149,13 +158,9 @@ window.addEventListener("load", function() { ...@@ -149,13 +158,9 @@ window.addEventListener("load", function() {
formData.append('companyId', getParameter('companyId')) formData.append('companyId', getParameter('companyId'))
// delete formData.hdPic formData.delete('hdPic');
// delete formData.hdRectificationPic formData.delete('hdRectificationPic');
// delete formData.imgsrcurl formData.delete('recDeadLine');
// delete formData.imgrecturl
// delete formData.hdFilePath
// delete formData.rectFilePath
// delete formData.hdInspectDate
if (!this.form.comment) { if (!this.form.comment) {
delete formData.comment delete formData.comment
...@@ -167,7 +172,9 @@ window.addEventListener("load", function() { ...@@ -167,7 +172,9 @@ window.addEventListener("load", function() {
delete formData.hdRectificationDate delete formData.hdRectificationDate
} }
if(this.fileList[0].file){ // 只有file存在的时候,证明新改过的图片,需要传参更新,否则不更新(回显的时候filelist只有content属性有值)
formData.append('hdPic', this.fileList[0].file ) formData.append('hdPic', this.fileList[0].file )
}
var url = this.form.hdId ? "/api/thHiddenDanger/update" : "/api/thHiddenDanger" var url = this.form.hdId ? "/api/thHiddenDanger/update" : "/api/thHiddenDanger"
......
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