|
|
|
@ -71,11 +71,17 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="list-item-feet border-top"> |
|
|
|
|
<view class="list-btn ani" hover-class="isHoverIng" v-if="item.status==1&&userType == 1||item.status==1&&userType == 2" @click="viewDetails(item,false)">修改</view> |
|
|
|
|
<view class="list-btn ani" hover-class="isHoverIng" v-if="item.status==1" @click="signIng(item)">签字</view> |
|
|
|
|
<view class="list-btn ani" hover-class="isHoverIng" v-if="item.status!=1" @click="goReport(item)">查看报告</view> |
|
|
|
|
<view class="list-btn ani" hover-class="isHoverIng" v-if="item.status==2&&userType == 1||item.status==2&&userType == 2" @click="viewDetails(item,true,'1')">复查</view> |
|
|
|
|
<view class="list-btn ani" hover-class="isHoverIng" @click="viewDetails(item,true)">查看详情</view> |
|
|
|
|
<view class="list-btn ani" hover-class="isHoverIng" |
|
|
|
|
v-if="item.status == 1 && userType == 1 || item.status == 1 && userType == 2" |
|
|
|
|
@click="viewDetails(item, false)">修改</view> |
|
|
|
|
<view class="list-btn ani" hover-class="isHoverIng" v-if="item.status == 1" @click="signIng(item)">签字 |
|
|
|
|
</view> |
|
|
|
|
<view class="list-btn ani" hover-class="isHoverIng" v-if="item.status != 1" @click="goReport(item)">查看报告 |
|
|
|
|
</view> |
|
|
|
|
<view class="list-btn ani" hover-class="isHoverIng" |
|
|
|
|
v-if="item.status == 2 && userType == 1 || item.status == 2 && userType == 2" |
|
|
|
|
@click="viewDetails(item, true, '1')">复查</view> |
|
|
|
|
<view class="list-btn ani" hover-class="isHoverIng" @click="viewDetails(item, true)">查看详情</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</z-paging> |
|
|
|
@ -106,7 +112,7 @@ |
|
|
|
|
</view> |
|
|
|
|
<text>检查人与企业签字</text> |
|
|
|
|
</view> --> |
|
|
|
|
<view class="sign-item" @click="open(1)" v-if="userType == 1||userType == 2"> |
|
|
|
|
<view class="sign-item" @click="open(1)" v-if="userType == 1 || userType == 2"> |
|
|
|
|
<view class="sign-item-icon"> |
|
|
|
|
<!-- <image src="https://mp-df79fe8b-b924-41b0-bcb1-960be6b4a619.cdn.bspapp.com/images/common/m@2x.png"> --> |
|
|
|
|
<image src="https://i.postimg.cc/bJK1f6rb/m-2x.png"> |
|
|
|
@ -132,8 +138,8 @@ |
|
|
|
|
|
|
|
|
|
<!-- 签字板 --> |
|
|
|
|
<view class="sign-box"> |
|
|
|
|
<sp-sign-board v-if="showSign" ref="signBoardRef" sid="sign-board-popup" :showMark="false" |
|
|
|
|
bgColor="#f8f8f8" :horizontal="true" popup-mode :needBack="false"></sp-sign-board> |
|
|
|
|
<sp-sign-board v-if="showSign" :expFile="expFile" ref="signBoardRef" sid="sign-board-popup" |
|
|
|
|
:showMark="false" bgColor="#f8f8f8" :horizontal="true" popup-mode :needBack="false"></sp-sign-board> |
|
|
|
|
</view> |
|
|
|
|
<!-- 自定义控制栏 --> |
|
|
|
|
<view class="sign-control"> |
|
|
|
@ -174,6 +180,8 @@ import CustomRefresher from '@/components/custom-refresher/custom-refresher' |
|
|
|
|
import { parseTime } from '@/utils/ruoyi' |
|
|
|
|
import { getDicts } from '@/api/system/user' |
|
|
|
|
import * as Api from '@/api/index/index' |
|
|
|
|
import { baseUrl } from '@/config' |
|
|
|
|
import { getAccessToken, setToken } from '@/utils/auth' |
|
|
|
|
import { getLabelByValue } from '@/utils/showDictLabel.js' // 导入工具函数 |
|
|
|
|
export default { |
|
|
|
|
components: { |
|
|
|
@ -204,6 +212,10 @@ export default { |
|
|
|
|
signType: null, |
|
|
|
|
signItemId: null, |
|
|
|
|
selectedItem: null, |
|
|
|
|
expFile: { |
|
|
|
|
fileType: 'png', |
|
|
|
|
}, |
|
|
|
|
baseApi: '/prod-api/admin-api/infra/file/upload', |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
@ -214,53 +226,83 @@ export default { |
|
|
|
|
mounted() { |
|
|
|
|
// 监听,有必要时请正确处理on、once和off |
|
|
|
|
uni.$on('getSignImg', (e) => { |
|
|
|
|
let that = this |
|
|
|
|
console.log('getSignImg', e) |
|
|
|
|
// 多签名场景下可根据 sid 区分不同签名 |
|
|
|
|
if (e.sid == 'sign-board-popup') { |
|
|
|
|
if (this.signType == 1) { |
|
|
|
|
this.selectedItem.checkPeopleSignature = e.base64 |
|
|
|
|
Api.updateInitialReview({ |
|
|
|
|
id: this.signItemId, |
|
|
|
|
checkPeopleSignature: e.base64 |
|
|
|
|
}).then(res => { |
|
|
|
|
debugger |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '检查人签字完成', |
|
|
|
|
icon: 'none', |
|
|
|
|
mask: true |
|
|
|
|
}) |
|
|
|
|
if (this.selectedItem.enterpriseSignature) { |
|
|
|
|
this.updateItemStatus() |
|
|
|
|
}else{ |
|
|
|
|
this.$refs.paging.refresh() |
|
|
|
|
|
|
|
|
|
uni.uploadFile({ |
|
|
|
|
header: { |
|
|
|
|
"Authorization": "Bearer " + getAccessToken(), |
|
|
|
|
}, |
|
|
|
|
url: baseUrl + that.baseApi, |
|
|
|
|
filePath: e.path, |
|
|
|
|
name: 'file', |
|
|
|
|
success(res) { |
|
|
|
|
var obj = JSON.parse(res.data); |
|
|
|
|
if (obj.code != 0) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: "签字失败,请重试", |
|
|
|
|
icon: "none" |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (that.signType == 1) { |
|
|
|
|
|
|
|
|
|
that.selectedItem.checkPeopleSignature = e.base64 |
|
|
|
|
Api.updateInitialReview({ |
|
|
|
|
id: that.signItemId, |
|
|
|
|
checkPeopleSignature: obj.data |
|
|
|
|
}).then(res => { |
|
|
|
|
debugger |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '检查人签字完成', |
|
|
|
|
icon: 'none', |
|
|
|
|
mask: true |
|
|
|
|
}) |
|
|
|
|
if (that.selectedItem.enterpriseSignature) { |
|
|
|
|
that.updateItemStatus() |
|
|
|
|
} else { |
|
|
|
|
that.$refs.paging.refresh() |
|
|
|
|
} |
|
|
|
|
console.log(res) |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err) |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
that.selectedItem.enterpriseSignature = e.base64 |
|
|
|
|
Api.updateInitialReview({ |
|
|
|
|
id: that.signItemId, |
|
|
|
|
enterpriseSignature: obj.data |
|
|
|
|
}).then(res => { |
|
|
|
|
debugger |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '企业签字完成', |
|
|
|
|
icon: 'none', |
|
|
|
|
mask: true |
|
|
|
|
}) |
|
|
|
|
console.log(res) |
|
|
|
|
if (that.selectedItem.checkPeopleSignature) { |
|
|
|
|
that.updateItemStatus() |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
that.$refs.paging.refresh() |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
console.log(res) |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err) |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
this.selectedItem.enterpriseSignature = e.base64 |
|
|
|
|
Api.updateInitialReview({ |
|
|
|
|
id: this.signItemId, |
|
|
|
|
enterpriseSignature: e.base64 |
|
|
|
|
}).then(res => { |
|
|
|
|
debugger |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
fail(res) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '企业签字完成', |
|
|
|
|
icon: 'none', |
|
|
|
|
mask: true |
|
|
|
|
title: "签字失败,请重试", |
|
|
|
|
icon: "none" |
|
|
|
|
}) |
|
|
|
|
console.log(res) |
|
|
|
|
if (this.selectedItem.checkPeopleSignature) { |
|
|
|
|
this.updateItemStatus() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
this.$refs.paging.refresh() |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.signBase64 = e.base64 |
|
|
|
|
this.signTempimg = e.path |
|
|
|
|
} |
|
|
|
@ -382,10 +424,10 @@ export default { |
|
|
|
|
// 一定注意不能确认签字完成后立马关闭弹窗,否则签字板会销毁,无法获取签名。需要等签名正确获取到之后再关闭弹窗 |
|
|
|
|
}, |
|
|
|
|
//查看详情,修改都走这里 |
|
|
|
|
viewDetails(item,val,type){ |
|
|
|
|
viewDetails(item, val, type) { |
|
|
|
|
const data = encodeURIComponent(JSON.stringify(item)) |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '/pageIndex/addSafeCheck/readdSafeCheck?data='+data+'&val='+val+'&type='+type |
|
|
|
|
url: '/pageIndex/addSafeCheck/readdSafeCheck?data=' + data + '&val=' + val + '&type=' + type |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
goReport(item) { |
|
|
|
|