Commit c6707226 authored by lei's avatar lei

Merge branch 'gaoqucodecheck' of...

Merge branch 'gaoqucodecheck' of http://h.gemho.cn:7099/zhaojunbao/gaoquyingjih5-asd into gaoqucodecheck
parents 7687117a 6a475d02
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<!-- 第二层:商户图标、名称、等级、场所类型和地址 --> <!-- 第二层:商户图标、名称、等级、场所类型和地址 -->
<div <div
class="second-layer second-layer-zf" class="second-layer second-layer-zf"
v-if="userInfo.userType!=='shop'" v-if="userInfo.userType!=='sj'"
> >
<img <img
class="merchant-icon" class="merchant-icon"
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<!-- 第二层:商户图标、名称、等级、场所类型和地址 --> <!-- 第二层:商户图标、名称、等级、场所类型和地址 -->
<div <div
class="second-layer-sj" class="second-layer-sj"
v-if="userInfo.userType=='shop'" v-if="userInfo.userType=='sj'"
> >
<div class="header"> <div class="header">
<span>商家信息</span> <span>商家信息</span>
......
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) => {
...@@ -52,38 +52,168 @@ window.onload = function () { ...@@ -52,38 +52,168 @@ window.onload = function () {
* pageName: 页面名称(用于记录页面来源,用于操作后返回上一页) * pageName: 页面名称(用于记录页面来源,用于操作后返回上一页)
* *
*/ */
// this.flag = gemhoUtil.getParameter('type') // if (type === 'YH_XQ') { // 隐患详情
// this.id = gemhoUtil.getParameter('id') // this.getDetail4YH_XQ()
// this.pageName = gemhoUtil.getParameter('pageName') // } else if (this.flag === 'ZG_XQ') { // 整改详情
// // 表单数据 // this.getDetail4YH_XQ()
// this.checkData = result.data // } else if (this.flag === 'JC_XQ') { // 检查详情
// this.getDetail4JC_XQ()
// } else if (this.flag === 'ADD') { // 新增,调用模板详情方法
this.getDetail4Template()
// } // }
// }
// )
}, },
getDetail4JC_XQ() { watch: {
// 检查单详情 checkData: {
handler(newVal) {
const snapshot = JSON.parse(JSON.stringify(newVal));
console.log('全量变化:', snapshot);
this.noCount = countSelectedNo(newVal); // selected=no 的个数
// this.totalItems = getTotalCheckListItems(newVal); // checkList 子元素总数
this.notNullCount = countSelectedNotNull(newVal); // selected 不为 null 的个数
},
deep: true
}
},
methods: {
getOriginMatchedItemById(id) {
const result = this.originCheckData[this.checkPageIndex]['gqCheckItemVoList'].find(item =>
item.id === id) || []
return JSON.parse(JSON.stringify(result))
},
// 处理单选变化
handleSelectionChange(val, item, index) {
console.log(val, item, '数据改变了前')
const newItem = this.getOriginMatchedItemById(item.id)
console.log(val, newItem, '数据改变了。。。。newItem')
newItem.itemAnswer = val
// console.log(this.checkData[this.checkPageIndex]['gqCheckItemVoList'])
this.$set(this.checkData[this.checkPageIndex]['gqCheckItemVoList'], index, JSON.parse(JSON
.stringify()));
console.log(val, this.checkData[this.checkPageIndex]['gqCheckItemVoList'][index], '数据改变了后',
index)
},
// 文件上传处理
handleFileUpload(file) {
console.log('上传文件:', file);
// 此处可添加实际文件上传逻辑
},
// 整改天数确认
handleDeadlineConfirm(event, item) {
console.log('select选择', event.target.value)
const value = event.target.value;
if (value) {
const days = parseInt(value);
item.deadlineDays = days;
const deadlineDate = new Date();
deadlineDate.setDate(deadlineDate.getDate() + days);
item.deadlineDate = this.formatDate(deadlineDate);
}
// this.showDeadlinePicker = false;
},
// 日期格式化
formatDate(date) {
return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}`;
},
getDetail4Template() { // 安全检查模板初始化
vant.Toast.loading({ vant.Toast.loading({
message: '正在加载...', message: '正在加载...',
forbidClick: true, forbidClick: true,
loadingType: 'spinner', loadingType: 'spinner',
});
http2.post({
serviceId: API_KEY_MAP["no-page"]['id'],
interfacePublicKey: API_KEY_MAP["no-page"]["publicKey"],
interfacePrivateKey: API_KEY_MAP["no-page"]["privateKey"],
reqParams: {}
}, (res) => {
if (!res) { // 中台返回为undefined 重新请求
vant.Toast.clear()
setTimeout(() => {
// this.getDetail4Template()
}, 0);
return
}
if (res) {
console.log('接口回调数据', JSON.parse(res))
setTimeout(() => {
this.$nextTick(() => {
vant.Toast.clear()
}) })
http2.post( }, 0);
{ var result = JSON.parse(res)
serviceId: API_KEY_MAP['no-page']['id'], this.checkDate = result.checkDate // 检查日期
interfacePublicKey: API_KEY_MAP['no-page']['publicKey'], this.checkPeopleName = result.checkPeopleName // 检查人员
interfacePrivateKey: API_KEY_MAP['no-page']['privateKey'], this.rectificationDeadline = result.rectificationDeadline // 整改截止日期
reqParams: { this.reviewDate = result.reviewDate // 隐患审核日期
recordId: '1', this.reviewRecord = result.reviewRecord
this.totalItems = result.itemAllCount,
// 表单数据
this.checkData = JSON.parse(JSON.stringify(result.data))
this.originCheckData = JSON.parse(JSON.stringify(result.data))
}
})
}, },
getDetail4YH_XQ() { // 隐患详情
vant.Toast.loading({
message: '正在加载...',
forbidClick: true,
loadingType: 'spinner',
});
http2.post({
serviceId: API_KEY_MAP["no-page"]['id'],
interfacePublicKey: API_KEY_MAP["no-page"]["publicKey"],
interfacePrivateKey: API_KEY_MAP["no-page"]["privateKey"],
reqParams: {
"hdId": "1",
}
}, (res) => {
if (!res) { // 中台返回为undefined 重新请求
vant.Toast.clear()
setTimeout(() => {
this.getDetail4YH_XQ()
}, 0);
return
}
if (res) {
console.log('接口回调数据', JSON.parse(res))
setTimeout(() => {
this.$nextTick(() => {
vant.Toast.clear()
})
}, 0);
var result = JSON.parse(res)
this.checkDate = result.checkDate // 检查日期
this.checkPeopleName = result.checkPeopleName // 检查人员
this.rectificationDeadline = result.rectificationDeadline // 整改截止日期
this.reviewDate = result.reviewDate // 隐患审核日期
this.reviewRecord = result.reviewRecord
// 表单数据
this.checkData = result.data
}
})
}, },
(res) => { getDetail4JC_XQ() { // 检查单详情
if (!res) { vant.Toast.loading({
// 中台返回为undefined 重新请求 message: '正在加载...',
forbidClick: true,
loadingType: 'spinner',
});
http2.post({
serviceId: API_KEY_MAP["no-page"]['id'],
interfacePublicKey: API_KEY_MAP["no-page"]["publicKey"],
interfacePrivateKey: API_KEY_MAP["no-page"]["privateKey"],
reqParams: {
"recordId": "1",
}
}, (res) => {
if (!res) { // 中台返回为undefined 重新请求
vant.Toast.clear() vant.Toast.clear()
setTimeout(() => { setTimeout(() => {
this.getDetail4YH_XQ() this.getDetail4YH_XQ()
}, 0) }, 0);
return return
} }
if (res) { if (res) {
...@@ -92,7 +222,7 @@ window.onload = function () { ...@@ -92,7 +222,7 @@ window.onload = function () {
this.$nextTick(() => { this.$nextTick(() => {
vant.Toast.clear() vant.Toast.clear()
}) })
}, 0) }, 0);
var result = JSON.parse(res) var result = JSON.parse(res)
this.checkDate = result.data.checkTime // 检查日期 this.checkDate = result.data.checkTime // 检查日期
this.checkPeopleName = result.data.checkPeopleName // 检查人员 this.checkPeopleName = result.data.checkPeopleName // 检查人员
...@@ -101,38 +231,35 @@ window.onload = function () { ...@@ -101,38 +231,35 @@ window.onload = function () {
this.notNullCount = result.data.notRectifiedCount this.notNullCount = result.data.notRectifiedCount
this.totalItems = result.itemAllCount this.totalItems = result.itemAllCount
} }
} })
)
}, },
add4ZG_XQ() { add4ZG_XQ() {
if (!this.checkData.photos.length) { if (!this.checkData.photos.length) {
vant.Dialog.alert({ vant.Dialog.alert({
message: '请上传整改图片', message: '请上传整改图片',
}) })
return return;
} }
vant.Toast.loading({ vant.Toast.loading({
message: '正在处理...', message: '正在处理...',
forbidClick: true, forbidClick: true,
loadingType: 'spinner', loadingType: 'spinner',
}) });
http2.post( http2.post({
{ serviceId: API_KEY_MAP["no-page"]['id'],
serviceId: API_KEY_MAP['no-page']['id'], interfacePublicKey: API_KEY_MAP["no-page"]["publicKey"],
interfacePublicKey: API_KEY_MAP['no-page']['publicKey'], interfacePrivateKey: API_KEY_MAP["no-page"]["privateKey"],
interfacePrivateKey: API_KEY_MAP['no-page']['privateKey'],
reqParams: { reqParams: {
hdId: this.id, "hdId": this.id,
photos: this.checkData, "photos": this.checkData,
}, }
}, }, (res, type) => {
(res, type) => { if (!res && !type) { // 如果是中台接口返回为undefined,则重新发起请求
if (!res && !type) {
// 如果是中台接口返回为undefined,则重新发起请求
vant.Toast.clear() vant.Toast.clear()
setTimeout(() => { setTimeout(() => {
this.add4ZG_XQ() this.add4ZG_XQ()
}, 0) }, 0);
return return
} }
if (res) { if (res) {
...@@ -141,38 +268,30 @@ window.onload = function () { ...@@ -141,38 +268,30 @@ window.onload = function () {
message: '操作成功', message: '操作成功',
}) })
// history.back() // history.back()
gemhoUtil.navigatePage( gemhoUtil.navigatePage(this.pageName + '.html', '操作完成,跳转中...')
this.pageName + '.html',
'操作完成,跳转中...'
)
}
} }
) })
}, },
add4YH_XQ(auditStatus) { add4YH_XQ(auditStatus) { // 隐患详情 审核通过或拒绝
// 隐患详情 审核通过或拒绝
vant.Toast.loading({ vant.Toast.loading({
message: '正在处理...', message: '正在处理...',
forbidClick: true, forbidClick: true,
loadingType: 'spinner', loadingType: 'spinner',
}) });
http2.post( http2.post({
{ serviceId: API_KEY_MAP["no-page"]['id'],
serviceId: API_KEY_MAP['no-page']['id'], interfacePublicKey: API_KEY_MAP["no-page"]["publicKey"],
interfacePublicKey: API_KEY_MAP['no-page']['publicKey'], interfacePrivateKey: API_KEY_MAP["no-page"]["privateKey"],
interfacePrivateKey: API_KEY_MAP['no-page']['privateKey'],
reqParams: { reqParams: {
hdId: this.id, "hdId": this.id,
auditStatus, auditStatus
}, }
}, }, (res, type) => {
(res, type) => { if (!res && !type) { // 如果是中台接口返回为undefined,则重新发起请求
if (!res && !type) {
// 如果是中台接口返回为undefined,则重新发起请求
vant.Toast.clear() vant.Toast.clear()
setTimeout(() => { setTimeout(() => {
this.add4YH_XQ() this.add4YH_XQ()
}, 0) }, 0);
return return
} }
if (res) { if (res) {
...@@ -181,20 +300,16 @@ window.onload = function () { ...@@ -181,20 +300,16 @@ window.onload = function () {
message: '操作成功', message: '操作成功',
}) })
// history.back() // history.back()
gemhoUtil.navigatePage( gemhoUtil.navigatePage(this.pageName + '.html', '操作完成,跳转中...')
this.pageName + '.html',
'操作完成,跳转中...'
)
}
} }
) })
}, },
add4JC_XQ() { add4JC_XQ() {
var reqParam = { var reqParam = {
merId: '1', "merId": "1",
gqCheckTypeVoList: this.checkData, "gqCheckTypeVoList": this.checkData
} }
var url = '/gq/checkRecord/safeCheckRecord' var url = "/gq/checkRecord/safeCheckRecord"
http.post(url, reqParam).then((res) => { http.post(url, reqParam).then((res) => {
console.log('添加结果', res) console.log('添加结果', res)
...@@ -203,7 +318,7 @@ window.onload = function () { ...@@ -203,7 +318,7 @@ window.onload = function () {
}) })
gemhoUtil.navigatePage(this.pageName + '.html', '操作完成,跳转中...') gemhoUtil.navigatePage(this.pageName + '.html', '操作完成,跳转中...')
}) })
}, }
// }, }
}) });
} }
\ No newline at end of file
...@@ -52,16 +52,52 @@ window.addEventListener('load', function () { ...@@ -52,16 +52,52 @@ window.addEventListener('load', function () {
}, },
computed: {}, computed: {},
mounted() { mounted() {
this.detail() this.detail()
}, },
methods: { methods: {
detail(id) { detail(id) {
vant.Toast.loading({
message: '正在加载...',
forbidClick: true,
loadingType: 'spinner',
});
http2.post({
serviceId: API_KEY_MAP["no-page"]['id'],
interfacePublicKey: API_KEY_MAP["no-page"]["publicKey"],
interfacePrivateKey: API_KEY_MAP["no-page"]["privateKey"],
reqParams: {
"merId": gemhoUtil.getParameter('id'),
}
}, (res) => {
if (!res) { // 中台返回为undefined 重新请求
vant.Toast.clear()
setTimeout(() => {
this.detail()
}, 0);
return
}
if (res) {
console.log('接口回调数据', JSON.parse(res))
setTimeout(() => {
this.$nextTick(() => {
vant.Toast.clear()
})
}, 0);
var result = JSON.parse(res)
this.formData = result.data
console.log('查看详情:', id) console.log('查看详情:', id)
// this.formData = {} // 表单赋值 // this.formData = {} // 表单赋值
// 这里添加跳转逻辑 // 这里添加跳转逻辑
const QR_IMAGE_URL = const QR_IM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bhijrYabGTXH7oxdGq2zIbGvKb/2aDGuGidqJzCKNQ5NSiyZsumEO+XnsAHYU16AXFs9e5PjFBjV+CU0M9cJUww6qVZctnnRy0AwjTWaygqKIRgrt0Nw+LNUBk9s31KEDVVDUGsBO4dIGU9usEOUmOYrRECOXlk9D2m91tg9LtcDUBpzMtnLFaad1Z4FR8Vi0UUU7j6p6ZNGkQies+heXKlbF/gX2tIh+0ShjCt9hT7Eb6h8GxrR72POx56u5EWOPBy1/iUFNCt9KbCownESdwCYKmxHm1LRtzs8yPw/J9wEUz7sjcBLLuSuWX+h6sQrJCNvTe2y+j83Wwn4YhGfNHGscms5dLeeXOy9swZ7vm+pf4sKQKkG6kG11Wc+qeSIHtfmN9r0JFv2o9+SUe2sp7ZiN1mT5TbYFDkAh6STqO/I/mhdfjljR20xITiynvQJYNevGXC1hn9ze+nn76JdEjN27c9mbLKYzLYfcPo4l3dH7q+Y3d4BjlnGuN35brt9rLxrZlrOpSwX82Oamx1auZRJ1x+dT/sKRGMsc7K09s8QyrR3D+VYs9jRcv7nyfSpnLfrDcx8SA57CblxkmZEmli10dPlDWOzuHoUmfJCbtfxXwezn+G2nV8udYT/LjhtJ30fYY9v2INwdb2hIFjZvr8TYjFiwNfDcIQ/XEGpITB+5M8gNu/Da9/5zt/wJ5zVLxjs6WyMAAAAASUVORK5CYII='
this.generateQRCode(QR_IMAGE_URL) this.generateQRCode(QR_IMAGE_URL)
}
})
}, },
// 新增选择确认方法 // 新增选择确认方法
onConfirmType(value) { onConfirmType(value) {
......
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