Commit efb82cad authored by xinzhedeai's avatar xinzhedeai

检查页面 接口对接

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