Commit 2237efd4 authored by 胡's avatar

fix: 优化代码

parent 1016637d
......@@ -11,5 +11,5 @@ module.exports = {
ocrPath:'"http://180.104.121.66:8088/r/api"',
fileUploadSvcPath:'"http://180.104.121.66:8088/r/api/app/fileUploadSvc?sysName=XCMG_UAT&apiName="',
appId: '"com.xcmg.app.dev"',
currentVersion: '"3.3.0"'
currentVersion: '"3.3.3"'
}
......@@ -9,24 +9,30 @@
<scroll ref="scrollLists" :updateData="[prolists]" :pullUp="false">
<div class="hint-info">
<img src="@/assets/contractCreate/hint.png" />提示: 红色为已签署合同
<img src="@/assets/contractCreate/hint.png" />提示: 仅签署列表中状态为“未签署”的合同
</div>
<div class="scroll-box">
<div class="box" v-for="item of list" :key="item.project_id">
<!-- 颜色 d6204b -->
<div class="name">
<img v-if="item.checked" src="@/assets/login/contract-red.png" alt="icon" />
<img v-else src="@/assets/login/contract.png" alt="icon" />
<span>{{ item.project_name }}</span>
<!-- <img src="@/assets/login/contract.png" alt="icon" /> -->
<img src="@/assets/distributorSign/fileIcon.png" alt="icon" />
<!-- <img v-if="item.checked" src="@/assets/login/contract-red.png" alt="icon" /> -->
<span>{{ item.project_number }}</span>
</div>
<div>{{ item.project_number }}</div>
<div
:class="['flag', item.checked ? 'flag-false' : null]"
>{{ item.checked ? '已' : '未' }}签署</div>
</div>
</div>
</scroll>
<bottom-tab class="add-box">
<tab-button class="before" @click.native="signContact">签署电子合同</tab-button>
<tab-button class="next" @click.native="submit">提交审核</tab-button>
<tab-button
class="before"
@click.native="$route.query.name === 'confirmList' ? takePhonto() : signContact()"
>{{ buttonName }}</tab-button>
<tab-button class="next" @click.native="confirm">提交审核</tab-button>
</bottom-tab>
</h-view>
</template>
......@@ -37,17 +43,22 @@ export default {
data() {
return {
prolists: [],
title: this.$route.query.name === 'confirmList' ? '批量签署电子合同' : '批量签署电子合同',
title: this.$route.query.name === 'confirmList' ? '批量签署电子合同' : '批量签署征信授权书',
buttonName: this.$route.query.name === 'confirmList' ? '签署电子合同' : '签署征信授权',
list: JSON.parse(window.localStorage.getItem('handleContact')),
checkList: [], // 需要进行签署的合同
faceListUpload: [],
}
},
mounted() {
created() {
this.checkSigned();
},
methods: {
// 检测已经签署的合同,进行过滤
async checkSigned() {
if (!this.list.length) return;
let url = process.env.basePath + 'batch_check_sign';
let data_class = this.$route.query.name === "confirmList" ? "LEASE_ITEM" : "PRJ_CONFIRM";
......@@ -71,6 +82,17 @@ export default {
hlsPopup.showLongCenter(res.message);
}
},
confirm() {
let vm = this;
hlsPopup.showConfirm({
title: '提交审核',
content: '仅提交已签署成功合同,请确认是否提交?',
onConfirm: function (index) {
if (index == 1) vm.submit();
},
})
},
// 提交
async submit() {
let data_class = this.$route.query.name === "confirmList" ? "LEASE_ITEM" : "PRJ_CONFIRM";
......@@ -91,6 +113,8 @@ export default {
this.list = this.list.filter(item => !successList.includes(item.confirm_id));
if (!this.list.length) this.goBack();
window.localStorage.setItem('handleContact', JSON.stringify(this.list));
await this.checkSigned();
......@@ -124,6 +148,93 @@ export default {
hlsPopup.showLongCenter(res.message || res.info.msg)
}
},
// 人脸识别验证
async takePhonto() {
if (!this.checkList.length) return hlsPopup.showLongCenter("无可需要签署的电子合同");
let vm = this
let url = process.env.basePath + 'bp_query'
let param = { bp_id: JSON.parse(window.localStorage.now_user_bp_bind_id).bp_id }
hlsPopup.showLoading('请稍候')
vm.hlsHttp.post(url, param).then(res => {
hlsPopup.hideLoading()
if (res.result === 'S') {
let data = res.lists[0]
cordova.plugins.IdCardPlugin.faceContrast({ 'idNum': data.id_card_no, 'idName': data.bp_name }, function (suc) {
let success = JSON.parse(suc)
if (success.code === 1) {
let filePath = JSON.stringify(success.message, '\\', null)
filePath = 'file:\/\/' + filePath.replace('\"', '')
filePath = filePath.substr(0, filePath.length - 1)
console.log('filePath ==== ' + filePath)
// 回调成功上传图片
vm.uploadImg(filePath)
vm.signContact()
}
}, function (reason) {
let error = JSON.parse(reason)
vm.hlsPopup.showLongCenter('认证失败: ' + error.message)
})
} else {
vm.hlsPopup.showLongCenter(res.message)
}
})
},
// 处理要上传的图片格式
uploadImg(img) {
this.faceListUpload = this.list.map(item => {
return {
pkvalue: item.check_id,
source_type: 'PRJ_CDD_ITEM_CHECK',
picture: '',
filePath: img,
attachment_id: '',
user_id: 1,
fileName: 'face',
}
})
this.save_picture(this.faceListUpload);
},
// 图片保存
save_picture(list) {
let vm = this
if (list.length) {
// hlsPopup.showLoading('图片上传请稍候')
var alreadyUploadNum = 0
var attLength = 0
var recordUploadInterval = setInterval(function () {
if (alreadyUploadNum === attLength) {
clearInterval(recordUploadInterval)
}
}, 500)
for (var i = 0; i < list.length; i++) {
let uploadSuccess = function (res) {
if (res.result === 'S') {
alreadyUploadNum++
for (var j = 0; j < list.length; j++) {
if (list[j].filePath === res.response.filePath) {
list[j].attachment_id = res.response.attachment_id
vm.faceListUpload.push(list[j])
break
}
}
} else {
hlsPopup.hideLoading()
}
}
if (!list[i].attachment_id) {
attLength++
hlsUtil.fileUploadSvc(list[i], uploadSuccess)
}
}
} else {
hlsPopup.hideLoading()
}
},
// 返回,清缓存
goBack() {
window.localStorage.removeItem("handleContact");
......@@ -176,6 +287,7 @@ export default {
.box {
display: flex;
justify-content: space-between;
align-items: center;
width: 99.9%;
height: 60px;
......@@ -188,10 +300,28 @@ export default {
margin-bottom: 0.15rem;
img {
height: 18px;
height: 22px;
vertical-align: text-bottom;
margin-right: 7px;
}
.flag {
height: 25px;
line-height: 25px;
padding: 0 2px;
border-radius: 5px;
font-weight: 500;
background-color: #fff;
color: #bebebf;
border: 2px solid #bebebf;
}
.flag-false {
background-color: #00469c;
color: #e9e9eb;
border: 2px solid #00469c;
}
}
}
......
......@@ -124,9 +124,10 @@ export default {
this.$router.push({ path: '/batchSign', query: { name: 'confirmList' } });
},
clickRadio(item) {
item.checked = !item.checked;
item.checked = !item.checked;
this.chooseAll = this.showList.every(item => item.checked);
this.$forceUpdate();
},
allChoose(status) {
this.chooseAll = status;
......
......@@ -101,6 +101,7 @@ export default {
})
},
toRepayDetails (e) {
console.log(e);
this.$router.push({
name: 'RepayDetails',
params: {
......
<template>
<h-view id="repay-details" class="public-style">
<h-header :proportion="[5, 1, 1]" class="bar-custom">
<h-header :proportion="[5,1,1]" class="bar-custom">
<div slot="left" class="h-header-btn">
<img src="@/assets/userBind/arrow.png" @click="$routeGo()" />
<span>合同明细</span>
</div>
</h-header>
<h-content class="repay-content">
<h-content ref="content" class="repay-content">
<div class="header">合同单据</div>
<list-item :item-height="44" class="invoice">
<item>
......
......@@ -80,7 +80,7 @@
<span :style="{ color: chooseAll ? '#1d3fff' : 'rgb(212,214,212)' }">全选</span>
</div>
<button class="cancel" @click="cancelRadio">× 取消批量</button>
<button class="sign" @click="signContract">签订电子合同</button>
<button class="sign" @click="signContract">签订征信授权书</button>
</div>
<button v-show="num == 1 && !isRadio" class="go-radio" @click="isRadio = true">
......@@ -193,6 +193,7 @@ export default {
item.checked = !item.checked;
this.chooseAll = this.showLists.every(item => item.checked);
this.$forceUpdate();
},
allChoose(status) {
this.chooseAll = status;
......
......@@ -150,7 +150,7 @@ export default {
factory_bp_id: '',
searchInput: '', // 搜索内容
pagenum: 1,
role: '',
role: '未绑定',
// multipleRole: window.localStorage.getItem('multipleRole'),
}
},
......@@ -255,7 +255,7 @@ export default {
vm.user_bp_type = bp_type
vm.user_bp_name = bp_name
vm.user_phone = user_phone
vm.user_phone = user_phone
if (bp_type === 'TENANT') {
vm.role = '主承租人'
......@@ -269,7 +269,7 @@ export default {
vm.role = '办事处'
} else if (bp_type === 'MANAGER') {
vm.role = '业务经理'
}
}
if (bp_type === 'AGENT') {
vm.isAGENT = true
} else {
......@@ -332,12 +332,16 @@ export default {
// 进入 合同查询
changeContract (e) {
let vm = this
vm.$router.push({
name: 'ContractRecords',
params: {
bp_type: e,
},
})
if (this.bp_id) {
vm.$router.push({
name: 'ContractRecords',
params: {
bp_type: e,
},
})
} else {
hlsPopup.showLongCenter('请先进行用户绑定')
}
},
// 进入合同签订
goCarConfirm () {
......
......@@ -338,6 +338,9 @@ export default {
this.nowBind = this.bindUserList[index];
window.localStorage.setItem('now_user_bp_bind_id', JSON.stringify(this.nowBind));
hlsPopup.showLongCenter('用户已切换成功');
// 获取角色列表
this.getMultipleRole();
},
})
},
......
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