|
@@ -1,6 +1,6 @@
|
|
|
import React, { Component } from "react";
|
|
|
import Taro, { getCurrentInstance } from "@tarojs/taro";
|
|
|
-import { Text, View, Picker, Button, Image } from "@tarojs/components";
|
|
|
+import { Text, View, Picker, Button, Image, RadioGroup, Radio, Label } from "@tarojs/components";
|
|
|
import ImagePicker from "../../components/common/imagePicker";
|
|
|
import InquiryModal from "../../components/common/inquiryModal";
|
|
|
import AuditModal from "../../components/common/auditModal";
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
getMainExpenseDetail,
|
|
|
getDepartmentList,
|
|
|
subMainAccount,
|
|
|
+ getDepInfo,
|
|
|
} from "../../utils/servers/servers";
|
|
|
import {
|
|
|
getAccountName,
|
|
@@ -63,6 +64,7 @@ class Drafts extends Component {
|
|
|
accountsList: [],
|
|
|
reason: "",
|
|
|
visible: false,
|
|
|
+ info: {},
|
|
|
};
|
|
|
}
|
|
|
|
|
@@ -70,7 +72,8 @@ class Drafts extends Component {
|
|
|
this.getDepartmentList()
|
|
|
this.$instance.router.params && this.$instance.router.params.id &&
|
|
|
(
|
|
|
- this.getDetail()
|
|
|
+ this.getDetail(),
|
|
|
+ this.getConfig()
|
|
|
// this.getAccountList(),
|
|
|
// this.getMyList()
|
|
|
)
|
|
@@ -178,6 +181,26 @@ class Drafts extends Component {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ // 配置信息
|
|
|
+ getConfig() {
|
|
|
+ getDepInfo({
|
|
|
+ id: this.$instance.router.params.id,
|
|
|
+ }).then(v => {
|
|
|
+ if (v.error.length === 0) {
|
|
|
+ this.setState({
|
|
|
+ info: v.data,
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ Taro.showToast({ title: v.error[0].message, icon: 'none' })
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ Taro.showToast({
|
|
|
+ title: '系统错误,请稍后再试',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
getUrls(url) {
|
|
|
let list = [];
|
|
|
for (let i of (url || '').split(',')) {
|
|
@@ -218,11 +241,18 @@ class Drafts extends Component {
|
|
|
// 审批
|
|
|
examine(val) {
|
|
|
Taro.showLoading({ title: '处理中...' });
|
|
|
- AccountExamine({
|
|
|
+ let obj1 = {
|
|
|
id: this.state.data.id,
|
|
|
reason: this.state.reason,
|
|
|
status: val,
|
|
|
- })
|
|
|
+ }
|
|
|
+ let obj2 = {
|
|
|
+ id: this.state.data.id,
|
|
|
+ reason: this.state.reason,
|
|
|
+ status: val,
|
|
|
+ approval: this.state.approval,
|
|
|
+ }
|
|
|
+ AccountExamine((this.state.data.processStatus == 3 && this.state.info.viceCeoExamine == 1 && val == 1) ? obj2 : obj1)
|
|
|
.then((v) => {
|
|
|
Taro.hideLoading();
|
|
|
if (v.error.length === 0) {
|
|
@@ -248,9 +278,18 @@ class Drafts extends Component {
|
|
|
loading: true,
|
|
|
});
|
|
|
const { data } = this.state
|
|
|
+ if (val == 1) {
|
|
|
+ if (!data.eaaid) {
|
|
|
+ Taro.showToast({
|
|
|
+ title: "请先填写报销账户",
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
let comData = {
|
|
|
id: data.id,
|
|
|
- orderNo: data.orderNo,
|
|
|
+ // orderNo: data.orderNo,
|
|
|
applyDep: data.applyDep,
|
|
|
payDep: data.payDep,
|
|
|
eaaid: data.eaaid,
|
|
@@ -344,7 +383,8 @@ class Drafts extends Component {
|
|
|
<View className="formName" >总金额:</View>
|
|
|
<View className="formValue">{data.totalAmount}元</View>
|
|
|
</View> */}
|
|
|
- <View className="formItem">
|
|
|
+
|
|
|
+ {/* <View className="formItem">
|
|
|
<View className="formName">报销至订单:</View>
|
|
|
<View className="formValue"
|
|
|
onClick={() => {
|
|
@@ -358,7 +398,8 @@ class Drafts extends Component {
|
|
|
</View>
|
|
|
{isEdit && <AtIcon value="chevron-right" size="20" color="#000000" />}
|
|
|
</View>
|
|
|
- </View>
|
|
|
+ </View> */}
|
|
|
+
|
|
|
<View className="formItem">
|
|
|
<View className="formName">报销时间:</View>
|
|
|
<View className="formValue">{data.createTimeStr}</View>
|
|
@@ -446,7 +487,7 @@ class Drafts extends Component {
|
|
|
<View key={it.id} style={{ borderTop: "1px solid #eae8e8" }}>
|
|
|
<View className="formItem" style={{ fontWeight: "bold" }}>
|
|
|
<View className="formName">报销金额:</View>
|
|
|
- <View className="formValue">{it.amount}(元)</View>
|
|
|
+ <View className="formValue">{it.realAmount}(元)</View>
|
|
|
</View>
|
|
|
<View className="formItem" style={{ fontWeight: "bold" }}>
|
|
|
<View className="formName">报销类型:</View>
|
|
@@ -455,6 +496,17 @@ class Drafts extends Component {
|
|
|
{it.type == 2 && (" - " + getSecondaryAccountName(it.secondaryType, it.secondaryTypeOther))}
|
|
|
</View>
|
|
|
</View>
|
|
|
+ {
|
|
|
+ it.publicReleaseType != null &&
|
|
|
+ <View className="formItem" style={{ fontWeight: "bold" }}>
|
|
|
+ <View className="formName">报销来源:</View>
|
|
|
+ <View className="formValue"> {["业务公出", "技术公出", "行政公出", "技术协单", "技术助手"][it.publicReleaseType]}</View>
|
|
|
+ </View>
|
|
|
+ }
|
|
|
+ <View className="formItem" style={{ fontWeight: "bold" }}>
|
|
|
+ <View className="formName">{!!it.contractNo ? "报销至订单:" : "报销至部门"}</View>
|
|
|
+ <View className="formValue">{it.contractNo}</View>
|
|
|
+ </View>
|
|
|
{it.type == 1 &&
|
|
|
<View className="formItem">
|
|
|
<View className="formName">公出企业:</View>
|
|
@@ -476,14 +528,14 @@ class Drafts extends Component {
|
|
|
<View className="formValue">
|
|
|
{getVehicleName(item.vehicle, item.vehicleOther)}
|
|
|
({item.startDistrict + " - " + item.endDistrict})
|
|
|
- {item.amount}(元)
|
|
|
+ {item.realAmount}(元)
|
|
|
</View>
|
|
|
</View>
|
|
|
</View>
|
|
|
: <View className="unItem" key={item.id}>
|
|
|
<View className="formItem" key={item.id}>
|
|
|
<View className="formName" >{getTypeName(item.type) + ":"}</View>
|
|
|
- <View className="formValue">{item.amount}(元)</View>
|
|
|
+ <View className="formValue">{item.realAmount}(元)</View>
|
|
|
</View>
|
|
|
</View>
|
|
|
)
|
|
@@ -503,7 +555,7 @@ class Drafts extends Component {
|
|
|
? "预借支金额:" : it.type == 5
|
|
|
? "抵扣金额:" : "金额:"}
|
|
|
</View>
|
|
|
- <View className="formValue">{item.amount}(元)</View>
|
|
|
+ <View className="formValue">{item.realAmount}(元)</View>
|
|
|
</View>
|
|
|
</View>
|
|
|
)
|
|
@@ -547,7 +599,7 @@ class Drafts extends Component {
|
|
|
</View>
|
|
|
<View className="formItem">
|
|
|
<View className="formName">金额:</View>
|
|
|
- <View className="formValue">{item.amount}(元)</View>
|
|
|
+ <View className="formValue">{item.realAmount}(元)</View>
|
|
|
</View>
|
|
|
</View>
|
|
|
)
|
|
@@ -594,7 +646,7 @@ class Drafts extends Component {
|
|
|
data.type != 4 && data.type != 5 &&
|
|
|
<View className="formItem" style={{ fontWeight: "bold" }}>
|
|
|
<View className="formName">本次报销金额:</View>
|
|
|
- <View className="formValue"><Text style={{ color: "red" }}>{data.amount}</Text>(元)</View>
|
|
|
+ <View className="formValue"><Text style={{ color: "red" }}>{data.realAmount}</Text>(元)</View>
|
|
|
</View>
|
|
|
}
|
|
|
<View className="formTitle" style={{ marginTop: "20px" }}>
|
|
@@ -652,7 +704,7 @@ class Drafts extends Component {
|
|
|
{
|
|
|
data.examine == 1 &&
|
|
|
<View>
|
|
|
- <View className="formTitle" style={{ marginTop: "20px" }}>
|
|
|
+ <View className="formTitle" style={{ marginTop: "10px" }}>
|
|
|
填写审批意见
|
|
|
</View>
|
|
|
<AtTextarea
|
|
@@ -665,6 +717,27 @@ class Drafts extends Component {
|
|
|
maxLength={30}
|
|
|
placeholder="请填写审批意见"
|
|
|
/>
|
|
|
+ {
|
|
|
+ data.processStatus == 3 && this.state.info.viceCeoExamine == 1 &&
|
|
|
+ <View style={{ marginTop: "20px" }}>
|
|
|
+ <RadioGroup
|
|
|
+ onChange={e => {
|
|
|
+ this.setState({
|
|
|
+ approval: e.detail.value
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {[{ value: 0, text: '不需要董事长审核', checked: false },
|
|
|
+ { value: 1, text: '需要董事长审核', checked: false }].map((item, i) => {
|
|
|
+ return (
|
|
|
+ <Label className='radio-list__label' for={i} key={i}>
|
|
|
+ <Radio className='radio-list__radio' value={item.value} checked={item.checked}>{item.text}</Radio>
|
|
|
+ </Label>
|
|
|
+ )
|
|
|
+ })}
|
|
|
+ </RadioGroup>
|
|
|
+ </View>
|
|
|
+ }
|
|
|
<View className="operation">
|
|
|
<AtButton
|
|
|
type="secondary"
|
|
@@ -695,6 +768,9 @@ class Drafts extends Component {
|
|
|
if (!this.state.reason) {
|
|
|
Taro.showToast({ title: "请先填写审批意见", icon: "none" });
|
|
|
return;
|
|
|
+ } else if (data.processStatus == 3 && this.state.info.viceCeoExamine == 1 && !this.state.approval && this.state.approval != 0) {
|
|
|
+ Taro.showToast({ title: "是否需要董事长审核", icon: "none" });
|
|
|
+ return;
|
|
|
}
|
|
|
this.setState({
|
|
|
isInquiryOpened: true,
|
|
@@ -714,12 +790,34 @@ class Drafts extends Component {
|
|
|
{
|
|
|
isEdit &&
|
|
|
<View className="bottom">
|
|
|
+ <View
|
|
|
+ className="lbt"
|
|
|
+ onClick={() => {
|
|
|
+ this.setState({
|
|
|
+ isInquiryOpened: true,
|
|
|
+ inquiryTitle: "提醒",
|
|
|
+ inquiryContent: "您确定取消该报销订单吗?",
|
|
|
+ inquiryFn: () => {
|
|
|
+ this.onSubmit(4);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 取消订单
|
|
|
+ </View>
|
|
|
<AtButton
|
|
|
disabled={this.state.loading}
|
|
|
type="primary"
|
|
|
circle
|
|
|
onClick={() => {
|
|
|
- this.onSubmit(1)
|
|
|
+ this.setState({
|
|
|
+ isInquiryOpened: true,
|
|
|
+ inquiryTitle: "提醒",
|
|
|
+ inquiryContent: "您确定提交该报销订单吗?",
|
|
|
+ inquiryFn: () => {
|
|
|
+ this.onSubmit(1);
|
|
|
+ },
|
|
|
+ });
|
|
|
}}
|
|
|
>
|
|
|
提交报销订单
|