Commit d38bdb7b authored by xinzhedeai's avatar xinzhedeai

add:拒绝 接口对接

parent 0b0a83d9
...@@ -236,18 +236,21 @@ ...@@ -236,18 +236,21 @@
<van-action-sheet v-model="jujue.show4modal" title=" "> <van-action-sheet v-model="jujue.show4modal" title=" ">
<div class="content" style="padding:0.5rem 0.4rem 0.5rem; text-align: center;"> <div class="content" style="padding:0.5rem 0.4rem 0.5rem; text-align: center;">
<h5 style="text-align: left;font-size: .3rem;">拒绝原因</h5> <h5 style="text-align: left;font-size: .3rem;">拒绝原因</h5>
<textarea class="textareaEle" v-model="jujue.refuseContent" name="" id="" cols="24" rows="3" <textarea class="textareaEle" v-model="jujue.reason" name="" id="" cols="24" rows="3"
style="resize: none;"></textarea> style="resize: none;"></textarea>
<h5 style="text-align: left;font-size: .3rem;">上报相关部门</h5>
<van-checkbox-group v-model="jujue.dept"> <div class="shangbao-wrapper" v-if="jujue.pushFlag">
<div v-for="(item, index) in jujue.deptDict" style="overflow: hidden;"> <h5 style="text-align: left;font-size: .3rem;">上报相关部门</h5>
<h5 style="text-align: left;font-size: .3rem;color: #1081E3;font-weight: 500;"> <van-checkbox-group v-model="jujue.dept">
{{item.name}}</h5> <div v-for="(item, index) in jujue.deptDict" style="overflow: hidden;">
<van-checkbox :key="subIndex" :name="subItem.deptId" shape="square" v-for="(subItem, subIndex) in item.children"> <h5 style="text-align: left;font-size: .3rem;color: #1081E3;font-weight: 500;">
{{ subItem.deptName }} {{item.name}}</h5>
</van-checkbox> <van-checkbox :key="subIndex" :name="subItem.deptId" shape="square" v-for="(subItem, subIndex) in item.children">
</div> {{ subItem.deptName }}
</van-checkbox-group> </van-checkbox>
</div>
</van-checkbox-group>
</div>
<div class="footer-bar"> <div class="footer-bar">
<van-button type="info" plain size="small" @click="jujue.show4modal=false">取消</van-button> <van-button type="info" plain size="small" @click="jujue.show4modal=false">取消</van-button>
...@@ -290,7 +293,8 @@ ...@@ -290,7 +293,8 @@
<div class="bottom_bar" <div class="bottom_bar"
v-if="flag=='3' && userType == 'wgy'"> v-if="flag=='3' && userType == 'wgy'">
<div> <div>
<van-button type="primary" size="small" @click="yuqi.show4shangbao=true">上报行业主管部门</van-button>
<van-button type="primary" size="small" @click="showShangbao">上报行业主管部门</van-button>
<van-button type="info" size="small" @click="yuqi.show4yanqi=true">限期3天整改</van-button> <van-button type="info" size="small" @click="yuqi.show4yanqi=true">限期3天整改</van-button>
</div> </div>
</div> </div>
......
...@@ -84,9 +84,10 @@ window.onload = function () { ...@@ -84,9 +84,10 @@ window.onload = function () {
jujue:{ jujue:{
show4modal :false, show4modal :false,
pushFlag: false, // 是否推送(审核拒绝时,如果true,则显示推送弹窗) pushFlag: false, // 是否推送(审核拒绝时,如果true,则显示推送弹窗)
refuseContent: '', // 拒绝原因 reason: '', // 拒绝原因
dept:[], // 拒绝部门 请求参数 dept:[], // 拒绝部门 请求参数
deptDict:[] // 列表 deptDict:[] // 列表
}, },
recordList: [], recordList: [],
...@@ -118,9 +119,6 @@ window.onload = function () { ...@@ -118,9 +119,6 @@ window.onload = function () {
} else if (this.flag === 'ADD') { // 新增,调用模板详情方法 } else if (this.flag === 'ADD') { // 新增,调用模板详情方法
this.getDetail4Template() this.getDetail4Template()
} }
this.getDept4jujue()
this.getDept4yuqi()
}, },
watch: { watch: {
checkData: { checkData: {
...@@ -138,6 +136,11 @@ window.onload = function () { ...@@ -138,6 +136,11 @@ window.onload = function () {
} }
}, },
methods: { methods: {
showShangbao(){
this.yuqi.show4shangbao=true;
this.yuqi.dept=[];
this.getDept4yuqi();
},
getDept4yuqi(param) { getDept4yuqi(param) {
http2.post({ http2.post({
serviceId: API_KEY_MAP["no-page"]['id'], serviceId: API_KEY_MAP["no-page"]['id'],
...@@ -191,7 +194,7 @@ window.onload = function () { ...@@ -191,7 +194,7 @@ window.onload = function () {
}, 0); }, 0);
var result = JSON.parse(res) var result = JSON.parse(res)
console.log('接口回调数据getDept4jujue', JSON.parse(res)) console.log('接口回调数据getDept4jujue', JSON.parse(res))
this.jujue.deptDict4resuse = result.data this.jujue.deptDict = result.data
} }
}) })
...@@ -389,7 +392,7 @@ window.onload = function () { ...@@ -389,7 +392,7 @@ window.onload = function () {
this.reviewRecord = result.reviewRecord this.reviewRecord = result.reviewRecord
// 2025年6月18日 新增返回字段 隐患整改、逾期上报等 // 2025年6月18日 新增返回字段 隐患整改、逾期上报等
this.jujue.pushFlag = true // result.pushFlag this.jujue.pushFlag = result.pushFlag
this.recordList = result.recordList this.recordList = result.recordList
this.checkDeptName = result.checkDeptName // 检查单位 this.checkDeptName = result.checkDeptName // 检查单位
...@@ -542,10 +545,11 @@ window.onload = function () { ...@@ -542,10 +545,11 @@ window.onload = function () {
}); });
}, },
validRefuse(auditStatus){ validRefuse(auditStatus){
if(this.jujue.pushFlag){ this.jujue.show4modal = true
this.jujue.show4modal = true this.jujue.reason = ''
}else{ if(this.jujue.pushFlag){ // 需要上报的时候,清理
this.add4DSH_XQ(auditStatus) this.jujue.dept = []
this.getDept4jujue()
} }
}, },
add4DSH_XQ(auditStatus) { // 隐患详情 审核通过或拒绝 add4DSH_XQ(auditStatus) { // 隐患详情 审核通过或拒绝
...@@ -557,12 +561,15 @@ window.onload = function () { ...@@ -557,12 +561,15 @@ window.onload = function () {
let reqParams = { let reqParams = {
sign: 8, sign: 8,
"hdId": this.id, "hdId": this.id,
auditStatus auditStatus,
} }
// 2025年6月18日 新增逻辑: 如果是拒绝,且需要上报,则额外添加上报参数 // 2025年6月18日 新增逻辑: 如果是拒绝,且需要上报,则额外添加上报参数
if(this.pushFlag && auditStatus==0){ if(auditStatus==0){
reqParams.reason = this.reason reqParams.reason = this.jujue.reason
if(this.jujue.pushFlag){
reqParams.reportedIds = this.jujue.dept
}
} }
http2.post({ http2.post({
...@@ -580,11 +587,20 @@ window.onload = function () { ...@@ -580,11 +587,20 @@ window.onload = function () {
} }
if (res) { if (res) {
console.log('添加结果', res) console.log('添加结果', res)
vant.Toast({ var result = JSON.parse(res)
message: '操作成功', if(result.code === 200){
}) vant.Toast({
// history.back() message: '操作成功',
gemhoUtil.navigatePage(`${this.pageName}.html${window.location.search}`, '操作完成,跳转中...') })
// history.back()
setTimeout(() => {
gemhoUtil.navigatePage(`${this.pageName}.html${window.location.search}`, '操作完成,跳转中...')
}, 1000);
}else{
vant.Toast({
message: '操作失败',
})
}
} }
}) })
}, },
......
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