Commit cd142201 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 c280e929 efb82cad
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
<van-cell><span class="title_require">请上传隐患图片:</span><span <van-cell><span class="title_require">请上传隐患图片:</span><span
style="color: red;">(格式png/jpg/jpeg,最多4张)</span> style="color: red;">(格式png/jpg/jpeg,最多4张)</span>
<div> <div>
<van-uploader v-model="item.rectificationImageUrlList" <van-uploader v-model="item.photos"
:max-count="4" :after-read="handleFileUpload" class="uploader-wrapper" /> :max-count="4" :after-read="handleFileUpload" class="uploader-wrapper" />
</div> </div>
</van-cell> </van-cell>
...@@ -89,19 +89,13 @@ ...@@ -89,19 +89,13 @@
<van-cell v-if="flag==='JC_XQ' || flag==='YH_XQ' || flag==='ZG_XQ' "> <van-cell v-if="flag==='JC_XQ' || flag==='YH_XQ' || flag==='ZG_XQ' ">
<span class="">隐患图片:</span> <span class="">隐患图片:</span>
<div> <div>
<img src="https://dummyimage.com/90x90 " alt="" srcset="" /> <img v-for="(imgItem, subIndex) in item.hiddenImageUrlList" :src="imgItem" alt="" style="width:1.2rem;height:1.2rem;margin-right:.2rem;" />
<img src="https://dummyimage.com/90x90 " alt="" srcset="" />
<img src="https://dummyimage.com/90x90 " alt="" srcset="" />
<img src="https://dummyimage.com/90x90 " alt="" srcset="" />
</div> </div>
</van-cell> </van-cell>
<van-cell v-if="flag==='JC_XQ' || flag==='YH_XQ'"><span class="">整改情况:</span> <van-cell v-if="flag==='JC_XQ' || flag==='YH_XQ'"><span class="">整改情况:</span>
<div> <div>
<img src="https://dummyimage.com/90x90 " alt="" srcset="" /> <img v-for="(imgItem, subIndex) in item.rectificationImageUrlList" :src="imgItem" alt="" style="width:1.2rem;height:1.2rem;margin-right:.2rem;" />
<img src="https://dummyimage.com/90x90 " alt="" srcset="" />
<img src="https://dummyimage.com/90x90 " alt="" srcset="" />
<img src="https://dummyimage.com/90x90 " alt="" srcset="" />
</div> </div>
</van-cell> </van-cell>
</van-cell-group> </van-cell-group>
......
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 VUE.originCheckData.reduce((total, category) => {
return ( return (
total + total +
category.gqCheckItemVoList.filter((item) => item.itemAnswer === 2) category.gqCheckItemVoList.filter((item) => item.itemAnswer === 2)
...@@ -12,7 +13,7 @@ window.onload = function() { ...@@ -12,7 +13,7 @@ window.onload = function() {
function countSelectedNotNull(result) { function countSelectedNotNull(result) {
// 获取 checkList 中 selected 不为 null 的个数 // 获取 checkList 中 selected 不为 null 的个数
return result.reduce((total, category) => { return VUE.originCheckData.reduce((total, category) => {
return ( return (
total + total +
category.gqCheckItemVoList.filter((item) => item.itemAnswer !== 0) category.gqCheckItemVoList.filter((item) => item.itemAnswer !== 0)
...@@ -21,7 +22,7 @@ window.onload = function() { ...@@ -21,7 +22,7 @@ window.onload = function() {
}, 0) }, 0)
} }
new Vue({ VUE = new Vue({
el: '#app', el: '#app',
data: { data: {
id: '', // 记录id || 隐患id id: '', // 记录id || 隐患id
...@@ -52,15 +53,18 @@ window.onload = function() { ...@@ -52,15 +53,18 @@ window.onload = function() {
* pageName: 页面名称(用于记录页面来源,用于操作后返回上一页) * pageName: 页面名称(用于记录页面来源,用于操作后返回上一页)
* *
*/ */
// if (type === 'YH_XQ') { // 隐患详情 this.flag = 'JC_XQ'
// this.getDetail4YH_XQ() // this.flag = 'ADD'
// } else if (this.flag === 'ZG_XQ') { // 整改详情 if (this.flag === 'YH_XQ') { // 隐患详情
// this.getDetail4YH_XQ() this.getDetail4YH_XQ()
// } else if (this.flag === 'JC_XQ') { // 检查详情 } else if (this.flag === 'ZG_XQ') { // 整改详情
// this.getDetail4JC_XQ() this.getDetail4YH_XQ()
// } else if (this.flag === 'ADD') { // 新增,调用模板详情方法 } else if (this.flag === 'JC_XQ') { // 检查详情
this.getDetail4Template() this.getDetail4JC_XQ()
// }
} else if (this.flag === 'ADD') { // 新增,调用模板详情方法
this.getDetail4Template()
}
}, },
watch: { watch: {
checkData: { checkData: {
...@@ -120,12 +124,13 @@ window.onload = function() { ...@@ -120,12 +124,13 @@ window.onload = function() {
forbidClick: true, forbidClick: true,
loadingType: 'spinner', loadingType: 'spinner',
}); });
http2.post({ http2.get('/gq/asd/list', {
serviceId: API_KEY_MAP["no-page"]['id'], sign: 5,
interfacePublicKey: API_KEY_MAP["no-page"]["publicKey"],
interfacePrivateKey: API_KEY_MAP["no-page"]["privateKey"],
reqParams: {}
}, (res) => { }, (res) => {
}).then((res) => {
console.log('接口回调数据1111template', res)
if (!res) { // 中台返回为undefined 重新请求 if (!res) { // 中台返回为undefined 重新请求
vant.Toast.clear() vant.Toast.clear()
setTimeout(() => { setTimeout(() => {
...@@ -134,24 +139,25 @@ window.onload = function() { ...@@ -134,24 +139,25 @@ window.onload = function() {
return return
} }
if (res) { if (res) {
console.log('接口回调数据', JSON.parse(res)) // console.log('接口回调数据', JSON.parse(res))
setTimeout(() => { setTimeout(() => {
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.checkDate // 检查日期 var result = res
this.checkPeopleName = result.checkPeopleName // 检查人员 this.checkDate = result.data.checkDate // 检查日期
this.rectificationDeadline = result.rectificationDeadline // 整改截止日期 this.checkPeopleName = result.data.checkPeopleName // 检查人员
this.reviewDate = result.reviewDate // 隐患审核日期 this.rectificationDeadline = result.data.rectificationDeadline // 整改截止日期
this.reviewRecord = result.reviewRecord this.reviewDate = result.data.reviewDate // 隐患审核日期
this.totalItems = result.itemAllCount, this.reviewRecord = result.data.reviewRecord
this.totalItems = result.data.itemAllCount,
// 表单数据 // 表单数据
this.checkData = JSON.parse(JSON.stringify(result.data)) this.checkData = JSON.parse(JSON.stringify(result.data.gqCheckTypeDtoList))
this.originCheckData = JSON.parse(JSON.stringify(result.data)) this.originCheckData = JSON.parse(JSON.stringify(result.data.gqCheckTypeDtoList))
} }
}) })
}, },
getDetail4YH_XQ() { // 隐患详情 getDetail4YH_XQ() { // 隐患详情
...@@ -196,26 +202,29 @@ window.onload = function() { ...@@ -196,26 +202,29 @@ window.onload = function() {
}, },
getDetail4JC_XQ() { // 检查单详情 getDetail4JC_XQ() { // 检查单详情
console.log('jiancha单向器')
vant.Toast.loading({ vant.Toast.loading({
message: '正在加载...', message: '正在加载...',
forbidClick: true, forbidClick: true,
loadingType: 'spinner', loadingType: 'spinner',
}); });
http2.post({ http2.get('/gq/asd/list', {
serviceId: API_KEY_MAP["no-page"]['id'], sign: 2,
interfacePublicKey: API_KEY_MAP["no-page"]["publicKey"], // serviceId: API_KEY_MAP["no-page"]['id'],
interfacePrivateKey: API_KEY_MAP["no-page"]["privateKey"], // interfacePublicKey: API_KEY_MAP["no-page"]["publicKey"],
reqParams: { // interfacePrivateKey: API_KEY_MAP["no-page"]["privateKey"],
"recordId": "1", // reqParams: {
} // "recordId": "10",
// }
"recordId": "22",
}, (res) => { }, (res) => {
if (!res) { // 中台返回为undefined 重新请求 // if (!res) { // 中台返回为undefined 重新请求
vant.Toast.clear() // vant.Toast.clear()
setTimeout(() => { // setTimeout(() => {
this.getDetail4YH_XQ() // this.getDetail4JC_XQ()
}, 0); // }, 0);
return // return
} // }
if (res) { if (res) {
console.log('接口回调数据', JSON.parse(res)) console.log('接口回调数据', JSON.parse(res))
setTimeout(() => { setTimeout(() => {
...@@ -231,7 +240,22 @@ window.onload = function() { ...@@ -231,7 +240,22 @@ window.onload = function() {
this.notNullCount = result.data.notRectifiedCount this.notNullCount = result.data.notRectifiedCount
this.totalItems = result.itemAllCount this.totalItems = result.itemAllCount
} }
}) }).then((res) => {
console.log('接口回调数据检查详情', res)
// setTimeout(() => {
// this.$nextTick(() => {
// vant.Toast.clear()
// })
// }, 0);
var result = res
this.checkDate = result.data.checkTime // 检查日期
this.checkPeopleName = result.data.checkPeopleName // 检查人员
this.checkData = result.data.gqCheckTypeDtoList
this.noCount = result.data.hiddenCount
this.notNullCount = result.data.notRectifiedCount
this.totalItems = result.itemAllCount
})
}, },
add4ZG_XQ() { add4ZG_XQ() {
...@@ -307,16 +331,16 @@ window.onload = function() { ...@@ -307,16 +331,16 @@ window.onload = function() {
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) => { http2.post('/gq/checkRecord/safeCheckRecord', reqParam).then((res) => {
console.log('添加结果', res) console.log('添加结果', res)
vant.Toast({ vant.Toast({
message: '操作成功', message: '操作成功',
}) })
gemhoUtil.navigatePage(this.pageName + '.html', '操作完成,跳转中...') // gemhoUtil.navigatePage(this.pageName + '.html', '操作完成,跳转中...')
}) })
} }
} }
......
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