Commit 26838156 authored by wanghf's avatar wanghf

seal-签约盖章

parent b171753c
......@@ -34,6 +34,22 @@ export function addLaborSign(data) {
data: data
})
}
// 新增代发合约签订前--预览合同文件
export function applySignPreGenFile(data) {
return request({
url: '/business/laborSign/applySignPreGenFile',
method: 'post',
data: data
})
}
// 签订合同
export function confirmSignContract(data) {
return request({
url: '/business/laborSign/confirmSignContract',
method: 'post',
data: data
})
}
// 修改代发合约签订
export function updateLaborSign(data) {
......@@ -59,6 +75,13 @@ export function agreeSign(id) {
method: 'post'
})
}
export function agreeSeal(data) {
return request({
url: '/business/laborSign/agreeSeal',
method: 'post',
data: data
})
}
// 删除代发合约签订
export function giveAccToLabor(laborId) {
......
......@@ -62,21 +62,37 @@
</el-dialog>
<!-- 点击签约后查看合同 -->
<el-dialog title="签约合同" :visible.sync="signContractPanelVisible" append-to-body width="45%" center>
<iframe
src="http://admin.xinruit.com/stage-api/profile/upload/2025/04/17/2c90b129-f55c-48a7-9e13-86b48b3354ab.pdf"
frameborder="0" style="width: 100%;height:500px"></iframe>
<el-steps :active="active" finish-status="success" simple style="margin-top: 20px">
<el-step title="1、签订合同"></el-step>
<el-step title="2、确认签约"></el-step>
</el-steps>
<div class="demo-form" v-if="active == 1">
<div style="margin: 20px;padding: 20px;">
<iframe :src=this.contractUrl style="width:100%;height:600px;" frameborder="0"></iframe>
</div>
<div slot="footer" class="dialog-footer" style="text-align: center;">
<el-button type="primary" @click.native="confirmSealContractFile">确认签订合同</el-button>
</div>
</div>
<div class="demo-form" v-if="active == 2">
<div style="margin: 20px;padding: 20px;">
<iframe :src=this.contractUrl style="width:100%;height:600px;" frameborder="0"></iframe>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="signContractPaneSubmit">确 定</el-button>
<el-button @click="signContractPanelCancel">取 消</el-button>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import { listToSignUnit } from '@/api/business/unitInfo'
import { addLaborSign } from '@/api/business/laborSign'
import { addLaborSign, applySignPreGenFile, confirmSignContract } from '@/api/business/laborSign'
import { listAllCompanyInfo } from '@/api/business/companyInfo'
import { signContractFile } from '@/api/business/onlineTaskInfo'
export default {
name: "taxSignComponent",
......@@ -85,6 +101,11 @@ export default {
},
data() {
return {
// 合同url
contractUrl: '',
// 步骤条
active: 1,
payerCompanyArr: [],
signForm: {
taxUnitId: null,
......@@ -178,7 +199,48 @@ export default {
this.signContractPanelVisible = false;
},
submitSignForm() {
this.signContractPanelVisible = true
this.$modal.loading();
this.signForm.contractUrl = "pre";
applySignPreGenFile(this.signForm).then(resp => {
if (200 === resp.code) {
this.$modal.msgSuccess("操作成功!");
this.signContractPanelVisible = true;
this.contractUrl = resp.data;
this.signForm.contractUrl = resp.data;
}else {
this.$modal.msgError(resp.message);
}
}).catch(() => {
this.signContractPanelVisible = false;
this.signPanel = false
}).finally(() => {
this.$modal.closeLoading();
})
},
confirmSealContractFile() {
// TODO 确认框
// this.$modal.confirm('是否确认签订合同?').then(() => {
// 添加 loading 提示
this.$modal.loading("正在签订合同,请稍候...");
confirmSignContract(this.signForm).then(response => {
if (response.code === 200) {
this.$modal.msgSuccess("签订合同成功");
this.contractUrl = response.data;
this.signForm.contractUrl = response.data;
this.active = 2;
} else {
this.$modal.msgError("签订合同失败:" + (response.msg || "未知错误"));
}
}).catch(error => {
console.error("签订合同接口调用失败", error);
this.$modal.msgError("签订合同失败,请稍后再试");
}).finally(() => {
this.$modal.closeLoading()
});
// }).catch(() => {
// // 用户取消操作
// this.$modal.msgError("已取消签订合同");
// });
}
},
};
......
......@@ -52,11 +52,9 @@
</el-table>
<!-- 点击签约后查看合同 -->
<el-dialog title="签约合同" :visible.sync="doAgreePanelVisible" width="58%" center>
<iframe
src="http://admin.xinruit.com/stage-api/profile/upload/2025/04/17/2c90b129-f55c-48a7-9e13-86b48b3354ab.pdf"
frameborder="0" style="width: 100%;height:600px"></iframe>
<iframe :src=this.contractUrl frameborder="0" style="width: 100%;height:600px"></iframe>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="doAgreePanelSubmit">确 定</el-button>
<el-button type="primary" @click="confirmSealContractFile">确认盖章签约</el-button>
<el-button @click="doAgreePanelCancel">取 消</el-button>
</div>
</el-dialog>
......@@ -67,13 +65,16 @@
<script>
import { querySignList } from '@/api/business/unitInfo'
import { agreeSign, giveAccToLabor } from '@/api/business/laborSign'
import { agreeSeal, agreeSign, confirmSignContract, giveAccToLabor } from '@/api/business/laborSign'
export default {
name: 'signList',
dicts: ['tax_labor_sign_status'],
data() {
return {
// 合同url
contractUrl: '',
// 遮罩层
loading: true,
// 显示搜索条件
......@@ -127,8 +128,62 @@ export default {
},
doAgree(row) {
this.doAgreeData = row
this.contractUrl = row.contractUrl
this.doAgreePanelVisible = true
},
async confirmSealContractFile() {
const confirmResult = await this.$confirm(`确认签订与${this.doAgreeData.inviterName}的合约吗?`, '操作提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).catch(() => {
// 用户取消操作,不做任何处理
return false;
});
console.log("doAgreeData", JSON.stringify(this.doAgreeData))
if (!confirmResult) return;
this.$modal.loading("正在签订合同,请稍候...");
const signObj = {
contractUrl: this.doAgreeData.contractUrl,
inviterId: this.doAgreeData.inviterId,
taxUnitId: this.doAgreeData.taxUnitId,
};
try {
const response = await confirmSignContract(signObj);
if (response.code === 200) {
const contractUrl = response.data;
if (!contractUrl) {
this.$modal.msgError("签订合同失败:返回合同地址为空");
return;
}
this.$modal.msgSuccess("签订合同成功");
// this.contractUrl = contractUrl;
// this.doAgreeData.contractUrl = contractUrl;
const sealObj = {
id: this.doAgreeData.id,
contractUrl:contractUrl,
inviterId: this.doAgreeData.inviterId,
taxUnitId: this.doAgreeData.taxUnitId,
};
console.log("sealObj", JSON.stringify(sealObj))
const resp = await agreeSeal(sealObj);
if (resp.code === 200) {
this.$modal.msgSuccess("签订合同成功");
this.doAgreePanelVisible = false;
this.getList();
}else {
this.$modal.msgError("签订合同失败:" + (resp.msg || "未知错误"));
}
} else {
this.$modal.msgError("签订合同失败:" + (this.$options.filters.escapeHtml(response.msg) || "未知错误"));
}
} catch (error) {
console.error("签订合同接口调用失败", error);
this.$modal.msgError("签订合同失败,请稍后再试");
} finally {
this.$modal.closeLoading();
}
},
doAgreePanelSubmit() {
this.$confirm(`确认签订与${this.doAgreeData.inviterName}的合约吗?`, '操作提示', {
confirmButtonText: '确定',
......
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