update:签署e签宝合同未成功测试

This commit is contained in:
lihaoyuan 2025-12-17 15:39:56 +08:00
parent 62f680b5b0
commit 4b73774cbc
2 changed files with 61 additions and 2 deletions

View File

@ -24,3 +24,15 @@ export function doDelete(data) {
data, data,
}) })
} }
//发起签署合同
export function createByFile(data) {
return request({
url: URL.shop.esign.signFlow.createByFile,
method: 'post',
data,
headers: {
'Content-Type': 'application/json' // 明确指定JSON格式
}
})
}

View File

@ -56,7 +56,7 @@
:show-all-levels="false" :show-all-levels="false"
@change="handleChangeBizCategory" @change="handleChangeBizCategory"
clearable clearable
:disabled="isReadonly" :disabled="isReadOnly"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="__('分账比例')" prop="split_ratio"> <el-form-item :label="__('分账比例')" prop="split_ratio">
@ -112,6 +112,21 @@
{{ item.label }} {{ item.label }}
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
</el-form-item>
<el-form-item label="E签宝合同" prop="esign_contract_file_url">
<template v-if="form.esign_contract_file_url">
<el-button type="primary" size="small" @click="downloadContract" style="margin-right: 10px;">
点击下载
</el-button>
<el-button type="warning" size="small" @click="resignContract">
重新签署合同
</el-button>
</template>
<template v-else>
<el-button type="primary" size="small" @click="signContract">
签署合同
</el-button>
</template>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
v-if="false" v-if="false"
@ -140,7 +155,7 @@
import { translateTitle as __ } from '@/utils/i18n' import { translateTitle as __ } from '@/utils/i18n'
import { doEdit, FindStoreLevel, storeSetUp } from '@/api/store/base' import { doEdit, FindStoreLevel, storeSetUp } from '@/api/store/base'
import { GetStoreClassify } from '@/api/base/store/category' import { GetStoreClassify } from '@/api/base/store/category'
import { getList as getSubsite } from '@/api/plantform/subsite' import { getList as getSubsite,createByFile} from '@/api/plantform/subsite'
import { import {
getStoreCategories getStoreCategories
} from '@/api/shopAudit/shopAudit' } from '@/api/shopAudit/shopAudit'
@ -161,6 +176,8 @@ export default {
store_o2o_flag: 0, store_o2o_flag: 0,
subsite_id: 0, subsite_id: 0,
split_ratio:0, split_ratio:0,
esign_contract_file_url: '', //
store_id:''
}, },
rules: { rules: {
user_password: [ user_password: [
@ -334,6 +351,36 @@ export default {
} }
this.dialogFormVisible = true; this.dialogFormVisible = true;
}, },
downloadContract() {
if (!this.form.esign_contract_file_url) return;
//
window.open(this.form.esign_contract_file_url, '_blank');
},
//
async signContract() {
if (!this.form.store_id) {
this.$message.warning('请先保存店铺基本信息,再签署合同');
return;
}
try {
const res = await createByFile({ store_id: this.form.store_id });
if (res.status === 200 && res.data) {
window.open(res.data.url, '_blank');
// this.$emit('fetch-data');
} else {
this.$message.error(res.msg || '签署失败');
}
} catch (e) {
this.$message.error('签署接口异常');
}
},
//
async resignContract() {
//
await this.signContract();
},
close() { close() {
this.form = { this.form = {
store_is_selfsupport: 1, store_is_selfsupport: 1,