|
|
|
@ -75,10 +75,13 @@ |
|
|
|
|
// <view class="list-btn">复制报告链接</view> |
|
|
|
|
// <view class="list-btn" @click="signIng(item)">签字</view> --> |
|
|
|
|
<view class="list-btn ani" hover-class="isHoverIng" @click="goReport(item)">查看报告</view> |
|
|
|
|
<view class="list-btn ani" hover-class="isHoverIng" v-if="item.status == 3&&userType == 1||item.status == 3&&userType == 2" |
|
|
|
|
<view class="list-btn ani" hover-class="isHoverIng" |
|
|
|
|
v-if="item.status == 3 && userType == 1 || item.status == 3 && userType == 2" |
|
|
|
|
@click="viewDetails(item, true, '1')">复查</view> |
|
|
|
|
<view class="list-btn ani" hover-class="isHoverIng" v-if="item.status == 4&&userType == 1||item.status == 4&&userType == 2" |
|
|
|
|
<view class="list-btn ani" hover-class="isHoverIng" |
|
|
|
|
v-if="item.status == 4 && userType == 1 || item.status == 4 && userType == 2" |
|
|
|
|
@click="viewDetails(item, true, '2')">同步到学一学</view> |
|
|
|
|
<view class="list-btn ani" hover-class="isHoverIng" @click="viewDetails(item, true,'4')">查看详情</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</z-paging> |
|
|
|
@ -118,7 +121,7 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</uni-popup> |
|
|
|
|
<uni-popup ref="comTypePopup" type="bottom" background-color="#fff"> |
|
|
|
|
<uni-popup ref="comTypePopup" type="center" background-color="#fff"> |
|
|
|
|
<view class="popup-box"> |
|
|
|
|
<view class="popup-box-content"> |
|
|
|
|
<view class="popup-box-content-item"> |
|
|
|
@ -129,11 +132,12 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="popup-box-btn-box"> |
|
|
|
|
<view class="popup-box-btn-box-item" @click="reset">重置</view> |
|
|
|
|
<view class="popup-box-btn-box-item" @click="tongbu">确定</view> |
|
|
|
|
<view class="popup-box-btn-box-item" @click="reset1">取消</view> |
|
|
|
|
<view class="popup-box-btn-box-item" @click="tongbu(1)">确定</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</uni-popup> |
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
<script> |
|
|
|
@ -167,8 +171,9 @@ export default { |
|
|
|
|
comType: '', |
|
|
|
|
status: '', |
|
|
|
|
reviewName: '', |
|
|
|
|
formData:null, |
|
|
|
|
formData: null, |
|
|
|
|
userType: this.$store.state.user.userType, |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
@ -181,20 +186,26 @@ export default { |
|
|
|
|
this.getDicts('initial_review_check_type') |
|
|
|
|
this.getDicts('initial_review_status') |
|
|
|
|
this.getDicts('com_type') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
reset() { |
|
|
|
|
this.checkType = '' |
|
|
|
|
this.comType = '' |
|
|
|
|
this.status = '' |
|
|
|
|
this.reviewName = '' |
|
|
|
|
}, |
|
|
|
|
reset1() { |
|
|
|
|
this.comType = '' |
|
|
|
|
this.$refs.comTypePopup.close() |
|
|
|
|
}, |
|
|
|
|
confirm() { |
|
|
|
|
this.$refs.paging.refresh() |
|
|
|
|
this.$refs.popup.close() |
|
|
|
|
}, |
|
|
|
|
//同步学一学 |
|
|
|
|
tongbu() { |
|
|
|
|
tongbu(val) { |
|
|
|
|
if (val == 1) { |
|
|
|
|
if (!this.comType) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请选择企业类型', |
|
|
|
@ -211,7 +222,7 @@ export default { |
|
|
|
|
if (res.confirm) { |
|
|
|
|
that.formData = { |
|
|
|
|
...that.formData, |
|
|
|
|
type:that.comType |
|
|
|
|
type: that.comType |
|
|
|
|
} |
|
|
|
|
debugger |
|
|
|
|
Api.updateReview(that.formData).then(res => { |
|
|
|
@ -229,6 +240,68 @@ export default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
if (val == 2) { |
|
|
|
|
if (!this.hazardLevel) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请选择隐患等级', |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
if (!this.hazardType) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请选择隐患类型', |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
let that = this |
|
|
|
|
uni.showModal({ |
|
|
|
|
title: '提示', |
|
|
|
|
content: '确定同步吗?', |
|
|
|
|
showCancel: true, |
|
|
|
|
success: function (res) { |
|
|
|
|
if (res.confirm) { |
|
|
|
|
const arr = JSON.parse(that.formData.reviewResult) |
|
|
|
|
arr.forEach(item => { |
|
|
|
|
const obj = { |
|
|
|
|
"hazardType": "2", // 隐患类型 |
|
|
|
|
"hazardLevel": "", // 隐患等级 |
|
|
|
|
"hazardDescription": "你说的对", //隐患描述 |
|
|
|
|
"inspectionBasis": "", //检查依据 |
|
|
|
|
"remediationSuggestions": "", //整改建议 |
|
|
|
|
"sort": 1, //排序 |
|
|
|
|
"status": 0 //状态 0启用 1停用 |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
that.formData = { |
|
|
|
|
...that.formData, |
|
|
|
|
hazardDescription: that.formData.description, |
|
|
|
|
inspectionBasis: that.formData.rectificationBasis, |
|
|
|
|
remediationSuggestions: that.formData.rectificationSuggestion, |
|
|
|
|
hazardType: that.hazardType, |
|
|
|
|
hazardLevel: that.hazardLevel, |
|
|
|
|
sort: 0, |
|
|
|
|
status: true |
|
|
|
|
} |
|
|
|
|
debugger |
|
|
|
|
Api.createPrivateHazard(that.formData).then(res => { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '同步完成', |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
that.$refs.comTypePopup.close() |
|
|
|
|
that.$refs.paging.refresh() |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err) |
|
|
|
|
}) |
|
|
|
|
} else if (res.cancel) { |
|
|
|
|
console.log('用户点击取消'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
getDicts(type) { |
|
|
|
|
const params = { |
|
|
|
@ -285,8 +358,9 @@ export default { |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
viewDetails(item, val, type) { |
|
|
|
|
if (type == 1) { |
|
|
|
|
const data = encodeURIComponent(JSON.stringify(item)) |
|
|
|
|
|
|
|
|
|
if (type == 1) { |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '/pageIndex/addSafeCheck/readdSafeCheck?data=' + data + '&val=' + val + '&type=' + type |
|
|
|
|
}) |
|
|
|
@ -295,6 +369,15 @@ export default { |
|
|
|
|
this.formData = item |
|
|
|
|
this.$refs.comTypePopup.open() |
|
|
|
|
} |
|
|
|
|
if (type == 3) { |
|
|
|
|
this.formData = item |
|
|
|
|
this.$refs.comTypePopup.open() |
|
|
|
|
} |
|
|
|
|
if (type == 4) { |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '/pageIndex/addSafeCheck/readdSafeCheck?data=' + data + '&val=' + val + '&type=' + type |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
goReport(item) { |
|
|
|
|
const data = encodeURIComponent(JSON.stringify(item)) |
|
|
|
|