Commit 6aebe402 authored by lei's avatar lei

add:图片预览问题

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