|
@@ -16,6 +16,7 @@ import {
|
|
|
AtRadio,
|
|
|
AtModalAction,
|
|
|
AtIcon,
|
|
|
+ AtToast,
|
|
|
} from "taro-ui";
|
|
|
import {
|
|
|
getPridDetail,
|
|
@@ -92,7 +93,6 @@ class Drafts extends Component {
|
|
|
this.setState({
|
|
|
data: { ...this.state.data, ...obj },
|
|
|
})
|
|
|
-
|
|
|
this.getAccountList();
|
|
|
|
|
|
}
|
|
@@ -265,9 +265,15 @@ class Drafts extends Component {
|
|
|
|
|
|
// 报销单详情
|
|
|
getDetail() {
|
|
|
+ this.setState({
|
|
|
+ loading: true
|
|
|
+ })
|
|
|
getPridDetail({
|
|
|
id: this.$instance.router.params.id,
|
|
|
}).then(v => {
|
|
|
+ this.setState({
|
|
|
+ loading: false
|
|
|
+ })
|
|
|
if (v.error.length === 0) {
|
|
|
let list = [];
|
|
|
for (let i of (v.data.attachmentUrl || '').split(',')) {
|
|
@@ -282,11 +288,14 @@ class Drafts extends Component {
|
|
|
totalDuration: v.data.duration,
|
|
|
imgs: list,
|
|
|
})
|
|
|
- this.getAccountList()
|
|
|
+ // this.getAccountList()
|
|
|
} else {
|
|
|
Taro.showToast({ title: v.error[0].message, icon: 'none' })
|
|
|
}
|
|
|
}).catch(() => {
|
|
|
+ this.setState({
|
|
|
+ loading: false
|
|
|
+ })
|
|
|
Taro.showToast({
|
|
|
title: '系统错误,请稍后再试!',
|
|
|
icon: 'none'
|
|
@@ -296,10 +305,16 @@ class Drafts extends Component {
|
|
|
|
|
|
// 报销详情金额列表
|
|
|
getAccountList() {
|
|
|
+ this.setState({
|
|
|
+ loading: true
|
|
|
+ })
|
|
|
const { data } = this.state
|
|
|
getAccountList({
|
|
|
eaid: this.$instance.router.params.id,
|
|
|
}).then(v => {
|
|
|
+ this.setState({
|
|
|
+ loading: false
|
|
|
+ })
|
|
|
if (v.error.length === 0) {
|
|
|
let sum = 0
|
|
|
for (var i = 0; i < v.data.length; i++) {
|
|
@@ -317,6 +332,9 @@ class Drafts extends Component {
|
|
|
Taro.showToast({ title: v.error[0].message, icon: 'none' })
|
|
|
}
|
|
|
}).catch(() => {
|
|
|
+ this.setState({
|
|
|
+ loading: false
|
|
|
+ })
|
|
|
Taro.showToast({
|
|
|
title: '系统错误,请稍后再试',
|
|
|
icon: 'none'
|
|
@@ -862,10 +880,8 @@ class Drafts extends Component {
|
|
|
<View className="formValue">{item.amount}</View>
|
|
|
</View>
|
|
|
</View>
|
|
|
- )
|
|
|
- }
|
|
|
- {
|
|
|
- data.type != 4 &&
|
|
|
+ )}
|
|
|
+ {data.type != 4 &&
|
|
|
<View className="formItem">
|
|
|
<View className="formName">{data.type == 5 ? "抵扣借支:" : "抵扣:"}</View>
|
|
|
<View className="formValue"
|
|
@@ -881,23 +897,18 @@ class Drafts extends Component {
|
|
|
<AtIcon value="chevron-right" size="20" color="#000000" />
|
|
|
</View>}
|
|
|
</View>
|
|
|
- </View>
|
|
|
- }
|
|
|
+ </View>}
|
|
|
{data.type != 4 && data.type != 5 && < View className="tips">注:如需抵扣借支,请选择对应的借支订单</View>}
|
|
|
- {
|
|
|
- data.type != 4 && data.type != 5 &&
|
|
|
+ {data.type != 4 && data.type != 5 &&
|
|
|
<View className="formItem" style={{ paddingTop: "10px" }}>
|
|
|
<View className="formName">总金额:</View>
|
|
|
<View className="formValue"><Text style={{ color: "red" }}>{total}</Text>(元)</View>
|
|
|
- </View>
|
|
|
- }
|
|
|
- {
|
|
|
- data.type != 4 && data.type != 5 &&
|
|
|
+ </View>}
|
|
|
+ {data.type != 4 && data.type != 5 &&
|
|
|
<View className="formItem" style={{ paddingTop: "10px" }}>
|
|
|
<View className="formName">实报金额:</View>
|
|
|
<View className="formValue"><Text style={{ color: "red" }}>{this.state.reality}</Text>(元)</View>
|
|
|
- </View>
|
|
|
- }
|
|
|
+ </View>}
|
|
|
<View className="formItem" style={{ display: "block", paddingBottom: 0 }}>
|
|
|
<View className="formName">附件:</View>
|
|
|
<View
|
|
@@ -918,14 +929,11 @@ class Drafts extends Component {
|
|
|
<View className="tips">①需要提供发票报销</View>
|
|
|
<View className="tips">②需要填写报销明细表</View>
|
|
|
<View className="tips">③招待费需要提供报备截图</View>
|
|
|
- {
|
|
|
- data.type != 3 &&
|
|
|
+ {data.type != 3 &&
|
|
|
<View className="formTitle" style={{ marginTop: "20px" }}>
|
|
|
报销收款账户
|
|
|
- </View>
|
|
|
- }
|
|
|
- {
|
|
|
- data.type != 3 && data.type != 5 &&
|
|
|
+ </View>}
|
|
|
+ {data.type != 3 && data.type != 5 &&
|
|
|
<View className="unobstructedList">
|
|
|
{(!bankData.id)
|
|
|
? <View className="noAccout" onClick={() => { this.setState({ accountvisible: true }) }}>
|
|
@@ -953,8 +961,7 @@ class Drafts extends Component {
|
|
|
<View className="formName">收款账户:{bankData.accounts}</View>
|
|
|
</View>
|
|
|
</View>}
|
|
|
- </View>
|
|
|
- }
|
|
|
+ </View>}
|
|
|
<View className="bottom">
|
|
|
<AtButton
|
|
|
disabled={this.state.loading}
|
|
@@ -992,16 +999,14 @@ class Drafts extends Component {
|
|
|
}}
|
|
|
/>
|
|
|
{/* 收款账户添加 */}
|
|
|
- {
|
|
|
- this.state.accountvisible != "" &&
|
|
|
+ {this.state.accountvisible != "" &&
|
|
|
<AccountModal
|
|
|
isDefault={true}
|
|
|
isSub={true}
|
|
|
visible={this.state.accountvisible}
|
|
|
onClose={this.onAccountClose.bind(this)}
|
|
|
onOk={this.onAccountOk.bind(this)}
|
|
|
- />
|
|
|
- }
|
|
|
+ />}
|
|
|
{/* 收款账户列表 */}
|
|
|
<AtModal isOpened={this.state.upaccount}>
|
|
|
<AtModalHeader>请选择收款账户</AtModalHeader>
|
|
@@ -1018,16 +1023,15 @@ class Drafts extends Component {
|
|
|
</AtModalAction>
|
|
|
</AtModal>
|
|
|
{/* 申请类型修改 */}
|
|
|
- {
|
|
|
- this.state.typeVisible != "" &&
|
|
|
+ {this.state.typeVisible != "" &&
|
|
|
<Select
|
|
|
visible={this.state.typeVisible}
|
|
|
onClose={this.onTypeClose.bind(this)}
|
|
|
onOk={this.onTypeOk.bind(this)}
|
|
|
type={data.type}
|
|
|
other={data.typeOther}
|
|
|
- />
|
|
|
- }
|
|
|
+ />}
|
|
|
+ <AtToast isOpened={this.state.loading} text="Loading..." status='loading' />
|
|
|
</View >
|
|
|
);
|
|
|
}
|