dev01 hace 1 año
padre
commit
4283e88729

+ 33 - 31
js/component/manageCenter/financialManage/account/accountDetaillist.jsx

@@ -120,18 +120,6 @@ const AccountDetaillist = React.createClass({
           dataIndex: "financeName",
           key: "financeName",
         },
-        // {
-        //   title: "状态",
-        //   dataIndex: "status",
-        //   key: "status",
-        //   render: (text, record) => {
-        //     return (
-        //       <span style={{ color: accountStatus[text]["color"] }}>
-        //         {accountStatus[text]["label"]}
-        //       </span>
-        //     );
-        //   },
-        // },
         {
           title: "报销公司/支付公司",
           dataIndex: "payDepName",
@@ -151,6 +139,18 @@ const AccountDetaillist = React.createClass({
           key: "createTimeStr",
         },
         {
+          title: "状态",
+          dataIndex: "status",
+          key: "status",
+          render: (text, record) => {
+            return (
+              <span style={{ color: accountStatus[text].color }}>
+                {accountStatus[text].label}
+              </span>
+            );
+          },
+        },
+        {
           title: "操作",
           dataIndex: "operate",
           key: "operate",
@@ -684,25 +684,6 @@ const AccountDetaillist = React.createClass({
                   return <Select.Option key={item.id}>{item.name}</Select.Option>;
                 })}
               </Select>
-              {/* <Select
-                style={{ width: 140 }}
-                placeholder="审核状态"
-                value={searchValues["status"]
-                  ? searchValues["status"]
-                  : undefined}
-                onChange={(e) => {
-                  searchValues["status"] = e;
-                  this.setState({
-                    searchValues: searchValues,
-                  });
-                }}
-              >
-                <Option value="0">未提交</Option>
-                <Option value="1">审核中</Option>
-                <Option value="2">完成</Option>
-                <Option value="3">驳回</Option>
-                <Option value="4">撤销</Option>
-              </Select> */}
               <Input
                 placeholder="报销编号"
                 value={searchValues["checkNo"]
@@ -732,6 +713,27 @@ const AccountDetaillist = React.createClass({
                     });
                   }}
                 />
+
+                <Select
+                  style={{ width: 140, marginLeft: 10 }}
+                  placeholder="审核状态"
+                  value={searchValues["status"]
+                    ? searchValues["status"]
+                    : undefined}
+                  onChange={(e) => {
+                    searchValues["status"] = e;
+                    this.setState({
+                      searchValues: searchValues,
+                    });
+                  }}
+                >
+                  <Option value="0">未提交</Option>
+                  <Option value="1">审核中</Option>
+                  <Option value="2">完成</Option>
+                  <Option value="3">驳回</Option>
+                  <Option value="4">撤销</Option>
+                </Select>
+
                 <Button
                   type="primary"
                   onClick={this.search}

+ 260 - 35
js/component/manageCenter/financialManage/account/accountDetails.jsx

@@ -1,5 +1,5 @@
 import React, { Component } from "react";
-import { Form, Input, Button, message, Modal, Spin, Table } from "antd";
+import { Form, Input, Button, message, Modal, Spin, Table, Radio, Select, AutoComplete } from "antd";
 import {
   ShowModal, splitUrl, getAccountName, getSecondaryAccountName,
   getVehicleName, getTypeName, commonAdd, dealBigMoney
@@ -11,13 +11,15 @@ import $ from "jquery/src/ajax";
 import './accountReview.less';
 
 const FormItem = Form.Item;
+const RadioGroup = Radio.Group;
 
 class AccountDetails extends Component {
   constructor(props) {
     super(props);
     this.state = {
-      editAmount: false,
+      editA: "",
       isTable: true,
+      sloading: false,
       loading: false,
       visible: "",
       data: {},
@@ -66,7 +68,7 @@ class AccountDetails extends Component {
           title: "序号",
           dataIndex: "a",
           key: "a",
-          width: "3%",
+          width: 40,
           render: (text, record, index) => {
             return (
               <div>{index + 1}</div>
@@ -87,7 +89,7 @@ class AccountDetails extends Component {
           }
         },
         {
-          title: "出差时长",
+          title: "时长",
           dataIndex: "duration",
           key: "duration",
           width: 40,
@@ -126,7 +128,17 @@ class AccountDetails extends Component {
           width: "8%",
           render: (text, record) => {
             return (
-              <div>{text}</div>
+              <div
+                style={{ minHeight: "15px", cursor: record.types == 1 && "pointer" }}
+                onClick={() => {
+                  this.setState({
+                    editA: "contractNo",
+                    editTit: "修改合同编号",
+                    upId: record.erid,
+                    // upUserNames: record.userNames,
+                  })
+                }}
+              >{text}</div>
             )
           }
         },
@@ -137,7 +149,17 @@ class AccountDetails extends Component {
           width: "6%",
           render: (text, record) => {
             return (
-              <div style={{ color: record.publicReleaseType != null && "red" }}>
+              <div style={{ color: record.publicReleaseType != null && "red", cursor: text == 0 && "pointer" }}
+                onClick={() => {
+                  text == 0 &&
+                    this.setState({
+                      editA: "typesOther",
+                      editTit: "修改其他类型说明",
+                      upId: record.erid,
+                      upTypesOther: record.typesOther,
+                    })
+                }}
+              >
                 {getAccountName(text, record.typesOther)}
               </div>
             )
@@ -179,7 +201,8 @@ class AccountDetails extends Component {
                 onClick={() => {
                   !record.noEdit && this.props.isOperate &&
                     this.setState({
-                      editAmount: true,
+                      editA: "amount",
+                      editTit: "修改金额",
                       upAmount: text,
                       upId: record.id,
                     })
@@ -268,6 +291,7 @@ class AccountDetails extends Component {
               dlist[0].plan = allData.sonList[i].plan; // 出差事由
               dlist[0].publicReleaseType = allData.sonList[i].publicReleaseType; // 公出关联
               dlist[0].types = allData.sonList[i].type; // 报销类型
+              dlist[0].erid = allData.sonList[i].id; // 二级报销id
               dlist[0].typesOther = allData.sonList[i].typeOther;
               if (allData.sonList[i].type == 2) { // 非业务报销
                 obj.type = allData.sonList[i].secondaryType;
@@ -291,7 +315,6 @@ class AccountDetails extends Component {
             data: data.data,
             newList: allList,
           })
-          // console.log(allData, "==", allList)
           // this.setState({
           //   data: data.data,
           //   imgs: data.data.attachmentUrl
@@ -479,20 +502,46 @@ class AccountDetails extends Component {
     return result;
   }
 
-  // 修改实报金额
+  // 修改
   updateRealAmount() {
+    const { editA } = this.state
     this.setState({
       upLoading: true,
     })
+    if (editA == "typesOther" && !this.state.upTypesOther) {
+      message.warn("其他类型说明不能为空!");
+      return
+    }
+    if (editA == "remarks" && !this.state.upRemarks) {
+      message.warn("报销事由不能为空!");
+      return
+    }
+    let obj1 = {
+      id: this.state.upId,
+      amount: this.state.upAmount,
+    }
+    let obj2 = {
+      id: this.state.upId,
+      remarks: this.state.upRemarks,
+    }
+    let obj3 = {
+      id: this.state.upId,
+      typeOther: this.state.upTypesOther,
+    }
+    let obj4 = {
+      id: this.state.upId,
+      orderNo: this.state.upOrderNo,
+    }
     $.ajax({
       method: "POST",
       dataType: "json",
       crossDomain: false,
-      url: globalConfig.context + "/api/admin/expenseAccount/updateRealAmount",
-      data: {
-        id: this.state.upId,
-        amount: this.state.upAmount,
-      },
+      url: globalConfig.context + editA == "amount"
+        ? "/api/admin/expenseAccount/updateRealAmount" : "/api/admin/expenseAccount/updateTypeOther",
+      data: editA == "amount"
+        ? obj1 : editA == "remarks"
+          ? obj2 : editA == "typesOther"
+            ? obj3 : editA == "contractNo" && obj4,
     }).done(
       function (data) {
         this.setState({
@@ -501,8 +550,11 @@ class AccountDetails extends Component {
         if (!data.error.length) {
           message.success("修改成功!");
           this.setState({
-            editAmount: false,
+            editA: "",
             upId: "",
+            upUserNames: "",
+            upUserId: "",
+            upList: [],
           });
           this.getDetails(this.state.data.id)
         } else {
@@ -511,15 +563,101 @@ class AccountDetails extends Component {
       }.bind(this)
     );
   }
+  // 查询合同编号
+  selectOrderByUid() {
+    this.setState({
+      sloading: true
+    })
+    $.ajax({
+      method: "GET",
+      dataType: "json",
+      crossDomain: false,
+      url: "/api/admin/release/selectOrderByUid",
+      data: {
+        uid: this.state.upUserId,
+      },
+    }).done(
+      function (data) {
+        this.setState({
+          sloading: false
+        })
+        if (!data.error.length) {
+          this.setState({
+            upList: data.data
+          })
+        } else {
+          message.warning(data.error[0].message);
+        }
+      }.bind(this)
+    );
+  }
+
+  // 查询企业
+  httpChange(e) {
+    this.setState({
+      upUserNames: e,
+    });
+    if (e.length >= 1) {
+      this.supervisor(e);
+    }
+  }
+  // 
+  supervisor(e) {
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: globalConfig.context + "/api/admin/customer/getUserByNames",
+      data: {
+        name: e,
+        type: 1,
+        pageNo: 1,
+        pageSize: 10,
+      },
+      success: function (data) {
+        let thedata = data.data;
+        if (!thedata) {
+          if (data.error && data.error.length) {
+            message.warning(data.error[0].message);
+          }
+          thedata = {};
+        }
+        this.setState({
+          customerArr: thedata.list,
+        });
+      }.bind(this),
+    }).always(
+      function () {
+
+      }.bind(this)
+    );
+  }
+
+  selectAuto(value) {
+    const { customerArr } = this.state
+    this.setState({
+      upUserId: customerArr.find((item) => item.name == value).id,
+    });
+  }
 
   render() {
     const { TextArea } = Input
-    const { data, visible, newList, logdataSour, columns } = this.state
+    const { data, visible, newList, logdataSour, columns, customerArr = [] } = this.state
     const { onCancel } = this.props
     const formItemLayout = {
       labelCol: { span: 5 },
       wrapperCol: { span: 18 },
     };
+    const radioStyle = {
+      display: 'block',
+      height: '30px',
+      lineHeight: '30px',
+    };
+    const options = customerArr.map((group) => (
+      <Select.Option key={group.id} value={group.name}>
+        {group.name}
+      </Select.Option>
+    ));
     return (
       <Modal
         maskClosable={false}
@@ -548,10 +686,20 @@ class AccountDetails extends Component {
                 <div className="m_head">
                   <div>报销编号:{data.checkNo}</div>
                   <div>申请部门:{data.applyDepName}</div>
-                  <div>收款方式:{!data.name ? "" : (data.bank + " " + data.accounts + " " + data.name)}</div>
                   <div>报销人:{data.aname}</div>
                   <div>报销日期:{moment(data.createTimeStr).format('YYYY年MM月DD日')}</div>
-                  <div>报销事由:{data.remarks}</div>
+                  <div
+                    style={{ cursor: "pointer" }}
+                    onClick={() => {
+                      this.setState({
+                        editA: "remarks",
+                        editTit: "修改报销事由",
+                        upId: data.id,
+                        upRemarks: data.remarks,
+                      })
+                    }}
+                  >报销事由:{data.remarks}</div>
+                  <div>收款方式:{!data.name ? "" : (data.bank + " " + data.accounts + " " + data.name)}</div>
                 </div>
                 <Table
                   columns={columns}
@@ -564,7 +712,7 @@ class AccountDetails extends Component {
                   <div style={{ width: "100%", marginTop: 8 }}>审核日志:
                     {
                       this.state.logdataSour.map(item =>
-                        !!item.createTimeStr && <span key={item.id}>【{item.auditorName}&nbsp;&nbsp;{item.createTimeStr}&nbsp;&nbsp;{item.remarks}】&nbsp;&nbsp;</span>
+                        item.showStatus == 0 && <span key={item.id}>【{item.auditorName}&nbsp;&nbsp;{item.createTimeStr}&nbsp;&nbsp;{item.remarks}】&nbsp;&nbsp;</span>
                       )
                     }
                   </div>
@@ -1111,28 +1259,105 @@ class AccountDetails extends Component {
           </Modal>
         }
         {
-          // 修改实报金额
-          this.state.editAmount &&
+          // 修改
+          this.state.editA != "" &&
           <Modal
-            visible={this.state.editAmount}
+            visible={this.state.editA != ""}
             maskClosable={false}
-            title="修改金额"
+            title={this.state.editTit}
             cancelText="取消"
-            width={250}
+            width={300}
             okText="确认"
             onOk={() => { this.updateRealAmount() }}
-            onCancel={() => { this.setState({ editAmount: false }) }}
+            onCancel={() => { this.setState({ editA: "" }) }}
           >
-            <Input
-              placeholder='请输入'
-              type='number'
-              value={this.state.upAmount}
-              onChange={e => {
-                this.setState({
-                  upAmount: e.target.value
-                })
-              }}
-            />
+            {
+              this.state.editA == "amount" &&
+              <Input
+                placeholder='请输入'
+                type='number'
+                value={this.state.upAmount}
+                onChange={e => {
+                  this.setState({
+                    upAmount: e.target.value
+                  })
+                }}
+              />
+            }
+            {
+              this.state.editA == "remarks" &&
+              <TextArea
+                rows={4}
+                value={this.state.upRemarks}
+                onChange={(e) => {
+                  this.setState({
+                    upRemarks: e.target.value,
+                  })
+                }}
+                placeholder="报销事由"
+              />
+            }
+            {
+              this.state.editA == "typesOther" &&
+              <Input
+                placeholder='请填写类型说明'
+                value={this.state.upTypesOther}
+                onChange={e => {
+                  this.setState({
+                    upTypesOther: e.target.value
+                  })
+                }}
+              />
+            }
+            {
+              this.state.editA == "contractNo" &&
+              <div>
+                <div style={{ marginBottom: 20 }}>
+                  <AutoComplete
+                    className="certain-category-search"
+                    dropdownClassName="certain-category-search-dropdown"
+                    dropdownMatchSelectWidth={false}
+                    style={{ width: 180 }}
+                    dataSource={options}
+                    placeholder="企业名称"
+                    value={this.state.upUserNames}
+                    onChange={this.httpChange.bind(this)}
+                    filterOption={true}
+                    onSelect={this.selectAuto.bind(this)}
+                  >
+                    <Input />
+                  </AutoComplete>
+                  <Button
+                    disabled={!this.state.upUserId}
+                    style={{ marginLeft: 10 }}
+                    type="primary"
+                    onClick={() => {
+                      this.selectOrderByUid()
+                    }}>搜索</Button>
+                </div>
+
+                <div>
+                  <Spin spinning={this.state.sloading}>
+                    {
+                      !!this.state.upList && this.state.upList.length == 0 &&
+                      <div style={{ color: "red", margin: "20px auto", textAlign: "center" }}>该企业暂无订单</div>
+                    }
+                    <RadioGroup
+                      onChange={(e) => {
+                        this.setState({
+                          upOrderNo: e.target.value
+                        })
+                      }} value={this.state.upOrderNo}>
+                      {
+                        !!this.state.upList && this.state.upList.map(item =>
+                          <Radio key={item.contractNo} style={radioStyle} value={item.orderNo}>编号:{item.contractNo}</Radio>
+                        )
+                      }
+                    </RadioGroup>
+                  </Spin>
+                </div>
+              </div>
+            }
           </Modal>
         }
 

+ 25 - 25
js/component/manageCenter/financialManage/account/accountReview.jsx

@@ -87,31 +87,31 @@ const AccountReview = React.createClass({
           dataIndex: "checkNo",
           key: "checkNo",
         },
-        {
-          title: "报销至订单",
-          dataIndex: "buyerName",
-          key: "buyerName",
-          render: (text, record) => {
-            return (
-              record.targetType == 0
-                ? <div>固定费用</div>
-                : <div>
-                  <div>{text || ""}</div>
-                  <div>{record.contractNo || ""}</div>
-                </div>
-            );
-          },
-        },
-        {
-          title: "报销至部门",
-          dataIndex: "applyDepName",
-          key: "applyDepName",
-          render: (text, record) => {
-            return (
-              <span>{record.targetType == 0 && text}</span>
-            );
-          },
-        },
+        // {
+        //   title: "报销至订单",
+        //   dataIndex: "buyerName",
+        //   key: "buyerName",
+        //   render: (text, record) => {
+        //     return (
+        //       record.targetType == 0
+        //         ? <div>固定费用</div>
+        //         : <div>
+        //           <div>{text || ""}</div>
+        //           <div>{record.contractNo || ""}</div>
+        //         </div>
+        //     );
+        //   },
+        // },
+        // {
+        //   title: "报销至部门",
+        //   dataIndex: "applyDepName",
+        //   key: "applyDepName",
+        //   render: (text, record) => {
+        //     return (
+        //       <span>{record.targetType == 0 && text}</span>
+        //     );
+        //   },
+        // },
         {
           title: "报销人",
           dataIndex: "aname",

+ 3 - 3
js/component/manageCenter/financialManage/account/accountReview.less

@@ -4,7 +4,7 @@
 
 
 .m_body {
-  padding: 20px 30px 40px;
+  padding: 0 20px 10px;
 
   .ant-form-item {
     margin-bottom: 0 !important;
@@ -76,7 +76,7 @@
     font-weight: bold;
     padding: 2px 5px;
     // border-bottom: 1px solid #000;
-    margin-bottom: 30px;
+    margin-bottom: 15px;
   }
 
   .ant-table-wrapper {
@@ -92,7 +92,7 @@
 
     div {
       width: 33%;
-      margin-bottom: 8px;
+      margin-bottom: 2px;
 
     }
   }

+ 8 - 6
js/component/tools.js

@@ -2311,7 +2311,7 @@ const obj = {
       if (item.value == type) {
         theType = item.label;
         if (item.value == 0) {
-          theType = "其他(" + other + ")"
+          theType = "其他(" + other + ")"
         }
       }
     });
@@ -2324,7 +2324,7 @@ const obj = {
       if (item.value == type) {
         theType = item.label;
         if (item.value == 0) {
-          theType = "其他(" + other + ")"
+          theType = "其他(" + other + ")"
         }
       }
     });
@@ -2337,7 +2337,7 @@ const obj = {
       if (item.value == type) {
         theType = item.label;
         if (item.value == 0) {
-          theType = "其他(" + other + ")"
+          theType = "其他(" + other + ")"
         }
       }
     });
@@ -2351,7 +2351,7 @@ const obj = {
       if (item.value == type) {
         theType = item.label;
         if (item.value == 0) {
-          theType = "其他(" + other + ")"
+          theType = "其他(" + other + ")"
         }
       }
     });
@@ -2361,12 +2361,14 @@ const obj = {
   // 解决小数求和问题
   commonAdd(number1, number2) {
     let result = 0;
-    if (Number.isInteger(number1) || Number.isInteger(number2)) {
+    if (Number.isInteger(number1) && Number.isInteger(number2)) {
       result = number1 + number2;
     } else {
-      //两个都是纯小数
+      //
       const number1Array = (number1).toString().split('.');
       const number2Array = (number2).toString().split('.');
+      Number.isInteger(number1) && number1Array.push("0")
+      Number.isInteger(number2) && number2Array.push("0")
       //最大的除数位数
       let maxBit = 1;
       if (number1Array[1].length >= number2Array[1].length) {

+ 1 - 1
package.json

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