Forráskód Böngészése

财务报销审核

dev01 1 éve%!(EXTRA string=óta)
szülő
commit
de59a48f11

+ 21 - 1
js/component/dataDic.js

@@ -4184,11 +4184,31 @@ module.exports = {
     { value: 5, label: "申请抵扣" },
     { value: 0, label: "其他" },
   ],
+
+  typeLists: [
+    { label: '交通费', value: 1, },
+    { label: '住宿费', value: 2, },
+    { label: '市内车费', value: 3, },
+    { label: '餐费', value: 4 },
+    { label: '出差补贴', value: 5 },
+    { label: '预借支', value: 6 },
+    { label: '其他', value: 0, }
+  ],
+
+  vehiclelist: [
+    { label: '飞机', value: 1, },
+    { label: '火车或高铁', value: 2, },
+    { label: '地铁', value: 3, },
+    { label: '公交车', value: 4 },
+    { label: '其他', value: 0, },
+  ],
+
   // 报销状态
   accountStatus: [
     { value: 0, label: '未提交', color: 'red' },
-    { value: 1, label: "差旅费", color: '#f1662f' },
+    { value: 1, label: "审核中", color: '#f1662f' },
     { value: 2, label: '完成', color: '#34de38' },
     { value: 3, label: '已驳回', color: '#f31212' },
   ]
+
 };

+ 12 - 0
js/component/manageCenter/financialManage/account/accountExamine.jsx

@@ -0,0 +1,12 @@
+import React from 'react';
+import AccountReview from "./accountReview"
+
+const AccountExamine = React.createClass({
+  render() {
+    return (
+      <AccountReview isOperate={true} />
+    );
+  }
+});
+
+export default AccountExamine;

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 844 - 69
js/component/manageCenter/financialManage/account/accountReview.jsx


+ 386 - 0
js/component/manageCenter/financialManage/account/accountStatistics.jsx

@@ -0,0 +1,386 @@
+import React from "react";
+import $ from "jquery/src/ajax";
+import moment from "moment";
+import {
+  Button,
+  Form,
+  Input,
+  Spin,
+  Table,
+  Select,
+  message,
+  Tabs,
+  Tag,
+  Tooltip,
+  DatePicker,
+  Modal,
+} from "antd";
+import { ChooseList } from "../../order/orderNew/chooseList";
+import { ShowModal, commonAdd } from "../../../tools"
+import ShowModalDiv from "@/showModal.jsx";
+
+const FormItem = Form.Item;
+const { RangePicker } = DatePicker;
+const { TabPane } = Tabs;
+
+const AccountReview = React.createClass({
+
+  getInitialState() {
+    return {
+      searchValues: {}, // 列表筛选条件
+      loading: false, //加载动画
+      changeList: undefined, // 更改后的表格显示数据
+      dataSource: [], // 列表数据
+      departmentArr: [],
+      columns: [
+        {
+          title: "报销人员",
+          dataIndex: "aname",
+          key: "aname",
+        },
+        {
+          title: "报销/借支/抵扣次数",
+          dataIndex: "bx",
+          key: "bx",
+          render: (text, record) => {
+            return (
+              <div>
+                <div>{text + "/" + record.jz + "/" + record.dk}</div>
+              </div>
+            );
+          },
+        },
+        {
+          title: "报销/借支/抵扣金额(元)",
+          dataIndex: "bxAmount",
+          key: "bxAmount",
+          render: (text, record) => {
+            return (
+              <div>{text + "/" + record.jzAmount + "/" + record.dkAmount}</div>
+            );
+          },
+        },
+        {
+          title: "报销总金额(元)",
+          dataIndex: "sum",
+          key: "sum",
+          render: (text, record) => {
+            return (
+              <div>{commonAdd(commonAdd(record.bxAmount, record.jzAmount), record.dkAmount)}</div>
+            );
+          },
+        },
+        {
+          title: "固定费用总金额(元)",
+          dataIndex: "gdfyAmount",
+          key: "gdfyAmount",
+        },
+
+        {
+          title: "报销至订单金额(元)",
+          dataIndex: "bxddAmount",
+          key: "bxddAmount",
+        },
+        {
+          title: "未审核次数",
+          dataIndex: "wshs",
+          key: "wshs",
+        },
+        {
+          title: "驳回次数",
+          dataIndex: "bhs",
+          key: "bhs",
+        },
+      ],
+    };
+  },
+
+  componentWillMount() {
+    this.departmentList();
+    this.loadData();
+  },
+
+  // 列表接口
+  loadData() {
+    const { searchValues } = this.state;
+    this.setState({
+      loading: true,
+    });
+    let datas = searchValues;
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: globalConfig.context + "/api/admin/expenseAccount/statistics",
+      data: datas,
+      success: function (data) {
+        ShowModal(this);
+        this.setState({
+          loading: false,
+        });
+        if (data.error && data.error.length === 0) {
+          if (data.data.list) {
+            this.setState({
+              dataSource: data.data.list,
+            });
+          } else {
+            this.setState({
+              dataSource: data.data,
+            });
+          }
+        } else {
+          message.warning(data.error[0].message);
+        }
+      }.bind(this),
+    }).always(
+      function () {
+        this.setState({
+          loading: false,
+        });
+      }.bind(this)
+    );
+  },
+
+  // 部门信息
+  departmentList() {
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: globalConfig.context + "/api/admin/organization/selectSuperId",
+      data: {},
+      success: function (data) {
+        let thedata = data.data;
+        let theArr = [];
+        if (!thedata) {
+          if (data.error && data.error.length) {
+            message.warning(data.error[0].message);
+          }
+        } else {
+          thedata.map(function (item, index) {
+            theArr.push({
+              key: index,
+              name: item.name,
+              id: item.id
+            });
+          });
+        }
+        this.setState({
+          departmentArr: theArr
+        });
+      }.bind(this)
+    }).always(
+      function () {
+
+      }.bind(this)
+    );
+  },
+
+
+  // 搜索
+  search() {
+    this.loadData();
+  },
+
+  // 重置
+  reset() {
+    this.setState({
+      searchValues: JSON.parse(JSON.stringify({})),
+    }, () => {
+      this.loadData();
+    })
+  },
+
+  // 清除缓存
+  evict() {
+    this.setState({
+      loading: true,
+    });
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: globalConfig.context + "/api/admin/expenseAccount/statistics/evict",
+      data: {},
+      success: function (data) {
+        ShowModal(this);
+        this.setState({
+          loading: false,
+        });
+        if (data.error && data.error.length === 0) {
+          message.success("清除成功!")
+        } else {
+          message.warning(data.error[0].message);
+        }
+      }.bind(this),
+    }).always(
+      function () {
+        this.setState({
+          loading: false,
+        });
+      }.bind(this)
+    );
+  },
+
+  // 导出
+  export() {
+    this.setState({
+      exportExecLoading: true
+    })
+    let loading = message.loading('加载中...');
+    let data = this.state.searchValues;
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: globalConfig.context + "/api/admin/expenseAccount/statistics/export",
+      data,
+      success: function (data) {
+        if (data.error.length === 0) {
+          this.download(data.data);
+        } else {
+          message.warning(data.error[0].message);
+        }
+      }.bind(this),
+    }).always(function () {
+      loading();
+      this.setState({
+        exportExecLoading: false
+      })
+    }.bind(this));
+  },
+
+  // 下载
+  download(fileName) {
+    window.location.href = globalConfig.context + "/open/download?fileName=" + fileName
+  },
+
+  changeList(arr) {
+    const newArr = [];
+    this.state.columns.forEach((item) => {
+      arr.forEach((val) => {
+        if (val === item.title) {
+          newArr.push(item);
+        }
+      });
+    });
+    this.setState({
+      changeList: newArr,
+    });
+  },
+
+
+  render() {
+    const { searchValues, } = this.state
+
+    return (
+      <div className="user-content">
+        <ShowModalDiv ShowModal={this.state.showModal} />
+        <div className="content-title" style={{ marginBottom: 10 }}>
+          <span style={{ fontWeight: 900, fontSize: 16 }}>费用统计</span>
+        </div>
+        <Tabs defaultActiveKey="2" className="test">
+          <TabPane tab="更改表格显示数据" key="1">
+            <div style={{ marginLeft: 10 }}>
+              <ChooseList
+                columns={this.state.columns}
+                changeFn={this.changeList}
+                changeList={this.state.changeList}
+                top={55}
+                margin={11}
+              />
+            </div>
+          </TabPane>
+          <TabPane tab="搜索" key="2">
+            <div className="user-search" style={{ marginLeft: 10 }}>
+
+              <Input
+                placeholder="请输入报销人员"
+                value={searchValues["name"]
+                  ? searchValues["name"]
+                  : ""}
+                onChange={(e) => {
+                  searchValues["name"] = e.target.value;
+                  this.setState({
+                    searchValues: searchValues,
+                  });
+                }}
+              />
+              <Select
+                placeholder="所属部门"
+                style={{ width: 200, marginRight: 10 }}
+                value={searchValues["depId"]
+                  ? searchValues["depId"]
+                  : undefined}
+                onChange={e => {
+                  searchValues["depId"] = e;
+                  this.setState({
+                    searchValues: searchValues,
+                  });
+                }}
+              >
+                {this.state.departmentArr.map(function (item) {
+                  return <Select.Option key={item.id}>{item.name}</Select.Option>;
+                })}
+              </Select>
+
+              <span>报销时间:</span>
+              <RangePicker
+                style={{ width: 300 }}
+                value={[
+                  searchValues.startTime ? moment(searchValues.startTime) : null,
+                  searchValues.endTime ? moment(searchValues.endTime) : null,
+                ]}
+                onChange={(data, dataString) => {
+                  this.setState({
+                    searchValues: Object.assign(searchValues, {
+                      startTime: dataString[0],
+                      endTime: dataString[1],
+                    }),
+                  });
+                }}
+              />
+              <Button
+                type="primary"
+                onClick={this.search}
+                style={{ marginLeft: 10 }}
+              >
+                搜索
+              </Button>
+              <Button style={{ marginLeft: 10 }} onClick={this.reset}>重置</Button>
+              <Button
+                type="primary"
+                onClick={this.evict}
+                style={{ marginLeft: 10 }}
+              >
+                清除缓存
+              </Button>
+            </div>
+          </TabPane>
+          <TabPane tab="导出Excel" key="3">
+            <Button type="primary" style={{ float: "left", margin: 10 }} onClick={this.export}>
+              导出excel
+            </Button>
+          </TabPane>
+        </Tabs>
+        <div className="patent-table">
+          <Spin spinning={this.state.loading}>
+            <Table
+              bordered
+              columns={
+                this.state.changeList == undefined
+                  ? this.state.columns
+                  : this.state.changeList
+              }
+              dataSource={this.state.dataSource}
+              pagination={false}
+              size="small"
+            />
+          </Spin>
+        </div>
+      </div>
+    );
+  },
+});
+
+export default AccountReview;

+ 12 - 0
js/component/manageCenter/financialManage/account/accountView.jsx

@@ -0,0 +1,12 @@
+import React from 'react';
+import AccountReview from "./accountReview"
+
+const AccountExamine = React.createClass({
+  render() {
+    return (
+      <AccountReview isOperate={false} />
+    );
+  }
+});
+
+export default AccountExamine;

+ 12 - 3
js/component/manageCenter/financialManage/content.jsx

@@ -299,11 +299,20 @@ class Content extends Component {
         });
         break;
       // 报销审核列表
-      case "accountreview":
+      case "accountExamine":
         require.ensure([], () => {
-          const AccountReview = require("./account/accountReview").default;
+          const AccountExamine = require("./account/accountExamine").default;
           this.setState({
-            component: <AccountReview />,
+            component: <AccountExamine />,
+          });
+        });
+        break;
+      // 报销列表查看
+      case "accountView":
+        require.ensure([], () => {
+          const AccountView = require("./account/accountView").default;
+          this.setState({
+            component: <AccountView />,
           });
         });
         break;

+ 1 - 1
js/component/manageCenter/project/project/projectAssignment.jsx

@@ -290,7 +290,7 @@ const PaiDan = React.createClass({
           render: (text, record) => {
             return (
               <span>
-                {record.change == 1 && <Tag color="#f50">增</Tag>}
+                {record.change == 1 && <Tag color="#87d068">增</Tag>}
                 {text}
                 <span style={{ color: "red" }}>{record.patentTypeName}</span></span>
             )

+ 73 - 0
js/component/tools.js

@@ -112,6 +112,9 @@ import {
   clockState,
   clockJournalState,
   roleList,
+  typeLists,
+  accountType,
+  vehiclelist,
 } from "./dataDic.js";
 
 import { provinceList } from './NewDicProvinceList.js';
@@ -2274,6 +2277,76 @@ const obj = {
       }
     }
   },
+
+  // 获取报销申请类型
+  getAccountName(type, other = "其他") {
+    let theType = "";
+    accountType.map(function (item) {
+      if (item.value == type) {
+        theType = item.label;
+        if (item.value == 0) {
+          theType = other
+        }
+      }
+    });
+    return theType;
+  },
+
+  // 获取交通工具类型
+  getVehicleName(type, other = "其他") {
+    let theType = "";
+    vehiclelist.map(function (item) {
+      if (item.value == type) {
+        theType = item.label;
+        if (item.value == 0) {
+          theType = other
+        }
+      }
+    });
+    return theType;
+  },
+
+  // 获取报销费用类型
+  getTypeName(type, other = "其他") {
+    let theType = "";
+    typeLists.map(function (item) {
+      if (item.value == type) {
+        theType = item.label;
+        if (item.value == 0) {
+          theType = other
+        }
+      }
+    });
+    return theType;
+  },
+
+  // 解决小数求和问题
+  commonAdd(number1, number2) {
+    let result = 0;
+    if (Number.isInteger(number1) || Number.isInteger(number2)) {
+      result = number1 + number2;
+    } else {
+      //两个都是纯小数
+      const number1Array = (number1).toString().split('.');
+      const number2Array = (number2).toString().split('.');
+      //最大的除数位数
+      let maxBit = 1;
+      if (number1Array[1].length >= number2Array[1].length) {
+        maxBit = number1Array[1].length + 1;
+      } else {
+        maxBit = number2Array[1].length + 1;
+      }
+      const divisor = parseInt('1'.padEnd(maxBit, 0));
+      result = (number1 * divisor + number2 * divisor) / divisor;
+    }
+    return result;
+  },
+
+
+
+
+
+
 };
 
 

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "afanti",
-  "version": "1.2.72",
+  "version": "1.2.74",
   "description": "",
   "main": "index.js",
   "scripts": {