|
@@ -1,18 +1,29 @@
|
|
|
import React, { Component } from "react";
|
|
|
import Taro, { getCurrentInstance } from "@tarojs/taro";
|
|
|
-import { Button, Text, View } from "@tarojs/components";
|
|
|
+import { Button, Picker, Text, View } from "@tarojs/components";
|
|
|
import dayjs from "dayjs";
|
|
|
-import "./index.less";
|
|
|
import ImagePicker from "../../components/common/imagePicker";
|
|
|
import InquiryModal from "../../components/common/inquiryModal";
|
|
|
import AccountModal from "../../components/common/accountModal";
|
|
|
-import { AtButton, AtInput, AtModal, AtModalHeader, AtModalContent, AtRadio, AtModalAction } from "taro-ui";
|
|
|
+import Select from "../applyReimbursement/select";
|
|
|
+import {
|
|
|
+ AtButton,
|
|
|
+ AtInput,
|
|
|
+ AtModal,
|
|
|
+ AtTextarea,
|
|
|
+ AtModalHeader,
|
|
|
+ AtModalContent,
|
|
|
+ AtRadio,
|
|
|
+ AtModalAction,
|
|
|
+ AtIcon,
|
|
|
+} from "taro-ui";
|
|
|
import {
|
|
|
getPridDetail,
|
|
|
getAccountList,
|
|
|
selectList,
|
|
|
detailsDelete,
|
|
|
subAccount,
|
|
|
+ getDepartmentList,
|
|
|
} from "../../utils/servers/servers";
|
|
|
import {
|
|
|
getNumHourse,
|
|
@@ -27,7 +38,6 @@ import "taro-ui/dist/style/components/form.scss";
|
|
|
import "taro-ui/dist/style/components/button.scss";
|
|
|
import "taro-ui/dist/style/components/loading.scss";
|
|
|
import "taro-ui/dist/style/components/icon.scss";
|
|
|
-import "taro-ui/dist/style/components/icon.scss";
|
|
|
import "taro-ui/dist/style/components/textarea.scss";
|
|
|
import "taro-ui/dist/style/components/input.scss";
|
|
|
|
|
@@ -46,15 +56,20 @@ class Drafts extends Component {
|
|
|
list: [],
|
|
|
total: 0,
|
|
|
accountvisible: "",
|
|
|
+ typeVisible: "",
|
|
|
bankData: {},
|
|
|
upaccount: false,
|
|
|
accountsList: [],
|
|
|
+ attachmentUrl: [],
|
|
|
+ orderName: "",
|
|
|
+ contractNo: "",
|
|
|
};
|
|
|
this.onChange = this.onChange.bind(this);
|
|
|
this.getNumHourse = this.getNumHourse.bind(this);
|
|
|
}
|
|
|
|
|
|
componentDidMount() {
|
|
|
+ this.getDepartmentList()
|
|
|
this.$instance.router.params && this.$instance.router.params.id &&
|
|
|
(
|
|
|
this.getDetail(),
|
|
@@ -63,6 +78,48 @@ class Drafts extends Component {
|
|
|
)
|
|
|
}
|
|
|
|
|
|
+ componentDidShow() { // 对应onShow,只有在onShow中才会监听到当前页面的改变
|
|
|
+ let pages = Taro.getCurrentPages();
|
|
|
+ let currPage = pages[pages.length - 1]; // 获取当前页面
|
|
|
+ this.setState({
|
|
|
+ orderName: currPage.data.name,
|
|
|
+ contractNo: currPage.data.contractNo,
|
|
|
+ orderNo: currPage.data.orderNo,
|
|
|
+ })
|
|
|
+ this.getAccountList();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // 部门数据
|
|
|
+ getDepartmentList() {
|
|
|
+ getDepartmentList({}).then(v => {
|
|
|
+ let thedata = v.data;
|
|
|
+ let theArr = [];
|
|
|
+ if (!thedata) {
|
|
|
+ if (v.error && v.error.length) {
|
|
|
+ Taro.showToast({ title: v.error[0].message, icon: 'none' })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ thedata.map(function (item, index) {
|
|
|
+ theArr.push({
|
|
|
+ key: index,
|
|
|
+ name: item.name,
|
|
|
+ id: item.id
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.setState({
|
|
|
+ departmentArr: theArr
|
|
|
+ });
|
|
|
+ }).catch(() => {
|
|
|
+ Taro.showToast({
|
|
|
+ title: '系统错误,请稍后再试',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ // 图片上传操作
|
|
|
onChange(value, type) {
|
|
|
let arr = this.state.imgs.concat([]);
|
|
|
if (type === "add") {
|
|
@@ -79,18 +136,69 @@ class Drafts extends Component {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ // 取消添加
|
|
|
onAccountClose() {
|
|
|
this.setState({
|
|
|
accountvisible: "",
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ // 添加收款账户
|
|
|
onAccountOk() {
|
|
|
this.setState({
|
|
|
accountvisible: "",
|
|
|
}, () => { this.getMyList() })
|
|
|
}
|
|
|
|
|
|
+ // 类型修改 取消
|
|
|
+ onTypeClose() {
|
|
|
+ this.setState({
|
|
|
+ typeVisible: "",
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ // 类型修改 确定
|
|
|
+ onTypeOk(type, typeOther) {
|
|
|
+ const oldType = this.state.data.type
|
|
|
+ const oldTypeOther = this.state.data.typeOther
|
|
|
+ if ((oldType == type) && (typeOther == oldTypeOther)) {
|
|
|
+ this.setState({
|
|
|
+ typeVisible: "",
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ let data = {
|
|
|
+ updateType: 1,
|
|
|
+ id: this.$instance.router.params.id,
|
|
|
+ type,
|
|
|
+ typeOther,
|
|
|
+ }
|
|
|
+ subAccount(removeNull(data))
|
|
|
+ .then((v) => {
|
|
|
+ if (v.error.length === 0) {
|
|
|
+ this.getAccountList()
|
|
|
+ // 手动刷新
|
|
|
+ const obj = { type, typeOther }
|
|
|
+ this.setState({
|
|
|
+ data: { ...this.state.data, ...obj },
|
|
|
+ typeVisible: "",
|
|
|
+ })
|
|
|
+ Taro.showToast({
|
|
|
+ title: "修改成功!",
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ Taro.showToast({
|
|
|
+ title: v.error[0].message,
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 费用弹窗
|
|
|
onClose() {
|
|
|
this.setState({
|
|
@@ -131,6 +239,7 @@ class Drafts extends Component {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ // 确认收款账户
|
|
|
selectOn() {
|
|
|
let list = this.state.accountsList
|
|
|
for (var i = 0; i < list.length; i++) {
|
|
@@ -215,44 +324,48 @@ class Drafts extends Component {
|
|
|
|
|
|
onSubmit() {
|
|
|
const { data, bankData } = this.state
|
|
|
- if (!data.userNames) {
|
|
|
- Taro.showToast({ title: "请填写公出客户名称", icon: "none" });
|
|
|
- return;
|
|
|
- }
|
|
|
- if (!data.districtName) {
|
|
|
- Taro.showToast({ title: "请填写公出地点", icon: "none" });
|
|
|
- return;
|
|
|
- }
|
|
|
- if (!this.state.rangeStartMinuteVal) {
|
|
|
- Taro.showToast({ title: "请选择公出时间", icon: "none" });
|
|
|
- return;
|
|
|
- }
|
|
|
- if (!this.state.rangeEndMinuteVal) {
|
|
|
- Taro.showToast({ title: "请选择公出时间", icon: "none" });
|
|
|
- return;
|
|
|
+ if (data.type == 0) {
|
|
|
+ if (!data.userNames) {
|
|
|
+ Taro.showToast({ title: "请填写公出客户名称", icon: "none" });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!data.districtName) {
|
|
|
+ Taro.showToast({ title: "请填写公出地点", icon: "none" });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!this.state.rangeStartMinuteVal) {
|
|
|
+ Taro.showToast({ title: "请选择公出时间", icon: "none" });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!this.state.rangeEndMinuteVal) {
|
|
|
+ Taro.showToast({ title: "请选择公出时间", icon: "none" });
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
this.setState({
|
|
|
loading: true,
|
|
|
});
|
|
|
- let datas = {
|
|
|
+ let comData = {
|
|
|
+ updateType: 0,
|
|
|
id: this.$instance.router.params.id,
|
|
|
status: 1, // 提交审核
|
|
|
- type: data.type,
|
|
|
- typeOther: data.typeOther,
|
|
|
- userNames: data.userNames,
|
|
|
- districtName: data.districtName,
|
|
|
- releaseStart: this.state.rangeStartMinuteVal,
|
|
|
- releaseEnd: this.state.rangeEndMinuteVal,
|
|
|
- duration: this.state.totalDuration,
|
|
|
- orderNo: data.orderNo,
|
|
|
- applyDep: data.applyDep,
|
|
|
- payDep: data.payDep,
|
|
|
- attachmentUrl: this.state.imgs.length === 0 ? "" : this.state.imgs.join(","),
|
|
|
- eaaid: bankData.id,
|
|
|
- };
|
|
|
- console.log("-----", datas)
|
|
|
- // return
|
|
|
- subAccount(removeNull(datas))
|
|
|
+ type: data.type, // 报销类型
|
|
|
+ typeOther: data.type == 0 ? data.typeOther : undefined, // 其他类型
|
|
|
+ remarks: data.remarks, // 报销事由
|
|
|
+ applyDep: data.applyDep, // 申请部门
|
|
|
+ attachmentUrl: this.state.imgs.length === 0 ? "" : this.state.imgs.join(","), // 附件
|
|
|
+ payDep: (data.type == 4 || data.type == 5) ? undefined : data.payDep, // 支付部门(借支抵扣不需要)
|
|
|
+ orderNo: (data.type == 4 || data.type == 5) ? undefined : data.orderNo, // 支付部门(借支抵扣不需要)
|
|
|
+ eaaid: data.type != 3 ? bankData.id : undefined, // 报销账户(第三方付款不需要)
|
|
|
+ // 差旅费
|
|
|
+ userNames: data.type == 1 ? data.userNames : undefined, // 公出客户名称
|
|
|
+ districtName: data.type == 1 ? data.districtName : undefined, // 公出地点
|
|
|
+ releaseStart: data.type == 1 ? this.state.rangeStartMinuteVal : undefined, // 开始时间
|
|
|
+ releaseEnd: data.type == 1 ? this.state.rangeEndMinuteVal : undefined, // 结束时间
|
|
|
+ duration: data.type == 1 ? this.state.totalDuration : undefined, // 公出时长
|
|
|
+ }
|
|
|
+ subAccount(removeNull(comData))
|
|
|
.then((v) => {
|
|
|
this.setState({
|
|
|
loading: false,
|
|
@@ -330,102 +443,123 @@ class Drafts extends Component {
|
|
|
|
|
|
|
|
|
render() {
|
|
|
- const { data, list, total, bankData, } = this.state
|
|
|
+ const { data, list, total, bankData, attachmentUrl } = this.state
|
|
|
+ const departmentArr = this.state.departmentArr || [];
|
|
|
return (
|
|
|
<View className="subform">
|
|
|
- <View className="title">{[data.typeOther, "差旅费报销", "餐费报销", "第三方付款", "申请预借支"][data.type]}</View>
|
|
|
- <View className="inputFormItem">
|
|
|
- <AtInput
|
|
|
- name='userNames'
|
|
|
- title='公出企业:'
|
|
|
- type='text'
|
|
|
- placeholder='请填写公出企业'
|
|
|
- value={data.userNames}
|
|
|
- onChange={e => { data.userNames = e }}
|
|
|
- />
|
|
|
- </View>
|
|
|
- <View className="inputFormItem">
|
|
|
- <AtInput
|
|
|
- name='districtName'
|
|
|
- title='公出地点:'
|
|
|
- type='text'
|
|
|
- placeholder='请填写公出地点'
|
|
|
- value={data.districtName}
|
|
|
- onChange={e => { data.districtName = e }}
|
|
|
- />
|
|
|
- </View>
|
|
|
+ <View className="title">{getAccountName(data.type, data.typeOther)}</View>
|
|
|
+ {data.type == 1 &&
|
|
|
+ <View className="inputFormItem">
|
|
|
+ <AtInput
|
|
|
+ name='userNames'
|
|
|
+ title='公出企业:'
|
|
|
+ type='text'
|
|
|
+ placeholder='请填写公出企业'
|
|
|
+ value={data.userNames}
|
|
|
+ onChange={e => { data.userNames = e }}
|
|
|
+ />
|
|
|
+ </View>}
|
|
|
+ {data.type == 1 &&
|
|
|
+ <View className="inputFormItem">
|
|
|
+ <AtInput
|
|
|
+ name='districtName'
|
|
|
+ title='公出地点:'
|
|
|
+ type='text'
|
|
|
+ placeholder='请填写公出地点'
|
|
|
+ value={data.districtName}
|
|
|
+ onChange={e => { data.districtName = e }}
|
|
|
+ />
|
|
|
+ </View>}
|
|
|
+ {data.type == 1 &&
|
|
|
+ <View className="formItem">
|
|
|
+ <View className="formName">公出时间:</View>
|
|
|
+ <View className="formValue">
|
|
|
+ <View
|
|
|
+ className="time"
|
|
|
+ onClick={() => {
|
|
|
+ this.setState({
|
|
|
+ isPickerRender: true,
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {this.state.rangeStartMinuteVal &&
|
|
|
+ this.state.rangeEndMinuteVal ? (
|
|
|
+ <View className="timeContent">
|
|
|
+ <View style={{ textAlign: "center" }}>{this.state.rangeStartMinuteVal}</View>
|
|
|
+ 至
|
|
|
+ <View style={{ textAlign: "center" }}>{this.state.rangeEndMinuteVal}</View>
|
|
|
+ </View>
|
|
|
+ ) : (
|
|
|
+ "请选择时间"
|
|
|
+ )}
|
|
|
+ </View>
|
|
|
+ <timePicker
|
|
|
+ config={{
|
|
|
+ endDate: true,
|
|
|
+ column: "minute",
|
|
|
+ dateLimit: false,
|
|
|
+ limitStartTime: dayjs()
|
|
|
+ .subtract(3, "year")
|
|
|
+ .format("YYYY-MM-DD HH:mm:ss"),
|
|
|
+ limitEndTime: dayjs()
|
|
|
+ .add(3, "year")
|
|
|
+ .format("YYYY-MM-DD HH:mm:ss"),
|
|
|
+ }}
|
|
|
+ isPartition
|
|
|
+ pickerShow={this.state.isPickerRender}
|
|
|
+ onconditionaljudgment={(v) => {
|
|
|
+ let a = dayjs(
|
|
|
+ dayjs(v.detail.endTime)
|
|
|
+ .second(0)
|
|
|
+ .format("YYYY-MM-DD HH:mm:ss")
|
|
|
+ );
|
|
|
+ }}
|
|
|
+ onhidepicker={() => {
|
|
|
+ this.onPickerHide();
|
|
|
+ }}
|
|
|
+ onsetpickertime={(v) => {
|
|
|
+ this.onSetPickerTime(v);
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </View>
|
|
|
+ </View>}
|
|
|
+ {data.type == 1 &&
|
|
|
+ <View className="formItem">
|
|
|
+ <View className="formName">公出时长:</View>
|
|
|
+ <View className="formValue">{this.state.totalDuration}小时</View>
|
|
|
+ </View>}
|
|
|
<View className="formItem">
|
|
|
- <View className="formName">公出时间:</View>
|
|
|
- <View className="formValue">
|
|
|
- <View
|
|
|
- className="time"
|
|
|
- onClick={() => {
|
|
|
+ <View className="formName">申请类型:</View>
|
|
|
+ <View className="formValue" onClick={() => {
|
|
|
+ this.setState({
|
|
|
+ isInquiryOpened: true,
|
|
|
+ inquiryTitle: "温馨提示",
|
|
|
+ inquiryContent: "您是否需要重新选择费用类型?原报销数据将清空后,需重新填写!!!",
|
|
|
+ inquiryFn: () => {
|
|
|
this.setState({
|
|
|
- isPickerRender: true,
|
|
|
- });
|
|
|
- }}
|
|
|
- >
|
|
|
- {this.state.rangeStartMinuteVal &&
|
|
|
- this.state.rangeEndMinuteVal ? (
|
|
|
- <View className="timeContent">
|
|
|
- <View style={{ textAlign: "center" }}>{this.state.rangeStartMinuteVal}</View>
|
|
|
- 至
|
|
|
- <View style={{ textAlign: "center" }}>{this.state.rangeEndMinuteVal}</View>
|
|
|
- </View>
|
|
|
- ) : (
|
|
|
- "请选择时间"
|
|
|
- )}
|
|
|
- </View>
|
|
|
- <timePicker
|
|
|
- config={{
|
|
|
- endDate: true,
|
|
|
- column: "minute",
|
|
|
- dateLimit: false,
|
|
|
- limitStartTime: dayjs()
|
|
|
- .subtract(3, "year")
|
|
|
- .format("YYYY-MM-DD HH:mm:ss"),
|
|
|
- limitEndTime: dayjs()
|
|
|
- .add(3, "year")
|
|
|
- .format("YYYY-MM-DD HH:mm:ss"),
|
|
|
- }}
|
|
|
- isPartition
|
|
|
- pickerShow={this.state.isPickerRender}
|
|
|
- onconditionaljudgment={(v) => {
|
|
|
- let a = dayjs(
|
|
|
- dayjs(v.detail.endTime)
|
|
|
- .second(0)
|
|
|
- .format("YYYY-MM-DD HH:mm:ss")
|
|
|
- );
|
|
|
- // let b = dayjs(dayjs().second(0).format("YYYY-MM-DD HH:mm:ss"));
|
|
|
- // if (a.isBefore(b)) {
|
|
|
- // Taro.showToast({
|
|
|
- // title: "结束时间不能小于当前时间",
|
|
|
- // icon: "none",
|
|
|
- // });
|
|
|
- // v.detail.setLv(false);
|
|
|
- // }
|
|
|
- }}
|
|
|
- onhidepicker={() => {
|
|
|
- this.onPickerHide();
|
|
|
- }}
|
|
|
- onsetpickertime={(v) => {
|
|
|
- this.onSetPickerTime(v);
|
|
|
- }}
|
|
|
- />
|
|
|
+ typeVisible: "edit"
|
|
|
+ })
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }}>
|
|
|
+ {getAccountName(data.type, data.typeOther)}
|
|
|
+ <AtIcon value="chevron-right" size="20" color="#000000" />
|
|
|
</View>
|
|
|
</View>
|
|
|
<View className="formItem">
|
|
|
- <View className="formName">公出时长:</View>
|
|
|
- <View className="formValue">{this.state.totalDuration}小时</View>
|
|
|
- </View>
|
|
|
- <View className="formItem">
|
|
|
- <View className="formName">申请类型:</View>
|
|
|
- <View className="formValue">{getAccountName(data.type, data.typeOther)}</View>
|
|
|
- </View>
|
|
|
- {/* <View className="formItem">
|
|
|
<View className="formName">报销至订单:</View>
|
|
|
- <View className="formValue"></View>
|
|
|
- </View> */}
|
|
|
+ <View className="formValue" onClick={() => {
|
|
|
+ Taro.navigateTo({
|
|
|
+ url: "/pages/dataindex/index"
|
|
|
+ })
|
|
|
+ }}>
|
|
|
+ <View>
|
|
|
+ <View>{this.state.orderName}</View>
|
|
|
+ <View>{this.state.contractNo}</View>
|
|
|
+ </View>
|
|
|
+ <AtIcon value="chevron-right" size="20" color="#000000" />
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
<View className="formTitle">
|
|
|
报销详细
|
|
|
</View>
|
|
@@ -433,19 +567,72 @@ class Drafts extends Component {
|
|
|
<View className="formName">申请人:</View>
|
|
|
<View className="formValue">{data.aname}</View>
|
|
|
</View>
|
|
|
+ {
|
|
|
+ data.type != 4 && data.type != 5 &&
|
|
|
+ <View className="formItem">
|
|
|
+ <View className="formName">报销公司:</View>
|
|
|
+ <View className="formValue">
|
|
|
+ <Picker
|
|
|
+ value={departmentArr.findIndex(item => item.id === data.applyDep)}
|
|
|
+ range={departmentArr} rangeKey='name' mode='selector'
|
|
|
+ onChange={(e) => {
|
|
|
+ const obj = { applyDep: departmentArr[e.detail.value].id, appDepName: departmentArr[e.detail.value].name }
|
|
|
+ this.setState({
|
|
|
+ data: { ...data, ...obj },
|
|
|
+ })
|
|
|
+ }}>
|
|
|
+ <View>
|
|
|
+ {data.appDepName}
|
|
|
+ <AtIcon value="chevron-right" size="20" color="#000000" />
|
|
|
+ </View>
|
|
|
+ </Picker>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ }
|
|
|
<View className="formItem">
|
|
|
- <View className="formName">报销公司:</View>
|
|
|
- <View className="formValue">{data.appDepName}</View>
|
|
|
+ <View className="formName">支付公司:</View>
|
|
|
+ <View className="formValue">
|
|
|
+ <Picker
|
|
|
+ value={departmentArr.findIndex(item => item.id === data.payDep)}
|
|
|
+ range={departmentArr} rangeKey='name' mode='selector'
|
|
|
+ onChange={(e) => {
|
|
|
+ const obj = { payDep: departmentArr[e.detail.value].id, payDepName: departmentArr[e.detail.value].name }
|
|
|
+ this.setState({
|
|
|
+ data: { ...data, ...obj },
|
|
|
+ })
|
|
|
+ }}>
|
|
|
+ <View>
|
|
|
+ {data.payDepName}
|
|
|
+ <AtIcon value="chevron-right" size="20" color="#000000" />
|
|
|
+ </View>
|
|
|
+ </Picker>
|
|
|
+ </View>
|
|
|
</View>
|
|
|
<View className="formItem">
|
|
|
- <View className="formName">支付公司:</View>
|
|
|
- <View className="formValue">{data.payDepName}</View>
|
|
|
+ <View className="formName">报销事由:</View>
|
|
|
+ <View className="formValues">
|
|
|
+ <AtTextarea
|
|
|
+ value={data.remarks == null ? "" : data.remarks}
|
|
|
+ onChange={e => {
|
|
|
+ const obj = { remarks: e }
|
|
|
+ this.setState({
|
|
|
+ data: { ...data, ...obj }
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ maxLength={30}
|
|
|
+ placeholder="请填写报销事由"
|
|
|
+ />
|
|
|
+ </View>
|
|
|
</View>
|
|
|
<View className="formTitle">
|
|
|
报销费用详细
|
|
|
<Button className="ftBottom" size='mini' type='primary'
|
|
|
onClick={() => {
|
|
|
- this.setState({ visible: "add" })
|
|
|
+ data.type == 1
|
|
|
+ ? this.setState({ visible: "add" })
|
|
|
+ : Taro.navigateTo({
|
|
|
+ url: `/pages/accountFrom/index?type=${data.type}&id=${this.$instance.router.params.id}`
|
|
|
+ })
|
|
|
}}>+ 增加</Button>
|
|
|
</View>
|
|
|
{this.state.visible != "" &&
|
|
@@ -454,9 +641,76 @@ class Drafts extends Component {
|
|
|
visible={this.state.visible}
|
|
|
onClose={this.onClose.bind(this)}
|
|
|
/>}
|
|
|
- {list?.map(item =>
|
|
|
- item.type == 1
|
|
|
- ? <View className="unItem" key={item.id}>
|
|
|
+ {/* 差旅费显示 */}
|
|
|
+ {data.type == 1 &&
|
|
|
+ list?.map(item =>
|
|
|
+ item.type == 1
|
|
|
+ ? <View className="unItem" key={item.id}>
|
|
|
+ <View className="close"
|
|
|
+ onClick={() => {
|
|
|
+ this.setState({
|
|
|
+ isInquiryOpened: true,
|
|
|
+ inquiryTitle: "提醒",
|
|
|
+ inquiryContent: "您确定要删除吗?",
|
|
|
+ inquiryFn: () => {
|
|
|
+ this.detailsDelete(item.id);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ >删除</View>
|
|
|
+ {/* <View className="edit">编辑</View> */}
|
|
|
+ <View className="formItem">
|
|
|
+ <View className="formName">交通工具:</View>
|
|
|
+ <View className="formValue">{getVehicleName(item.vehicle, item.vehicleOther)}</View>
|
|
|
+ </View>
|
|
|
+ <View className="formItem">
|
|
|
+ <View className="formName">时间:</View>
|
|
|
+ <View className="formValue">
|
|
|
+ <View className="ftxt">{item.startTimeStr}</View>
|
|
|
+ 至
|
|
|
+ <View className="ftxt">{item.endTimeStr}</View>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ <View className="formItem">
|
|
|
+ <View className="formName">地点:</View>
|
|
|
+ <View className="formValue">
|
|
|
+ <View className="ftxt">{item.startDistrict}</View>
|
|
|
+ 至
|
|
|
+ <View className="ftxt">{item.endDistrict}</View>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ <View className="formItem">
|
|
|
+ <View className="formName">金额:</View>
|
|
|
+ <View className="formValue">{item.amount}(元)</View>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ : <View className="inputFormItems" key={item.id}>
|
|
|
+ <AtInput
|
|
|
+ name={item.id}
|
|
|
+ title={getTypeName(item.type) + ":"}
|
|
|
+ type='number'
|
|
|
+ placeholder='请输入金额(元)'
|
|
|
+ value={item.amount}
|
|
|
+ />
|
|
|
+ (元)
|
|
|
+ <View className="close"
|
|
|
+ onClick={() => {
|
|
|
+ this.setState({
|
|
|
+ isInquiryOpened: true,
|
|
|
+ inquiryTitle: "提醒",
|
|
|
+ inquiryContent: "您确定要删除吗?",
|
|
|
+ inquiryFn: () => {
|
|
|
+ this.detailsDelete(item.id);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ >删除</View>
|
|
|
+ </View>)
|
|
|
+ }
|
|
|
+ {/* 通用 */}
|
|
|
+ {(data.type == 0 || data.type == 2 || data.type == 4 || data.type == 5) &&
|
|
|
+ list?.map(item =>
|
|
|
+ <View className="unItem" key={item.id}>
|
|
|
<View className="close"
|
|
|
onClick={() => {
|
|
|
this.setState({
|
|
@@ -469,42 +723,22 @@ class Drafts extends Component {
|
|
|
});
|
|
|
}}
|
|
|
>删除</View>
|
|
|
- <View className="edit">编辑</View>
|
|
|
- <View className="formItem">
|
|
|
- <View className="formName">交通工具:</View>
|
|
|
- <View className="formValue">{getVehicleName(item.vehicle, item.vehicleOther)}</View>
|
|
|
- </View>
|
|
|
+ {/* <View className="edit">编辑</View> */}
|
|
|
<View className="formItem">
|
|
|
- <View className="formName">时间:</View>
|
|
|
- <View className="formValue">
|
|
|
- <View className="ftxt">{item.startTimeStr}</View>
|
|
|
- 至
|
|
|
- <View className="ftxt">{item.endTimeStr}</View>
|
|
|
- </View>
|
|
|
- </View>
|
|
|
- <View className="formItem">
|
|
|
- <View className="formName">地点:</View>
|
|
|
- <View className="formValue">
|
|
|
- <View className="ftxt">{item.startDistrict}</View>
|
|
|
- 至
|
|
|
- <View className="ftxt">{item.endDistrict}</View>
|
|
|
- </View>
|
|
|
+ <View className="formName">需付款时间:</View>
|
|
|
+ <View className="formValue">{item.agreeTimeStr.slice(0, 10)}</View>
|
|
|
</View>
|
|
|
<View className="formItem">
|
|
|
<View className="formName">金额:</View>
|
|
|
<View className="formValue">{item.amount}(元)</View>
|
|
|
</View>
|
|
|
</View>
|
|
|
- : <View className="inputFormItems" key={item.id}>
|
|
|
- <AtInput
|
|
|
- name={item.id}
|
|
|
- title={getTypeName(item.type) + ":"}
|
|
|
- type='number'
|
|
|
- placeholder='请输入金额(元)'
|
|
|
- value={item.amount}
|
|
|
- // onChange={e => { console.log("---", e) }}
|
|
|
- />
|
|
|
- (元)
|
|
|
+ )
|
|
|
+ }
|
|
|
+ {/* 第三方付款 */}
|
|
|
+ {data.type == 3 &&
|
|
|
+ list?.map(item =>
|
|
|
+ <View className="unItem" key={item.id}>
|
|
|
<View className="close"
|
|
|
onClick={() => {
|
|
|
this.setState({
|
|
@@ -517,7 +751,50 @@ class Drafts extends Component {
|
|
|
});
|
|
|
}}
|
|
|
>删除</View>
|
|
|
- </View>)}
|
|
|
+ {/* <View className="edit">编辑</View> */}
|
|
|
+ <View className="formItem">
|
|
|
+ <View className="formName">需付款时间:</View>
|
|
|
+ <View className="formValue">{item.agreeTimeStr.slice(0, 10)}</View>
|
|
|
+ </View>
|
|
|
+ <View className="formItem">
|
|
|
+ <View className="formName">付款方式:</View>
|
|
|
+ <View className="formValue">{["公对公转账"][item.payType]}</View>
|
|
|
+ </View>
|
|
|
+ <View className="formItem">
|
|
|
+ <View className="formName">发票类型:</View>
|
|
|
+ <View className="formValue">{["普票", "专票"][item.invoiceType]}</View>
|
|
|
+ </View>
|
|
|
+ <View className="formItem">
|
|
|
+ <View className="formName">发票号:</View>
|
|
|
+ <View className="formValue">{item.invoiceNo}</View>
|
|
|
+ </View>
|
|
|
+ <View className="formItem">
|
|
|
+ <View className="formName">付款单位:</View>
|
|
|
+ <View className="formValue">{item.payerName}</View>
|
|
|
+ </View>
|
|
|
+ <View className="formItem">
|
|
|
+ <View className="formName">开户银行:</View>
|
|
|
+ <View className="formValue">{item.openBank}</View>
|
|
|
+ </View>
|
|
|
+ <View className="formItem">
|
|
|
+ <View className="formName">银行账户:</View>
|
|
|
+ <View className="formValue">{item.bankAccounts}</View>
|
|
|
+ </View>
|
|
|
+ <View className="formItem">
|
|
|
+ <View className="formName">开户行地址:</View>
|
|
|
+ <View className="formValue">{item.openBankAddress}</View>
|
|
|
+ </View>
|
|
|
+ <View className="formItem">
|
|
|
+ <View className="formName">金额:</View>
|
|
|
+ <View className="formValue">{item.amount}</View>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ <View className="formItem">
|
|
|
+ <View className="formName">预借支:</View>
|
|
|
+ <View className="formValue"></View>
|
|
|
+ </View>
|
|
|
<View className="formItem" style={{ paddingTop: "10px" }}>
|
|
|
<View className="formName">总金额:</View>
|
|
|
<View className="formValue"><Text style={{ color: "red" }}>{total}</Text>(元)</View>
|
|
@@ -540,10 +817,11 @@ class Drafts extends Component {
|
|
|
<View className="tips">①需要提供发票报销</View>
|
|
|
<View className="tips">②需要填写报销明细表</View>
|
|
|
<View className="tips">③招待费需要提供报备截图</View>
|
|
|
- <View className="formTitle" style={{ marginTop: "20px" }}>
|
|
|
- 报销收款账户
|
|
|
- </View>
|
|
|
- {data.type != 2 &&
|
|
|
+ {data.type != 3 &&
|
|
|
+ <View className="formTitle" style={{ marginTop: "20px" }}>
|
|
|
+ 报销收款账户
|
|
|
+ </View>}
|
|
|
+ {data.type != 3 &&
|
|
|
<View className="unobstructedList">
|
|
|
{(!bankData.id)
|
|
|
? <View className="noAccout" onClick={() => { this.setState({ accountvisible: true }) }}>
|
|
@@ -630,6 +908,15 @@ class Drafts extends Component {
|
|
|
<Button type='primary' onClick={() => { this.selectOn() }}>确定</Button>
|
|
|
</AtModalAction>
|
|
|
</AtModal>
|
|
|
+ {/* 申请类型修改 */}
|
|
|
+ {this.state.typeVisible != "" &&
|
|
|
+ <Select
|
|
|
+ visible={this.state.typeVisible}
|
|
|
+ onClose={this.onTypeClose.bind(this)}
|
|
|
+ onOk={this.onTypeOk.bind(this)}
|
|
|
+ type={data.type}
|
|
|
+ other={data.typeOther}
|
|
|
+ />}
|
|
|
</View>
|
|
|
);
|
|
|
}
|