Commit 6aebe402 authored by lei's avatar lei

add:图片预览问题

parent d686a609
......@@ -135,11 +135,12 @@
<van-cell>
<span class="">隐患图片:</span>
<div>
<ImagePreview
<img
v-for="(imgItem, subIndex) in item.hiddenImageUrlList"
:src="imgItem"
alt=""
style="width: 1.2rem; height: 1.2rem; margin-right: 0.2rem"
@click="showImage(item.hiddenImageUrlList,subIndex)"
/>
</div>
</van-cell>
......@@ -148,11 +149,12 @@
<van-cell
><span class="">整改情况:</span>
<div>
<ImagePreview
<img
v-for="(imgItem, subIndex) in item.rectificationImageUrlList"
:src="imgItem"
alt=""
style="width: 1.2rem; height: 1.2rem; margin-right: 0.2rem"
@click="showImage(item.rectificationImageUrlList,subIndex)"
/>
</div>
</van-cell>
......
......@@ -24,7 +24,7 @@
var VUE = null
window.onload = function() {
window.onload = function () {
function countSelectedNo(result) {
// 获取 checkList 中 selected 为 'no' 的对象个数
return result.reduce((total, category) => {
......@@ -46,9 +46,10 @@ window.onload = function() {
)
}, 0)
}
VUE = new Vue({
el: '#app',
components: {
},
data: {
userType: gemhoUtil.getCookie('userType'),
id: '', // 记录id || 隐患id
......@@ -102,7 +103,7 @@ window.onload = function() {
watch: {
checkData: {
handler(newVal) {
if(this.flag != 'ADD' && this.flag != 'JC_XQ'){
if (this.flag != 'ADD' && this.flag != 'JC_XQ') {
return
}
const snapshot = JSON.parse(JSON.stringify(newVal));
......@@ -115,21 +116,21 @@ window.onload = function() {
}
},
methods: {
validRequired(){
if(this.flag == 'JC_XQ'){ // 检查详情,不参与下一页校验
validRequired() {
if (this.flag == 'JC_XQ') { // 检查详情,不参与下一页校验
this.checkPageIndex++;
return true
}
const currentPageData = this.checkData[this.checkPageIndex];
const errorRows = currentPageData.gqCheckItemList.filter((item)=>{
const errorRows = currentPageData.gqCheckItemList.filter((item) => {
console.log(item)
if(item.itemAnswer === 2){
if (item.itemAnswer === 2) {
return !item.description || !item.photos?.length || !item.deadlineDays
}
return false
})
console.log('errorRows.length', errorRows.length)
if(errorRows.length){
if (errorRows.length) {
vant.Dialog.alert({
title: '信息提示',
message: '请填写完整信息,必填项不可为空',
......@@ -405,6 +406,13 @@ window.onload = function() {
// gemhoUtil.navigatePage(this.pageName + '.html', '操作完成,跳转中...')
// })
// },
showImage(list, index) {
vant.ImagePreview({
images: list,
startPosition: index,
closeable: true,
});
},
add4DSH_XQ(auditStatus) { // 隐患详情 审核通过或拒绝
vant.Toast.loading({
message: '正在处理...',
......
This diff is collapsed.
......@@ -50,22 +50,22 @@ window.addEventListener('load', function () {
}
], // 新增图片数组字段
},
dict4changhsuoType:[],
dict4fangwuType:[],
dict4fangwuyongtuType:[],
dict4businessType:[],
dict4community:[],
dict4industryType:[],
consumerSuggestList:[]
dict4changhsuoType: [],
dict4fangwuType: [],
dict4fangwuyongtuType: [],
dict4businessType: [],
dict4community: [],
dict4industryType: [],
consumerSuggestList: []
}
},
computed: {},
mounted() {
// 详情编辑权限控制
const userType = gemhoUtil.getCookie('userType')
if(userType !== 'wgy'){
if (userType !== 'wgy') {
this.flag = 'XG'
}else{
} else {
this.flag = 'XQ'
}
......@@ -92,13 +92,20 @@ window.addEventListener('load', function () {
this.getConsumerSuggestList() // 获取检查列表
}
},
getConsumerSuggestList(){
showImage(list, index) {
vant.ImagePreview({
images: list,
startPosition: index,
closeable: true,
});
},
getConsumerSuggestList() {
http2.post({
serviceId: API_KEY_MAP["page"]['id'],
interfacePublicKey: API_KEY_MAP["page"]["publicKey"],
interfacePrivateKey: API_KEY_MAP["page"]["privateKey"],
reqParams: {
page:1,
page: 1,
size: 9999,
sign: 18, // 消费者建议列表
"merId": gemhoUtil.getParameter('merId'),
......@@ -124,13 +131,13 @@ window.addEventListener('load', function () {
}
})
},
getDict4changhsuoType(param){
getDict4changhsuoType(param) {
http2.post({
serviceId: API_KEY_MAP["page"]['id'],
interfacePublicKey: API_KEY_MAP["page"]["publicKey"],
interfacePrivateKey: API_KEY_MAP["page"]["privateKey"],
reqParams: {
page:1,
page: 1,
size: 9999,
sign: 21, // 场所类型=>行业类别
...param
......@@ -156,20 +163,20 @@ window.addEventListener('load', function () {
}
})
},
handleIndustryChange(val){
handleIndustryChange(val) {
// 选择后晴空下级下拉框值
this.dict4changhsuoType = []
this.getDict4changhsuoType({
industryId: this.formData.industryType
})
},
getDict4industryType(){
getDict4industryType() {
http2.post({
serviceId: API_KEY_MAP["page"]['id'],
interfacePublicKey: API_KEY_MAP["page"]["publicKey"],
interfacePrivateKey: API_KEY_MAP["page"]["privateKey"],
reqParams: {
page:1,
page: 1,
size: 9999,
sign: 20, // 行业类型列表
}
......@@ -194,13 +201,13 @@ window.addEventListener('load', function () {
}
})
},
getDict4community(){
getDict4community() {
http2.post({
serviceId: API_KEY_MAP["page"]['id'],
interfacePublicKey: API_KEY_MAP["page"]["publicKey"],
interfacePrivateKey: API_KEY_MAP["page"]["privateKey"],
reqParams: {
page:1,
page: 1,
size: 9999,
sign: 22,
"merId": gemhoUtil.getParameter('merId'),
......@@ -226,13 +233,13 @@ window.addEventListener('load', function () {
}
})
},
getDict4businessType(){
getDict4businessType() {
http2.post({
serviceId: API_KEY_MAP["page"]['id'],
interfacePublicKey: API_KEY_MAP["page"]["publicKey"],
interfacePrivateKey: API_KEY_MAP["page"]["privateKey"],
reqParams: {
page:1,
page: 1,
size: 9999,
sign: 15,
dictType: 'business_type'
......@@ -259,13 +266,13 @@ window.addEventListener('load', function () {
})
},
getDict4fangwuType(){
getDict4fangwuType() {
http2.post({
serviceId: API_KEY_MAP["page"]['id'],
interfacePublicKey: API_KEY_MAP["page"]["publicKey"],
interfacePrivateKey: API_KEY_MAP["page"]["privateKey"],
reqParams: {
page:1,
page: 1,
size: 9999,
sign: 15,
dictType: 'house_type'
......@@ -291,13 +298,13 @@ window.addEventListener('load', function () {
}
})
},
getDict4fangwuyongtuType(){
getDict4fangwuyongtuType() {
http2.post({
serviceId: API_KEY_MAP["page"]['id'],
interfacePublicKey: API_KEY_MAP["page"]["publicKey"],
interfacePrivateKey: API_KEY_MAP["page"]["privateKey"],
reqParams: {
page:1,
page: 1,
size: 9999,
sign: 15,
dictType: 'house_usage'
......@@ -323,40 +330,40 @@ window.addEventListener('load', function () {
}
})
},
save(){
save() {
vant.Toast.loading({
message: '正在处理...',
forbidClick: true,
loadingType: 'spinner',
});
var reqParam = {...this.formData} // var url = "/gq/checkRecord/safeCheckRecord"
var reqParam = { ...this.formData } // var url = "/gq/checkRecord/safeCheckRecord"
if(!reqParam.unitName){
if (!reqParam.unitName) {
vant.Toast({
message: '商家名称不能为空',
})
return
}
if(!reqParam.area){
if (!reqParam.area) {
vant.Toast({
message: '建筑面积不能为空',
})
return
}
if(!reqParam.merchantName){
if (!reqParam.merchantName) {
vant.Toast({
message: '负责人不能为空',
})
return
}
if(!reqParam.community){
if (!reqParam.community) {
vant.Toast({
message: '所属社区不能为空',
})
return
}
if(!reqParam.industryType){
if (!reqParam.industryType) {
vant.Toast({
message: '行业类型不能为空',
})
......
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