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 @@
<div class="bottom_bar" v-if="flag=='ZG_XQ'">
<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 class="bottom_bar" v-if="flag=='YH_XQ'">
<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="info" 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="add4YH_XQ(1)" style="width:2rem" >通过</van-button>
</div>
</div>
......@@ -189,7 +189,7 @@
<div>
<span class="check_num">{{ notNullCount }}/{{totalItems}}</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>
<van-button v-show="checkPageIndex<3" type="info" size="small"
@click="checkPageIndex++">下一项</van-button>
......
......@@ -46,7 +46,7 @@ window.onload = function () {
},
mounted() {
/**
* 调转该页面时需要传递参数
* 调转该_check_info.html页面时需要传递参数
* type : ADD新增、JC_XQ检查详情、ZG_XQ整改详情、YH_XQ隐患详情
* id: 记录id || 隐患id
* pageName: 页面名称(用于记录页面来源,用于操作后返回上一页)
......@@ -55,167 +55,11 @@ window.onload = function () {
// this.flag = gemhoUtil.getParameter('type')
// this.id = gemhoUtil.getParameter('id')
// this.pageName = gemhoUtil.getParameter('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.checkData = result.data
// }
},
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({
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) {
// 中台返回为undefined 重新请求
vant.Toast.clear()
setTimeout(() => {
this.getDetail4Template()
}, 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))
}
}
)
},
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
}
}
)
// }
// )
},
getDetail4JC_XQ() {
// 检查单详情
......@@ -360,6 +204,6 @@ window.onload = function () {
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