|
@@ -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} {item.createTimeStr} {item.remarks}】 </span>
|
|
|
+ item.showStatus == 0 && <span key={item.id}>【{item.auditorName} {item.createTimeStr} {item.remarks}】 </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>
|
|
|
}
|
|
|
|