Procházet zdrojové kódy

设置项目预算 初步

XuZinan před 2 roky
rodič
revize
fb03e0fd5d

+ 1 - 1
config/config.js

@@ -142,7 +142,7 @@ export default {
     '/api': {
       // target: 'http://192.168.20.152:8888/',
       // target: 'http://120.55.44.4:8896/',
-      target: 'http://47.96.12.136:8896/',
+      target: 'http://47.96.12.136:8899/',
       // target: 'http://oraysmart.com:8889/',
       // target: 'http://oraysmart.com:8888/api',
       // changeOrigin: true,

+ 54 - 0
src/pages/PurchaseAdmin/PurchaseList/Approval/BudgetModal.js

@@ -0,0 +1,54 @@
+import React, { useEffect } from 'react';
+import { Form, Modal, InputNumber } from 'antd';
+import { connect } from 'dva';
+
+function BudgetModal(props) {
+  const { visible, onCancel, onOk, loading, currentItem } = props;
+  const [form] = Form.useForm();
+
+  const subTypeList = [
+    { name: '建设期项目管理人员', code: '02-010' },
+    { name: '工程设计人日(含BIM设计)', code: '04-010' },
+    { name: '设计联络人日', code: '05-010' },
+    { name: '金科陪客户设计联络/培训人日', code: '05-050' },
+    { name: '采购和质量控制人日', code: '06-010' },
+    { name: '双胞胎运营平台实施人日', code: '07-010' },
+    { name: '预算审核及费控人日', code: '08-010' },
+    { name: '现场安装/调试/性能测试/试运行人日', code: '10-010' },
+    { name: '质保期项目经理人日', code: '11-010' },
+    { name: '质保期服务工程师人日', code: '11-030' },
+    { name: '运营期项目管理人员', code: '02-030' },
+    { name: '运营期培训人日', code: '05-070' },
+    { name: '运营期采购和质量控制人日', code: '06-030' },
+    { name: '运营期预算审核及费控人日', code: '08-030' },
+    { name: '质保采购工程师人日', code: '11-050' },
+    { name: '投资技术服务人日', code: '18-010' },
+    { name: '运营期技术服务人日', code: '18-030' },
+  ];
+
+  const handleOk = () => {
+    onOk();
+  };
+
+  return (
+    <Modal
+      title="项目预算"
+      visible={visible}
+      width={800}
+      onOk={handleOk}
+      onCancel={onCancel}
+      confirmLoading={loading}
+      destroyOnClose
+    >
+      <Form labelCol={{ span: 10 }} wrapperCol={{ span: 10 }}>
+        {subTypeList.map(item => (
+          <Form.Item label={item.name} name={item.code} initialValue={0}>
+            <InputNumber min={0} style={{ width: '100%' }} />
+          </Form.Item>
+        ))}
+      </Form>
+    </Modal>
+  );
+}
+
+export default BudgetModal;

+ 22 - 16
src/pages/PurchaseAdmin/PurchaseList/Approval/List.js

@@ -8,27 +8,16 @@ import DetailModal from './DetailModal';
 import ExecutionModal from './ExecutionModal';
 import MemberModal from './MemberModal';
 import QualityOperateModal from './QualityOperateModal';
+import BudgetModal from './BudgetModal';
 import { connect } from 'dva';
 
 const { Option } = Select;
 //状态
 const STATUS = [
-  {
-    value: 0,
-    label: '售前',
-  },
-  {
-    value: 1,
-    label: '转执行',
-  },
-  {
-    value: 2,
-    label: '转运营',
-  },
-  {
-    value: 3,
-    label: '转质保',
-  },
+  { value: 0, label: '售前' },
+  { value: 1, label: '转执行' },
+  { value: 2, label: '转运营' },
+  { value: 3, label: '转质保' },
 ];
 
 function List(props) {
@@ -49,6 +38,7 @@ function List(props) {
   const [executionVisible, setExecutionVisible] = useState(false);
   const [qualityOperateVisible, setQualityOperateVisible] = useState(false);
   const [memberVisible, setMemberVisible] = useState(false);
+  const [budgetVisible, setBudgetVisible] = useState(false);
   const [selfItems, setSelfItems] = useState(false);
   const [currentItem, setCurrentItem] = useState({});
   const [qualityOperate, setQualityOperate] = useState(0);
@@ -352,6 +342,15 @@ function List(props) {
     );
     let statusBtn = (
       <>
+        <a
+          onClick={() => {
+            setCurrentItem(record);
+            setBudgetVisible(true);
+          }}
+        >
+          设置人日预算
+        </a>
+        <Divider type="vertical" />
         <a
           onClick={() => {
             setCurrentItem(record);
@@ -537,6 +536,13 @@ function List(props) {
         onClose={() => setQualityOperateVisible(false)}
         qualityOperate={qualityOperate}
       />
+      <BudgetModal
+        visible={budgetVisible}
+        loading={loading}
+        currentItem={currentItem}
+        onCancel={() => setBudgetVisible(false)}
+        onOk={() => setBudgetVisible(false)}
+      />
     </div>
   );
 }

+ 18 - 0
src/pages/PurchaseAdmin/PurchaseList/Approval/models/approval.js

@@ -16,6 +16,8 @@ import {
   startOperate,
   startQuality,
   deleteMember,
+  queryBudget,
+  setBudget,
 } from '@/services/approval';
 import { message } from 'antd';
 import moment from 'moment';
@@ -63,6 +65,7 @@ export default {
     filter: {},
     depUserTree: [],
     member: [],
+    budget: [],
   },
 
   effects: {
@@ -240,6 +243,21 @@ export default {
         type: 'queryApproval',
       });
     },
+
+    *queryBudget({ payload }, { call, put }) {
+      const res = yield call(queryBudget, payload);
+      if (!res) return;
+      yield put({
+        type: 'save',
+        payload: { budget: res.data },
+      });
+    },
+
+    *setBudget({ payload, callback }, { call, put }) {
+      const res = yield call(setBudget, payload);
+      if (!res) return;
+      message.success('项目预算设置成功');
+    },
   },
 
   reducers: {

+ 13 - 0
src/services/approval.js

@@ -110,3 +110,16 @@ export async function deleteMember(data) {
     method: 'DELETE',
   });
 }
+
+//获取项目预算
+export async function queryBudget(params) {
+  return request(`/api/v2/workload/project/budget?${stringify(params)}`);
+}
+
+//设定项目预算
+export async function setBudget(params) {
+  return request(`/api/v2/workload/project/budget`, {
+    method: 'POST',
+    body: params,
+  });
+}