Commit 6a8a586a authored by lei's avatar lei

Merge branch 'gaoqucodecheck' of...

Merge branch 'gaoqucodecheck' of http://h.gemho.cn:7099/zhaojunbao/gaoquyingjih5-asd into gaoqucodecheck

# Conflicts:
#	src/_check_info.js
parents 5d9a2a34 864abf51
...@@ -173,14 +173,14 @@ ...@@ -173,14 +173,14 @@
<div class="bottom_bar" v-if="flag=='ZG_XQ'"> <div class="bottom_bar" v-if="flag=='ZG_XQ'">
<div style="display: flex;justify-content: center;gap: 1rem;"> <div style="display: flex;justify-content: center;gap: 1rem;">
<van-button type="info" size="small" @click="navTo1" style="width:2rem" >提交整改</van-button> <van-button type="info" size="small" @click="add4ZG_XQ" style="width:2rem" >提交整改</van-button>
</div> </div>
</div> </div>
<div class="bottom_bar" v-if="flag=='YH_XQ'"> <div class="bottom_bar" v-if="flag=='YH_XQ'">
<div style="display: flex;justify-content: center;gap: 1rem;"> <div style="display: flex;justify-content: center;gap: 1rem;">
<van-button type="danger" size="small" @click="navTo1" style="width:2rem" >拒绝</van-button> <van-button type="danger" size="small" @click="add4YH_XQ(0)" style="width:2rem" >拒绝</van-button>
<van-button type="info" size="small" @click="navTo1" style="width:2rem" >通过</van-button> <van-button type="info" size="small" @click="add4YH_XQ(1)" style="width:2rem" >通过</van-button>
</div> </div>
</div> </div>
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
<div> <div>
<span class="check_num">{{ notNullCount }}/{{totalItems}}</span> <span class="check_num">{{ notNullCount }}/{{totalItems}}</span>
<span class="yh_num">{{noCount}} 隐患</span> <span class="yh_num">{{noCount}} 隐患</span>
<van-button type="info" size="small" @click="navTo1" <van-button type="info" size="small" @click="add4JC_XQ"
v-show="checkPageIndex===3&&flag=='ADD'">完成检查</van-button> v-show="checkPageIndex===3&&flag=='ADD'">完成检查</van-button>
<van-button v-show="checkPageIndex<3" type="info" size="small" <van-button v-show="checkPageIndex<3" type="info" size="small"
@click="checkPageIndex++">下一项</van-button> @click="checkPageIndex++">下一项</van-button>
......
...@@ -46,7 +46,7 @@ window.onload = function () { ...@@ -46,7 +46,7 @@ window.onload = function () {
}, },
mounted() { mounted() {
/** /**
* 调转该页面时需要传递参数 * 调转该_check_info.html页面时需要传递参数
* type : ADD新增、JC_XQ检查详情、ZG_XQ整改详情、YH_XQ隐患详情 * type : ADD新增、JC_XQ检查详情、ZG_XQ整改详情、YH_XQ隐患详情
* id: 记录id || 隐患id * id: 记录id || 隐患id
* pageName: 页面名称(用于记录页面来源,用于操作后返回上一页) * pageName: 页面名称(用于记录页面来源,用于操作后返回上一页)
...@@ -55,311 +55,155 @@ window.onload = function () { ...@@ -55,311 +55,155 @@ window.onload = function () {
// this.flag = gemhoUtil.getParameter('type') // this.flag = gemhoUtil.getParameter('type')
// this.id = gemhoUtil.getParameter('id') // this.id = gemhoUtil.getParameter('id')
// this.pageName = gemhoUtil.getParameter('pageName') // this.pageName = gemhoUtil.getParameter('pageName')
// if (type === 'YH_XQ') { // 隐患详情 // // 表单数据
// this.getDetail4YH_XQ() // this.checkData = result.data
// } 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: { getDetail4JC_XQ() {
checkData: { // 检查单详情
handler(newVal) { vant.Toast.loading({
const snapshot = JSON.parse(JSON.stringify(newVal)) message: '正在加载...',
console.log('全量变化:', snapshot) forbidClick: true,
this.noCount = countSelectedNo(newVal) // selected=no 的个数 loadingType: 'spinner',
// this.totalItems = getTotalCheckListItems(newVal); // checkList 子元素总数 })
this.notNullCount = countSelectedNotNull(newVal) // selected 不为 null 的个数 http2.post(
}, {
deep: true, serviceId: API_KEY_MAP['no-page']['id'],
}, interfacePublicKey: API_KEY_MAP['no-page']['publicKey'],
}, interfacePrivateKey: API_KEY_MAP['no-page']['privateKey'],
methods: { reqParams: {
getOriginMatchedItemById(id) { recordId: '1',
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({
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: {},
}, },
(res) => { },
if (!res) { (res) => {
// 中台返回为undefined 重新请求 if (!res) {
vant.Toast.clear() // 中台返回为undefined 重新请求
setTimeout(() => { vant.Toast.clear()
this.getDetail4Template() setTimeout(() => {
}, 0) this.getDetail4YH_XQ()
return }, 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.totalItems = result.itemAllCount),
// 表单数据
(this.checkData = JSON.parse(JSON.stringify(result.data)))
this.originCheckData = JSON.parse(JSON.stringify(result.data))
}
} }
) if (res) {
}, console.log('接口回调数据', JSON.parse(res))
getDetail4YH_XQ() { setTimeout(() => {
// 隐患详情 this.$nextTick(() => {
vant.Toast.loading({ vant.Toast.clear()
message: '正在加载...', })
forbidClick: true, }, 0)
loadingType: 'spinner', var result = JSON.parse(res)
}) this.checkDate = result.data.checkTime // 检查日期
http2.post( this.checkPeopleName = result.data.checkPeopleName // 检查人员
{ this.checkData = result.data.gqCheckTypeDtoList
serviceId: API_KEY_MAP['no-page']['id'], this.noCount = result.data.hiddenCount
interfacePublicKey: API_KEY_MAP['no-page']['publicKey'], this.notNullCount = result.data.notRectifiedCount
interfacePrivateKey: API_KEY_MAP['no-page']['privateKey'], this.totalItems = result.itemAllCount
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
}
} }
) }
}, )
getDetail4JC_XQ() { },
// 检查单详情 add4ZG_XQ() {
vant.Toast.loading({ if (!this.checkData.photos.length) {
message: '正在加载...', vant.Dialog.alert({
forbidClick: true, message: '请上传整改图片',
loadingType: 'spinner',
}) })
http2.post( return
{ }
serviceId: API_KEY_MAP['no-page']['id'], vant.Toast.loading({
interfacePublicKey: API_KEY_MAP['no-page']['publicKey'], message: '正在处理...',
interfacePrivateKey: API_KEY_MAP['no-page']['privateKey'], forbidClick: true,
reqParams: { loadingType: 'spinner',
recordId: '1', })
}, 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: this.id,
photos: this.checkData,
}, },
(res) => { },
if (!res) { (res, type) => {
// 中台返回为undefined 重新请求 if (!res && !type) {
vant.Toast.clear() // 如果是中台接口返回为undefined,则重新发起请求
setTimeout(() => { vant.Toast.clear()
this.getDetail4YH_XQ() setTimeout(() => {
}, 0) this.add4ZG_XQ()
return }, 0)
} return
if (res) { }
console.log('接口回调数据', JSON.parse(res)) if (res) {
setTimeout(() => { console.log('添加结果', res)
this.$nextTick(() => { vant.Toast({
vant.Toast.clear() message: '操作成功',
}) })
}, 0) // history.back()
var result = JSON.parse(res) gemhoUtil.navigatePage(
this.checkDate = result.data.checkTime // 检查日期 this.pageName + '.html',
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() {
if (!this.checkData.photos.length) {
vant.Dialog.alert({
message: '请上传整改图片',
})
return
} }
vant.Toast.loading({ )
message: '正在处理...', },
forbidClick: true, add4YH_XQ(auditStatus) {
loadingType: 'spinner', // 隐患详情 审核通过或拒绝
}) vant.Toast.loading({
http2.post( message: '正在处理...',
{ forbidClick: true,
serviceId: API_KEY_MAP['no-page']['id'], loadingType: 'spinner',
interfacePublicKey: API_KEY_MAP['no-page']['publicKey'], })
interfacePrivateKey: API_KEY_MAP['no-page']['privateKey'], http2.post(
reqParams: { {
hdId: this.id, serviceId: API_KEY_MAP['no-page']['id'],
photos: this.checkData, interfacePublicKey: API_KEY_MAP['no-page']['publicKey'],
}, interfacePrivateKey: API_KEY_MAP['no-page']['privateKey'],
reqParams: {
hdId: this.id,
auditStatus,
}, },
(res, type) => { },
if (!res && !type) { (res, type) => {
// 如果是中台接口返回为undefined,则重新发起请求 if (!res && !type) {
vant.Toast.clear() // 如果是中台接口返回为undefined,则重新发起请求
setTimeout(() => { vant.Toast.clear()
this.add4ZG_XQ() setTimeout(() => {
}, 0) this.add4YH_XQ()
return }, 0)
} return
if (res) {
console.log('添加结果', res)
vant.Toast({
message: '操作成功',
})
// history.back()
gemhoUtil.navigatePage(
this.pageName + '.html',
'操作完成,跳转中...'
)
}
} }
) if (res) {
}, console.log('添加结果', res)
add4YH_XQ(auditStatus) { vant.Toast({
// 隐患详情 审核通过或拒绝 message: '操作成功',
vant.Toast.loading({ })
message: '正在处理...', // history.back()
forbidClick: true, gemhoUtil.navigatePage(
loadingType: 'spinner', this.pageName + '.html',
}) '操作完成,跳转中...'
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: this.id,
auditStatus,
},
},
(res, type) => {
if (!res && !type) {
// 如果是中台接口返回为undefined,则重新发起请求
vant.Toast.clear()
setTimeout(() => {
this.add4YH_XQ()
}, 0)
return
}
if (res) {
console.log('添加结果', res)
vant.Toast({
message: '操作成功',
})
// history.back()
gemhoUtil.navigatePage(
this.pageName + '.html',
'操作完成,跳转中...'
)
}
} }
)
},
add4JC_XQ() {
var reqParam = {
merId: '1',
gqCheckTypeVoList: this.checkData,
} }
var url = '/gq/checkRecord/safeCheckRecord' )
},
add4JC_XQ() {
var reqParam = {
merId: '1',
gqCheckTypeVoList: this.checkData,
}
var url = '/gq/checkRecord/safeCheckRecord'
http.post(url, reqParam).then((res) => { http.post(url, 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