Browse Source

弹窗样式修改,报销清单bug修复

dev01 1 year ago
parent
commit
ffac1fb7af

+ 17 - 3
js/component/manageCenter/financialManage/account/accountDetails.jsx

@@ -255,6 +255,19 @@ class AccountDetails extends Component {
     );
   }
 
+  distinct(arr, key) {
+    let hash = {};
+    let result = [];
+    for (let i = arr.length - 1; i >= 0; i--) {
+      let value = arr[i][key];
+      if (!hash[value]) {
+        hash[value] = true;
+        result.unshift(arr[i]);
+      }
+    }
+    return result;
+  }
+
   render() {
     const { TextArea } = Input
     const { data, visible, list = [], newList, total, logdataSour, } = this.state
@@ -263,9 +276,10 @@ class AccountDetails extends Component {
       labelCol: { span: 5 },
       wrapperCol: { span: 18 },
     };
-    const logArray = logdataSour.filter((item, index, arr) => {
-      return arr.findLastIndex((t) => t.auditorName === item.auditorName) === index;
-    });
+    const logArray = this.distinct(logdataSour, "auditorName")
+    // const logArray = logdataSour.filter((item, index, arr) => {
+    //   return arr.findLastIndex((t) => t.auditorName === item.auditorName) === index;
+    // });
     const reimbursement = [
       {
         title: !!data.contractNo ? `报销至订单:${data.contractNo}` : `报销至部门`,

+ 2 - 163
js/component/manageCenter/financialManage/account/accountReview.jsx

@@ -15,7 +15,7 @@ import {
   Modal,
 } from "antd";
 import { ChooseList } from "../../order/orderNew/chooseList";
-import { ShowModal,getVehicleName, getTypeName, commonAdd, dealBigMoney } from "../../../tools"
+import { ShowModal, getVehicleName, getTypeName, commonAdd, dealBigMoney } from "../../../tools"
 import ShowModalDiv from "@/showModal.jsx";
 import AccountDetails from "./accountDetails";
 import { accountType, accountStatus } from "@/dataDic";
@@ -502,7 +502,7 @@ const AccountReview = React.createClass({
 
   render() {
     const { TextArea } = Input
-    const { searchValues, data, visible, list = [], newList, total, logdataSour, } = this.state
+    const { searchValues, visible, } = this.state
     const formItemLayout = {
       labelCol: { span: 5 },
       wrapperCol: { span: 18 },
@@ -513,167 +513,6 @@ const AccountReview = React.createClass({
         {group.name}
       </Select.Option>
     ));
-    const logArray = logdataSour.filter((item, index, arr) => {
-      return arr.findLastIndex((t) => t.auditorName === item.auditorName) === index;
-    });
-    const reimbursement = [
-      {
-        title: !!data.contractNo ? `报销至订单:${data.contractNo}` : `报销至部门`,
-        dataIndex: "head",
-        key: "head",
-        width: 275,
-        render: (text, row, index) => {
-          if (index < newList.length - 2) {
-            return <span>{text}</span>;
-          } else if (index == newList.length - 2) {
-            return {
-              children: <div style={{ display: "flex", justifyContent: "space-between" }}>
-                <span>金额合计(大写):{data.type == 5 ? dealBigMoney(total) : (dealBigMoney((total > data.debitTotalAmount) ? commonAdd(total, -data.debitTotalAmount) : 0))}</span>
-                <span>¥&nbsp;&nbsp;&nbsp;{data.type == 5 ? total : (total > data.debitTotalAmount) ? commonAdd(total, -data.debitTotalAmount) : 0}&nbsp;&nbsp;&nbsp;</span>
-              </div>,
-              props: {
-                colSpan: 3,
-              },
-            };
-          } else if (index == newList.length - 1) {
-            return {
-              children: <div>
-                <div>
-                  {data.type == 3 && newList.map((item, index) => !!item.invoiceNo && <div key={index}>付款方式:{"公对公转账"}&nbsp;&nbsp;&nbsp;发票类型:{["普票", "专票"][item.invoiceType]}&nbsp;&nbsp;&nbsp;发票号:{item.invoiceNo}</div>)}
-                  {data.type == 3
-                    ? newList.map((item, index) => !!item.payerName && <div key={index}>收款方式:{item.payerName}&nbsp;&nbsp;&nbsp;{item.openBank}&nbsp;&nbsp;&nbsp;{item.bankAccounts}&nbsp;&nbsp;&nbsp;{item.openBankAddress}</div>)
-                    : data.type != 5 && <div>收款方式:{data.bank}&nbsp;&nbsp;&nbsp;{data.accounts}&nbsp;&nbsp;&nbsp;{data.name}</div>}
-                </div>
-              </div>,
-              props: {
-                colSpan: 3,
-              },
-            };
-          }
-        },
-      },
-      {
-        title: '报销数',
-        children: [
-          {
-            title: '付款项目',
-            dataIndex: "type",
-            key: "type",
-            width: 120,
-            render: (value, row, index) => {
-              if (index == newList.length - 2) {
-                return {
-                  props: {
-                    rowSpan: 0,
-                  },
-                };
-              } else if (index == newList.length - 1) {
-                return {
-                  props: {
-                    rowSpan: 0,
-                  },
-                };
-              } else {
-                return <div>
-                  {data.type == 1 &&
-                    // 差旅费显示
-                    <div>
-                      {!!row.other
-                        ? row.other
-                        : value == 1
-                          ? <span>{`交通费(${getVehicleName(row.vehicle, row.vehicleOther)})`}</span>
-                          : <span>{getTypeName(row.type)}</span>}
-                    </div>}
-                  {(data.type == 0 || data.type == 2 || data.type == 4 || data.type == 5) &&
-                    <span>{value == 4 ? "预借支金额" : value == 5 ? "抵扣金额" : !!row.other ? row.other : "申请金额"}</span>
-                  }
-                  {data.type == 3 &&
-                    <span>{!!row.other ? row.other : "申请金额"}</span>
-                  }
-
-                </div>;
-              }
-            },
-          },
-          {
-            title: '金额(元)',
-            dataIndex: "amount",
-            key: "amount",
-            width: 80,
-            render: (value, row, index) => {
-              if (index == newList.length - 2) {
-                return {
-                  props: {
-                    rowSpan: 0,
-                  },
-                };
-              } else if (index == newList.length - 1) {
-                return {
-                  props: {
-                    rowSpan: 0,
-                  },
-                };
-              } else {
-                return <span>{value}</span>;
-              }
-            },
-          }
-        ],
-      },
-      {
-        title: '审核意见',
-        dataIndex: "shyj",
-        key: "shyj",
-        width: 270,
-        render: (value, row, index) => {
-          if (index == 0) {
-            return {
-              children: <div>
-                <ul
-                  style={{
-                    overflow: "hidden",
-                    position: "relative",
-                  }}
-                >{logArray.map((item, index) => {
-                  return (
-                    // 要求只显示通过的审核
-                    (item.status == 1 || item.status == 2) &&
-                    <li
-                      key={item.auditorName}
-                      style={{
-                        height: "auto",
-                        wordBreak: "break-all",
-                      }}
-                    >
-                      <span>{item.auditorName}:</span>
-                      <span style={{ color: ["#1D4FEA", "#34DE38", "#108EE9", "red", "#1D4FEA"][item.status] }}>
-                        {["【发起】,", "【通过】,", "【完成】,", "【驳回】,", "【重新发起】,"][item.status]}
-                        {this.state.processStatus == item.processStatus && !item.id && data.status != 0 &&
-                          <span style={{ color: "#FFA500" }}>&nbsp;审核中...</span>}
-                      </span>
-                      <span>{item.remarks}</span>
-                      {/* <span>&nbsp;&nbsp;&nbsp;{item.createTimeStr}</span> */}
-                    </li>
-                  )
-                })}
-                </ul>
-              </div>,
-              props: {
-                rowSpan: newList.length - 2,
-              },
-            };
-          } else if (index == newList.length - 2) {
-            return data.type != 0 && <span>要求付款时间:{data.type == 1 ? moment(data.agreeTimeStr).format('YYYY-MM-DD') : moment(newList[0].agreeTimeStr).format('YYYY-MM-DD')}</span>;
-          } else if (index < newList.length - 1) {
-            return {
-              props: {
-                rowSpan: 0,
-              },
-            };
-          }
-        },
-      },
-    ]
 
     return (
       <div className="user-content">

+ 11 - 12
js/component/manageCenter/financialManage/account/accountReview.less

@@ -1,24 +1,23 @@
 // .clearfix{
 //   height: 32px;
 // }
-.ant-modal-body {
-  padding: 0;
-}
+
 
 .m_body {
   padding: 20px 30px 40px;
-}
 
-.ant-form-item {
-  margin-bottom: 0 !important;
-}
+  .ant-form-item {
+    margin-bottom: 0 !important;
+  }
 
-.ant-form-item-label {
-  line-height: 24px;
-}
+  .ant-form-item-label {
+    line-height: 24px;
+  }
+
+  .ant-form-item-control {
+    line-height: 24px;
+  }
 
-.ant-form-item-control {
-  line-height: 24px;
 }
 
 

+ 1 - 1
package.json

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