修改协议

This commit is contained in:
何童崇 2022-03-08 13:51:51 +08:00
parent 3ac6021d9e
commit ff0515281b
6 changed files with 123 additions and 7 deletions

View File

@ -38,7 +38,7 @@ export default props => {
<Menu.Item><a href={`${main_web_site_url}/admin/industries/list`}>行业信息</a></Menu.Item>
<Menu.Item><a href={`${main_web_site_url}/admin/placements/list`}>职位信息</a></Menu.Item>
<Menu.Item><a href={`${main_web_site_url}/admin/task_templates/list`}>需求导入模板</a></Menu.Item>
<Menu.Item><a href={`${main_web_site_url}/admin/agreement_setting`}>签订协议内容</a></Menu.Item>
<Menu.Item><Link to="/managements/task/agreement/content">协议签订模板</Link></Menu.Item>
<Menu.Item><a href={`${main_web_site_url}/admin/sign_agreement_setting`}>应征投稿协议内容</a></Menu.Item>
</SubMenu>
<SubMenu title="代办事项" >

View File

@ -44,6 +44,12 @@ const AgreementManage = Loadable({
loading: Loading,
});
// 协议签订模板
const AgreementContent = Loadable({
loader: () => import("./task/agreementContent"),
loading: Loading,
});
const PayProof = Loadable({
loader: () => import("./task/payProof"),
loading: Loading,
@ -146,6 +152,14 @@ const Managements = (propsF) => {
)}
></Route>
{/* 协议内容 */}
<Route
path="/managements/task/agreement/content"
render={(props) => (
<AgreementContent {...propsF} {...props} />
)}
></Route>
{/* 管理员上传支付凭证 */}
<Route
path="/managements/task/payProof"

View File

@ -0,0 +1,86 @@
import React, { useCallback, useEffect, useState } from "react";
import { Input, Button, Form, Select } from "antd";
import MDEditor from "../../../modules/tpm/challengesnew/tpm-md-editor";
import {getAgreement, agreementEdit } from "../api";
import "../index.scss";
export default Form.create()(({ form, showNotification, match, history }) => {
const { getFieldDecorator, validateFields, setFieldsValue } = form;
useEffect(()=>{
getAgreement().then(res=>{
console.log(res);
})
},[])
// 保存wiki文件包括新增和修改
function saveFile() {
validateFields((err, values) => {
if (!err) {
let regEn = /[\[\]`\/:*?''<>|%-+_]/g;
if (regEn.test(values.name)) {
message.error("文件名不能有特殊字符");
return;
}
agreementEdit({
owner,
repo: projectsId,
projectId: project.id,
pagename: wikiName,
...values,
commit_message: "",
}).then((res) => dealRes(res));
}
});
}
const helper = useCallback(
(label, name, rules, widget, initialValue, rightComponent) => (
<Form.Item label={label} className="mb0">
{getFieldDecorator(name, { rules, initialValue, validateFirst: true })(
widget
)}
{rightComponent}
</Form.Item>
),
[]
);
return (
<div>
{/* {helper(
"协议名称",
"name",
[
{ required: true, message: "请输入协议名称" },
// { pattern: /[^`\[\]\/:*?''<>|%-+_]/g, message: '不允许部分特殊字符' }
],
"协议模板",
<Input
placeholder={"请输入协议名称"}
className="contact-input"
maxLength={50}
/>
)} */}
{/* <Form.Item className="mb0">
<MDEditor
placeholder={"请输入协议内容"}
height={500}
mdID={"order-new-description"}
initValue={content}
onChange={onContentChange}
className="mt20"
></MDEditor>
{getFieldDecorator("content", {
rules: [{ required: true, message: "请输入协议内容" }],
validateFirst: true,
})(<Input style={{ display: "none" }} />)}
</Form.Item> */}
<Button className="mt25" type="primary" onClick={saveFile}>
保存
</Button>
</div>
);
});

View File

@ -288,12 +288,28 @@ export function checkHavePaper(taskId) {
});
}
// 新增协议
export function agreementAdd() {
return fetch({
url: '/api/paper/agreementSettings/',
method: 'post'
});
}
// 修改协议
export function agreementEdit() {
return fetch({
url: '/api/paper/agreementSettings/',
method: 'put'
});
}
// 获取协议
export function getAgreement() {
export function getAgreement(params) {
return fetch({
url: '/api/paper/agreementSettings/1',
method: 'get'
url: `/api/paper/agreementSettings/${params==1?params:''}`,
method: 'get',
params:params!=1?params:null
});
}

View File

@ -55,8 +55,8 @@ export default Form.create()(props => {
<div className="task-popup-content">
{/* paperAuditing */}
{checkedItem.paperAuditing && <p className=" mb10 color-orange task_tip">审核意见{checkedItem.paperAuditing.message}</p>}
<a href="https://task.osredm.com/busiAttachments/download/121" className="icon icon-attachment font-13 color-blue" length="32">协议.word</a>
<Form.Item className="upload-form" label="附件上传" required={true}>
<a href="https://task.osredm.com/busiAttachments/download/121" className="icon icon-attachment font-13 color-blue" length="32">协议.word</a>
<Form.Item className="upload-form" label="协议上传" required={true}>
<Upload
load={uploadFunc}
size={50}

View File

@ -114,7 +114,7 @@ export default Form.create()(
//
useEffect(() => {
applyModal && getAgreement().then(res => {
applyModal && getAgreement(1).then(res => {
if (res && res.data) {
setApplyContent({
title: res.data.title,