Kaynağa Gözat

Merge branch 'master' of http://120.55.44.4:10080/xujunjie/GtDigManageWeb

XuZinan 2 yıl önce
ebeveyn
işleme
739db75977

+ 5 - 1
.umirc.ts

@@ -52,6 +52,11 @@ export default defineConfig({
         },
       ],
     },
+    {
+      name: 'OA审批',
+      path: '/oa',
+      component: './Flow/Oa',
+    },
     {
       name: '权限演示',
       path: '/access',
@@ -77,7 +82,6 @@ export default defineConfig({
       name: '合同管理',
       path: '/contract-manager',
       component: './ContractManager/index',
-      layout: false,
     },
   ],
   npmClient: 'yarn',

+ 1 - 0
package.json

@@ -16,6 +16,7 @@
     "@antv/xflow": "^1.0.55",
     "@umijs/max": "^4.0.64",
     "antd": "^5.0.0",
+    "moment": "^2.29.4",
     "qs": "^6.11.1",
     "umi-request": "^1.4.0"
   },

+ 6 - 4
src/app.tsx

@@ -4,6 +4,7 @@ import { message } from 'antd';
 import UserDropdown from '@/components/UserDropdown';
 import { getToken } from '@/utils/utils';
 import { history } from 'umi';
+import logo from "@/assets/logo.jpg"
 
 // 全局初始化数据配置,用于 Layout 用户信息和权限初始化
 // 更多信息见文档:https://umijs.org/docs/api/runtime-config#getinitialstate
@@ -14,14 +15,15 @@ export async function getInitialState(): Promise<{ name: string }> {
 export const layout: RunTimeLayoutConfig = (initialState) => {
   return {
     navTheme: 'light',
-    layout: 'top',
+    layout: 'side',
     contentWidth: 'Fluid',
-    fixedHeader: true,
-    fixSiderbar: true,
+    title: "",
+    // fixedHeader: true,
+    // fixSiderbar: true,
     rightRender(initialState, setInitialState, runtimeConfig) {
       return <UserDropdown />;
     },
-    logo: null,
+    logo: <img src={logo} style={{height: 28}} />,
   };
 };
 

BIN
src/assets/logo.jpg


+ 18 - 18
src/components/Flow/node/registerNode.tsx

@@ -6,24 +6,24 @@ import AuditNode, { AuditServe } from './auditNode';
 import judgeNode, { judgeServe } from './judgeNode';
 
 export const registerNode = [
-  {
-    component: Rect,
-    popover: () => <div>业务组件</div>,
-    name: 'custom-rect',
-    width: 120,
-    height: 50,
-    label: '业务节点',
-    service: RectServe,
-  },
-  {
-    component: Circle,
-    popover: () => <div>审批节点</div>,
-    name: 'custom-circle',
-    width: 90,
-    height: 90,
-    label: '审批节点',
-    service: CircleServe,
-  },
+  // {
+  //   component: Rect,
+  //   popover: () => <div>业务组件</div>,
+  //   name: 'custom-rect',
+  //   width: 120,
+  //   height: 50,
+  //   label: '业务节点',
+  //   service: RectServe,
+  // },
+  // {
+  //   component: Circle,
+  //   popover: () => <div>审批节点</div>,
+  //   name: 'custom-circle',
+  //   width: 90,
+  //   height: 90,
+  //   label: '审批节点',
+  //   service: CircleServe,
+  // },
   {
     component: AuditNode,
     popover: () => <div>动作节点</div>,

+ 0 - 1
src/global.less

@@ -3,7 +3,6 @@
   box-sizing: border-box;
 }
 
-body,
 #root {
   min-height: 100vh;
 }

+ 1 - 1
src/models/user.js

@@ -47,7 +47,7 @@ export default {
 
   state: {
     list: [],
-    currentUser: { Permission: {} },
+    // currentUser: { Permission: {} },
     message: {},
     userList: [],
     depRole: [],

+ 106 - 23
src/pages/ContractManager/component/Modal.jsx

@@ -8,13 +8,38 @@ import {
   Upload,
   Button,
   Divider,
+  Steps,
 } from 'antd';
 import ModuleTitle from '../../../components/ModuleTitle/moduleTitle';
 import { CloudUploadOutlined } from '@ant-design/icons';
+import moment from 'moment';
 
 const ContractModal = (props) => {
-  const { title, visible, handleOk, handleCancel } = props;
+  const Type = {
+    add: 0, //新增
+    detail: 1, //详情
+    cancel: 2, //作废
+  };
+  const FORMAT = 'YYYY-MM-DD';
+  const { title, type, visible, handleOk, handleCancel } = props;
   const [form] = Form.useForm();
+  const data = {
+    company_name: 'hdhdhdh',
+    name: 'kkkk',
+    effect_on: moment('2020-02-02'),
+    party_a: 'aaaaa',
+    party_b: 'bbbbbb',
+    party_c: 'ccccc',
+    created_dep: 'fffff',
+    dep_id: '1111',
+    code: '132456',
+    amount: '1111111111777',
+    project_code: '444444',
+    deal_by: 'hhhhh',
+    perform: 'dnjfndjfnjdnfjd',
+    created_by: '77777',
+    created_on: moment().format(FORMAT),
+  };
 
   const UploadProps = {
     action: 'https://www.mocky.io/v2/5cc8019d300000980a055e76',
@@ -48,6 +73,17 @@ const ContractModal = (props) => {
     ],
   };
 
+  const handleSubmit = () => {
+    form.validateFields().then((values) => {
+      console.log(values);
+      let timeObj = {
+        effect_on: moment(values.effect_on).format(FORMAT),
+        created_on: values.created_on || moment().format(FORMAT),
+      };
+      handleOk({ ...values, ...timeObj });
+    });
+  };
+
   return (
     <Modal
       width={'85%'}
@@ -55,16 +91,21 @@ const ContractModal = (props) => {
       open={visible}
       okText="提交"
       cancelText="返回"
-      onOk={handleOk}
+      onOk={handleSubmit}
       onCancel={handleCancel}
     >
       <Divider />
       <ModuleTitle title="合同信息" />
-      <Form labelCol={{ span: 7 }} wrapperCol={{ span: 17 }}>
+      <Form
+        form={form}
+        initialValues={data}
+        labelCol={{ span: 7 }}
+        wrapperCol={{ span: 17 }}
+      >
         <Row>
           <Col span={10} offset={1}>
             <Form.Item
-              name="email"
+              name="company_name"
               label="所属公司:"
               tooltip="所属公司"
               rules={[
@@ -77,7 +118,7 @@ const ContractModal = (props) => {
               <Input />
             </Form.Item>
             <Form.Item
-              name="email"
+              name="name"
               label="合同名称:"
               tooltip="合同名称"
               rules={[
@@ -90,7 +131,7 @@ const ContractModal = (props) => {
               <Input />
             </Form.Item>
             <Form.Item
-              name="email"
+              name="effect_on"
               label="合同生效日期:"
               rules={[
                 {
@@ -102,7 +143,7 @@ const ContractModal = (props) => {
               <DatePicker />
             </Form.Item>
             <Form.Item
-              name="email"
+              name="party_a"
               label="甲方:"
               rules={[
                 {
@@ -111,10 +152,10 @@ const ContractModal = (props) => {
                 },
               ]}
             >
-              <DatePicker />
+              <Input />
             </Form.Item>
             <Form.Item
-              name="email"
+              name="party_c"
               label="丙方(及其他):"
               rules={[
                 {
@@ -123,10 +164,10 @@ const ContractModal = (props) => {
                 },
               ]}
             >
-              <DatePicker />
+              <Input />
             </Form.Item>
             <Form.Item
-              name="email"
+              name="created_dep"
               label="签约承办部门:"
               rules={[
                 {
@@ -135,12 +176,12 @@ const ContractModal = (props) => {
                 },
               ]}
             >
-              <DatePicker />
+              <Input />
             </Form.Item>
           </Col>
           <Col span={10}>
             <Form.Item
-              name="email"
+              name="dep_id"
               label="所属部门:"
               rules={[
                 {
@@ -151,7 +192,7 @@ const ContractModal = (props) => {
             >
               <Input />
             </Form.Item>
-            <Form.Item name="email" label="合同编号:">
+            <Form.Item name="code" label="合同编号:">
               <Input disabled />
             </Form.Item>
 
@@ -160,7 +201,7 @@ const ContractModal = (props) => {
                 <Col span={12}>
                   <Form.Item
                     style={{ marginBottom: 0 }}
-                    name="email"
+                    name="amount"
                     rules={[
                       {
                         required: true,
@@ -172,16 +213,16 @@ const ContractModal = (props) => {
                   </Form.Item>
                 </Col>
                 <Col span={12}>
-                  <div>万元</div>
+                  <div style={{ lineHeight: '32px' }}>万元</div>
                 </Col>
               </Row>
             </Form.Item>
 
-            <Form.Item name="email" label="项目编号:">
+            <Form.Item name="project_code" label="项目编号:">
               <Input disabled />
             </Form.Item>
             <Form.Item
-              name="email"
+              name="party_b"
               label="乙方:"
               rules={[
                 {
@@ -193,7 +234,7 @@ const ContractModal = (props) => {
               <Input />
             </Form.Item>
             <Form.Item
-              name="email"
+              name="deal_by"
               label="经办人:"
               rules={[
                 {
@@ -206,26 +247,68 @@ const ContractModal = (props) => {
             </Form.Item>
           </Col>
         </Row>
-        <Form.Item name="email" label="合同履行情况:" labelCol={{ span: 4 }}>
+        <Form.Item name="perform" label="合同履行情况:" labelCol={{ span: 4 }}>
           <Input.TextArea />
         </Form.Item>
-        <Form.Item name="email" label="合同上传:" labelCol={{ span: 4 }}>
+        <Form.Item label="合同上传:" labelCol={{ span: 4 }}>
           <Upload {...UploadProps}>
             <Button icon={<CloudUploadOutlined />}>Upload</Button>
           </Upload>
         </Form.Item>
         <Row>
           <Col span={10} offset={1}>
-            <Form.Item name="email" label="创建人:">
+            <Form.Item name="created_by" label="创建人:">
               <Input disabled />
             </Form.Item>
           </Col>
           <Col span={10}>
-            <Form.Item name="email" label="创建时间:">
+            <Form.Item name="created_on" label="创建时间:">
               <Input disabled />
             </Form.Item>
           </Col>
         </Row>
+        {type == Type.detail && (
+          <>
+            <ModuleTitle title="归档流程" />
+            <Steps
+              current={1}
+              items={[
+                {
+                  title: 'Finished',
+                  description,
+                },
+                {
+                  title: 'In Progress',
+                  description,
+                  subTitle: 'Left 00:00:08',
+                },
+                {
+                  title: 'Waiting',
+                  description,
+                },
+              ]}
+            />
+          </>
+        )}
+        {type == Type.cancel && (
+          <>
+            <ModuleTitle title="作废信息" />
+            <Form.Item
+              name="cancel_desc"
+              label="作废原因:"
+              labelCol={{ span: 4 }}
+            >
+              <Input />
+            </Form.Item>
+            <Form.Item
+              name="cancel_on"
+              label="创建时间:"
+              labelCol={{ span: 4 }}
+            >
+              <Input defaultValue={moment(new Date()).format('YYYY-MM-DD')} />
+            </Form.Item>
+          </>
+        )}
       </Form>
       <Divider />
     </Modal>

+ 18 - 7
src/pages/ContractManager/index.jsx

@@ -2,11 +2,13 @@ import React, { useState } from 'react';
 import { Button, DatePicker, Input, Select, Space, Table } from 'antd';
 import styles from './index.less';
 import ContractModal from './component/Modal';
+import { PageContainer } from '@ant-design/pro-components';
+import { useRequest } from '@umijs/max';
+import { queryContract } from '../../services/contract';
 
 const ConteactManager = () => {
   const [searchData, setSearchData] = useState({});
   const [visible, setVisible] = useState(false);
-  console.log(searchData);
 
   const columns = [
     {
@@ -76,7 +78,7 @@ const ConteactManager = () => {
       },
     },
   ];
-  const data = [
+  const dataSource = [
     {
       key: 1,
       name: 'John Brown sr.',
@@ -141,6 +143,10 @@ const ConteactManager = () => {
     },
   ];
 
+  const { data, run } = useRequest((data) => queryContract(data), {
+    manual: true,
+  });
+
   const handlePreView = () => {
     // originFileObj 是读取的文件对象,如上传组件读取到的
     // const fileURL = URL.createObjectURL(originFileObj);
@@ -152,8 +158,13 @@ const ConteactManager = () => {
   const handleChange = () => {};
   const handleSearch = () => {};
   const handleExport = () => {};
+
+  const handleOk = (data) => {
+    console.log('-----------', data);
+    run(data);
+  };
   return (
-    <div className={styles.main}>
+    <PageContainer>
       <div className={styles.searchContent}>
         <div className={styles.itemFlex}>
           <div>合同生效日期:</div>
@@ -217,14 +228,14 @@ const ConteactManager = () => {
           导出
         </Button>
       </div>
-      <Table columns={columns} dataSource={data} />
+      <Table columns={columns} dataSource={dataSource} />
       <ContractModal
         title="新增"
         visible={visible}
-        handleOk={() => {}}
-        handleCancel={() => {}}
+        handleOk={handleOk}
+        handleCancel={() => setVisible(false)}
       />
-    </div>
+    </PageContainer>
   );
 };
 export default ConteactManager;

+ 1 - 3
src/pages/ContractManager/index.less

@@ -1,6 +1,5 @@
 
-.main{
-  padding: 20px;
+
 .searchContent{
   display: flex;
   align-items: center;
@@ -22,5 +21,4 @@
     position: absolute;
     right: 0;
   }
-}
 }

+ 7 - 1
src/pages/Flow/AuditModal.js

@@ -1,5 +1,5 @@
 import React, { useEffect } from "react";
-import { Modal, Input, Form } from "antd";
+import { Modal, Input, Form, Select } from "antd";
 
 // 审批意见
 function AuditModal(props) {
@@ -31,6 +31,12 @@ function AuditModal(props) {
         <Form.Item label="详情" name="desc">
           <Input.TextArea />
         </Form.Item>
+        <Form.Item label="分类" name="desc">
+          <Select options={[
+            {value: 1,label: "BOM"},
+            {value: 2,label: "OA"},
+          ]}></Select>
+        </Form.Item>
       </Form>
     </Modal>
   );

+ 174 - 0
src/pages/Flow/Oa.js

@@ -0,0 +1,174 @@
+import React from 'react';
+import { Collapse, Layout, List } from 'antd';
+import {
+  UserOutlined,
+  FileOutlined,
+  EditOutlined,
+  ExceptionOutlined,
+} from '@ant-design/icons';
+import { PageContainer } from '@ant-design/pro-components';
+import { Link } from '@umijs/max';
+
+const { Sider, Content } = Layout;
+const { Panel } = Collapse;
+
+const categories = [
+  {
+    name: '请假审批',
+    items: [
+      {
+        name: '病假申请',
+        icon: <UserOutlined />,
+      },
+      {
+        name: '事假申请',
+        icon: <FileOutlined />,
+      },
+      {
+        name: '探亲假申请',
+        icon: <UserOutlined />,
+      },
+      {
+        name: '婚假申请',
+        icon: <UserOutlined />,
+      },
+      {
+        name: '产假申请',
+        icon: <UserOutlined />,
+      },
+      {
+        name: '陪产假申请',
+        icon: <UserOutlined />,
+      },
+      {
+        name: '丧假申请',
+        icon: <UserOutlined />,
+      },
+    ],
+  },
+  {
+    name: '加班审批',
+    items: [
+      {
+        name: '普通加班申请',
+        icon: <EditOutlined />,
+      },
+      {
+        name: '周末加班申请',
+        icon: <EditOutlined />,
+      },
+      {
+        name: '节假日加班申请',
+        icon: <EditOutlined />,
+      },
+    ],
+  },
+  {
+    name: '报销审批',
+    items: [
+      {
+        name: '差旅费报销',
+        icon: <FileOutlined />,
+      },
+      {
+        name: '通讯费报销',
+        icon: <FileOutlined />,
+      },
+      {
+        name: '餐费报销',
+        icon: <FileOutlined />,
+      },
+      {
+        name: '办公用品采购报销办公用品采购报销办公用品采购报销办公用品采购报销',
+        icon: <FileOutlined />,
+      },
+      {
+        name: '项目费用报销',
+        icon: <FileOutlined />,
+      },
+    ],
+  },
+  {
+    name: '异常审批',
+    items: [
+      {
+        name: '物品遗失申请',
+        icon: <ExceptionOutlined />,
+      },
+      {
+        name: '客诉申请',
+        icon: <ExceptionOutlined />,
+      },
+      {
+        name: '工作计划申请',
+        icon: <ExceptionOutlined />,
+      },
+    ],
+  },
+];
+const getBackgroundColors = (index) => {
+  const backgroundColors = [
+    '#1ABC9C', // 深绿色
+    '#3498DB', // 蓝色
+    '#9B59B6', // 紫色
+    '#F1C40F', // 黄色
+    '#E67E22', // 橙色
+    '#E74C3C', // 红色
+    '#2C3E50', // 深蓝色
+    '#34495E', // 深灰色
+  ];
+
+  return backgroundColors[index % backgroundColors.length];
+};
+const Approval = () => {
+  return (
+    <PageContainer>
+      <Collapse defaultActiveKey={categories.map((category) => category.name)}>
+        {categories.map((category, index) => (
+          <Panel style={{userSelect: 'none'}} header={category.name} key={category.name}>
+            <List
+              grid={{ gutter: 16, column: 3 }}
+              dataSource={category.items}
+              renderItem={(item) => (
+                <List.Item key={item.name}>
+                  <Link
+                    to={`/oa/${item.name}`}
+                    style={{ display: 'flex', alignItems: 'center' }}
+                  >
+                    <div
+                      style={{
+                        width: 48,
+                        height: 48,
+                        borderRadius: 8,
+                        textAlign: 'center',
+                        lineHeight: '48px',
+                        color: '#fff',
+                        fontSize: 24,
+                        backgroundColor: getBackgroundColors(index),
+                      }}
+                    >
+                      {item.icon}
+                    </div>
+                    <span
+                      style={{
+                        marginLeft: 12,
+                        flex: 1,
+                        fontSize: 18,
+                        maxWidth: '100%',
+                        paddingRight: 30,
+                      }}
+                    >
+                      {item.name}
+                    </span>
+                  </Link>
+                </List.Item>
+              )}
+            ></List>
+          </Panel>
+        ))}
+      </Collapse>
+    </PageContainer>
+  );
+};
+
+export default Approval;

+ 80 - 0
src/pages/Flow/OaDetail.js

@@ -0,0 +1,80 @@
+import React from 'react';
+import { PageContainer } from '@ant-design/pro-components';
+import { Col, Empty, Row } from 'antd';
+import ApprovalProcess from './components/ApprovalProcess';
+import { queryGetBomForm } from '@/services/boom';
+
+const OaDetail = () => {
+  const [approvalProcess, setApprovalProcess] = useState([]);
+  const items = [];
+  const initFormList = async () => {
+    const res = await queryGetBomForm({
+      project_id: version.project_id,
+      node_id: version.template_node_id,
+    });
+    if (res.data) {
+      const formList = JSON.parse(res.data.json);
+      setApprovalProcess(formList.approvalProcess || {});
+      return formList.approvalProcess;
+    }
+  };
+  //填写表单实时计算审批流程
+  const advanceSubmit = async () => {
+    console.log('重重新计算审批流程');
+    var fieldsValue = await form.validateFields();
+
+    let result = Object.values(fieldsValue)
+      .map((item) => {
+        if (item && Array.isArray(item)) return item;
+      })
+      .filter((item) => item);
+    const formList = await getFromData(result);
+    let params = {
+      desc: fieldsValue.desc,
+      // 审核流程id
+      flow_id: 0,
+      node_level_id: 0,
+      id: version.id,
+      project_id: version.project_id,
+      cur_template_node_id: version.template_node_id * 1, // 当前节点
+      next_template_node_id: 0, // 审核完成后的业务节点
+      template_node_id: null, // 将要流转的节点审批节点
+      flow_path: null, //审批节点数组
+      // 模板id.一致就行
+      template_id: version.template_id,
+      cur_template_id: version.template_id,
+      next_template_id: version.template_id,
+      form_list: formList,
+    };
+    dispatch({
+      type: 'detail/advanceSubmitNextNode',
+      payload: params, //values,
+      callback: (data) => {
+        if (data) {
+          setApprovalProcess(data);
+        }
+      },
+    });
+  };
+  return (
+    <PageContainer>
+      <Row>
+        <Col span={17}>
+          <Components items={items} onChange={advanceSubmit} />
+        </Col>
+        <Col offset={1} span={6}>
+          {approvalProcess.length == 0 ? ( //!formComponentValues[item.nodeId] ||
+            <Empty description="请先填写表单" />
+          ) : (
+            <ApprovalProcess
+              approvalProcess={approvalProcess}
+              onChange={setApprovalProcess}
+            />
+          )}
+        </Col>
+      </Row>
+    </PageContainer>
+  );
+};
+
+export default OaDetail;

+ 107 - 0
src/pages/Flow/components/ApprovalProcess.tsx

@@ -0,0 +1,107 @@
+import React, { useMemo, useState } from 'react';
+import { queryUserListByRoleID } from '@/services/boom';
+import { connect } from 'umi';
+import { PlusOutlined } from '@ant-design/icons';
+import { Popover, Radio, RadioChangeEvent, Spin, Steps } from 'antd';
+
+const { Step } = Steps;
+
+enum TYPR {
+  ROLE = 'role',
+  USER = 'user',
+}
+
+const ApprovalProcess = (props: any) => {
+  const { approvalProcess, userList, onChange, roleList = [] } = props;
+  const [selectUserList, setSelectUserList] = useState([]);
+  const [curNodeIdx, setCurNodeIdx] = useState(-1);
+  const [loading, setLoading] = useState(false);
+
+  const list = useMemo(() => {
+    return approvalProcess?.forEach((item: any) => {
+      if (item.length > 1 && item[0].type == TYPR.USER) {
+        item.forEach((curUser: any) => {
+          curUser.name =
+            userList.find((user: any) => user.ID == curUser.value)?.CName ||
+            '-';
+        });
+      } else if (item.length == 1 && item[0].type == TYPR.USER) {
+        item[0].name =
+          userList.find((user: any) => user.ID == item[0].value)?.CName || '-';
+      } else if (item.length == 1 && item[0].nowType == TYPR.USER) {
+        item[0].name =
+          userList.find((user: any) => user.ID == item[0].nowValue)?.CName ||
+          '-';
+      } else {
+        item[0].name = null;
+      }
+    });
+  }, [approvalProcess]);
+
+  const onStepsChange = async (current: any, list: any) => {
+    setLoading(true);
+    const itemNode = list[current][0];
+    if (itemNode.type !== 'role') return;
+    const data = await queryUserListByRoleID({ role_id: itemNode.value });
+    setCurNodeIdx(current);
+    setSelectUserList(data);
+    setLoading(false);
+  };
+
+  const selectedUserId = ({ target: { value } }: RadioChangeEvent) => {
+    //userId
+    const name = userList.find((user: any) => user.ID == value)?.CName || '-';
+    const data = { nowType: TYPR.USER, nowValue: Number(value), name }; //type: TYPR.USER, value: Number(value)
+    list[curNodeIdx][0] = { ...list[curNodeIdx][0], ...data };
+
+    onChange?.([...list]);
+  };
+
+  const content = (
+    <Spin spinning={loading}>
+      <Radio.Group onChange={selectedUserId}>
+        {selectUserList.map((item: any) => (
+          // <Button onClick={() => selectedUserId(item.user_id)}>{item.c_name}</Button>
+          <Radio.Button value={item.user_id}>{item.c_name}</Radio.Button>
+        ))}
+      </Radio.Group>
+    </Spin>
+  );
+
+  return (
+    <>
+      <Steps
+        current={-1}
+        direction="vertical"
+        onChange={(value) => onStepsChange(value, list)}
+      >
+        {list?.map((item: any) => (
+          <Step
+            key={item[0]?.value}
+            icon={
+              <Popover
+                placement="bottomLeft"
+                title={'选择审批人'}
+                content={content}
+                trigger="click"
+                overlayStyle={{ width: '300px' }}
+              >
+                <PlusOutlined />
+              </Popover>
+            }
+            title={
+              item[0]?.name ||
+              `从${
+                roleList?.find((cur: any) => cur.ID == item[0]?.value)?.Name
+              }选择`
+            }
+          />
+        ))}
+      </Steps>
+    </>
+  );
+};
+export default connect(({ user }: any) => ({
+  userList: user.list,
+  roleList: user.roleList,
+}))(ApprovalProcess);

+ 18 - 13
src/services/boom.js

@@ -26,6 +26,24 @@ export async function saveAuditFlowInfo(data) {
     data,
   });
 }
+export async function queryUserListByRoleID(params) {
+  let res = await request(
+    `/api/v1/purchase/process/get-role-user?${stringify(params)}`,
+    {
+      method: 'GET',
+    },
+  );
+  return res.data;
+}
+export async function queryGetBomForm(params) {
+  let res = await request(
+    `/api/v1/purchase/bom/get-bom-form?${stringify(params)}`,
+    {
+      method: 'GET',
+    },
+  );
+  return res;
+}
 // /**
 //   project_id
 //   version_id	大版本id
@@ -398,13 +416,6 @@ export async function saveAuditFlowInfo(data) {
 //   return request(`/api/v2/dep?${stringify(params)}`);
 // }
 
-// export async function queryUserListByRoleID(params) {
-//   let res = await request(`/api/v1/purchase/process/get-role-user?${stringify(params)}`, {
-//     method: 'GET',
-//   });
-//   return res.data;
-// }
-
 // //新增工作流时调用接口 给项目绑定默认分类列表
 // //purchase/bom/default-bind-classify?project_id=1
 // export async function queryDefaultBindClassify(params) {
@@ -449,12 +460,6 @@ export async function saveAuditFlowInfo(data) {
 //     body: data,
 //   });
 // }
-// export async function queryGetBomForm(params) {
-//   let res = await request(`/api/v1/purchase/bom/get-bom-form?${stringify(params)}`, {
-//     method: 'GET',
-//   });
-//   return res;
-// }
 
 // //章管家失败,重新申请用印
 // export async function queryTrySeal(params) {

+ 8 - 0
src/services/contract.js

@@ -0,0 +1,8 @@
+import { request } from 'umi';
+
+export const queryContract = (data) => {
+  return request('/api/contract/v1/contract', {
+    method: 'POST',
+    data,
+  });
+};