|
@@ -344,7 +344,7 @@ class Drafts extends Component {
|
|
|
|
|
|
// 提交申请
|
|
|
onSubmit() {
|
|
|
- const { data, bankData } = this.state
|
|
|
+ const { data, bankData, list } = this.state
|
|
|
if (data.type == 1) {
|
|
|
if (!data.userNames) {
|
|
|
Taro.showToast({ title: "请填写公出客户名称", icon: "none" });
|
|
@@ -367,6 +367,16 @@ class Drafts extends Component {
|
|
|
Taro.showToast({ title: "请填写报销事由", icon: "none" });
|
|
|
return;
|
|
|
}
|
|
|
+ if (list.length == 0) {
|
|
|
+ Taro.showToast({ title: "请先添加报销/申请费用详细", icon: "none" });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (data.type == 5) {
|
|
|
+ if (!data.debitId) {
|
|
|
+ Taro.showToast({ title: "请选择需抵扣的借支", icon: "none" });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
this.setState({
|
|
|
loading: true,
|
|
@@ -378,12 +388,12 @@ class Drafts extends Component {
|
|
|
type: data.type, // 报销类型
|
|
|
typeOther: data.type == 0 ? data.typeOther : undefined, // 其他类型
|
|
|
remarks: data.remarks, // 报销事由
|
|
|
- applyDep: data.applyDep, // 申请部门
|
|
|
+ applyDep: (data.type == 4 || data.type == 5) ? undefined : data.applyDep, // 申请部门(借支抵扣不需要)
|
|
|
attachmentUrl: this.state.imgs.length === 0 ? "" : this.state.imgs.join(","), // 附件
|
|
|
- payDep: (data.type == 4 || data.type == 5) ? undefined : data.payDep, // 支付部门(借支抵扣不需要)
|
|
|
+ payDep: data.payDep, // 支付部门
|
|
|
orderNo: (data.type == 4 || data.type == 5) ? undefined : data.orderNo, // 订单编号(借支抵扣不需要)
|
|
|
debitId: data.type == 4 ? undefined : data.debitId, // 预支单
|
|
|
- eaaid: data.type == 3 ? undefined : bankData.id, // 报销账户(第三方付款不需要)
|
|
|
+ eaaid: (data.type == 3 || data.type == 5) ? undefined : bankData.id, // 报销账户(第三方付款和抵扣不需要)
|
|
|
// 差旅费
|
|
|
userNames: data.type == 1 ? data.userNames : undefined, // 公出客户名称
|
|
|
districtName: data.type == 1 ? data.districtName : undefined, // 公出地点
|
|
@@ -591,7 +601,7 @@ class Drafts extends Component {
|
|
|
</View>
|
|
|
</View>}
|
|
|
<View className="formTitle">
|
|
|
- 报销详细
|
|
|
+ {(data.type == 4 || data.type == 5) ? "申请详细" : "报销详细"}
|
|
|
</View>
|
|
|
<View className="formItem">
|
|
|
<View className="formName">申请人:</View>
|
|
@@ -620,7 +630,10 @@ class Drafts extends Component {
|
|
|
</View>
|
|
|
}
|
|
|
<View className="formItem">
|
|
|
- <View className="formName">支付公司:</View>
|
|
|
+ <View className="formName">
|
|
|
+ {data.type == 4
|
|
|
+ ? "预借支公司:" : data.type == 5
|
|
|
+ ? "抵扣公司:" : "支付公司:"}</View>
|
|
|
<View className="formValue">
|
|
|
<Picker
|
|
|
value={departmentArr.findIndex(item => item.id === data.payDep)}
|
|
@@ -639,7 +652,7 @@ class Drafts extends Component {
|
|
|
</View>
|
|
|
</View>
|
|
|
<View className="formItem">
|
|
|
- <View className="formName">报销事由:</View>
|
|
|
+ <View className="formName">{(data.type == 4 || data.type == 5) ? "说明:" : "报销事由:"}</View>
|
|
|
<View className="formValues">
|
|
|
<AtTextarea
|
|
|
value={data.remarks == null ? "" : data.remarks}
|
|
@@ -651,12 +664,12 @@ class Drafts extends Component {
|
|
|
}}
|
|
|
height={75}
|
|
|
maxLength={50}
|
|
|
- placeholder="请填写报销事由"
|
|
|
+ placeholder={(data.type == 4 || data.type == 5) ? "请填写说明:" : "请填写报销事由"}
|
|
|
/>
|
|
|
</View>
|
|
|
</View>
|
|
|
<View className="formTitle">
|
|
|
- 报销费用详细
|
|
|
+ {data.type != 4 && data.type != 5 && "报销"}费用详细
|
|
|
<Button className="ftBottom" size='mini' type='primary'
|
|
|
onClick={() => {
|
|
|
data.type == 1
|
|
@@ -736,8 +749,7 @@ class Drafts extends Component {
|
|
|
});
|
|
|
}}
|
|
|
>删除</View>
|
|
|
- </View>)
|
|
|
- }
|
|
|
+ </View>)}
|
|
|
{/* 通用 */}
|
|
|
{(data.type == 0 || data.type == 2 || data.type == 4 || data.type == 5) &&
|
|
|
list?.map(item =>
|
|
@@ -756,16 +768,19 @@ class Drafts extends Component {
|
|
|
>删除</View>
|
|
|
{/* <View className="edit">编辑</View> */}
|
|
|
<View className="formItem">
|
|
|
- <View className="formName">需付款时间:</View>
|
|
|
+ <View className="formName">{data.type == 5 ? "支付时间:" : "需付款时间:"}</View>
|
|
|
<View className="formValue">{item.agreeTimeStr.slice(0, 10)}</View>
|
|
|
</View>
|
|
|
<View className="formItem">
|
|
|
- <View className="formName">金额:</View>
|
|
|
+ <View className="formName">
|
|
|
+ {data.type == 4
|
|
|
+ ? "预借支金额:" : data.type == 5
|
|
|
+ ? "抵扣金额:" : "金额:"}
|
|
|
+ </View>
|
|
|
<View className="formValue">{item.amount}(元)</View>
|
|
|
</View>
|
|
|
</View>
|
|
|
- )
|
|
|
- }
|
|
|
+ )}
|
|
|
{/* 第三方付款 */}
|
|
|
{data.type == 3 &&
|
|
|
list?.map(item =>
|
|
@@ -820,12 +835,10 @@ class Drafts extends Component {
|
|
|
<View className="formValue">{item.amount}</View>
|
|
|
</View>
|
|
|
</View>
|
|
|
- )
|
|
|
- }
|
|
|
- {
|
|
|
- data.type != 4 &&
|
|
|
+ )}
|
|
|
+ {data.type != 4 &&
|
|
|
<View className="formItem">
|
|
|
- <View className="formName">预借支:</View>
|
|
|
+ <View className="formName">{data.type == 5 ? "抵扣借支:" : "抵扣:"}</View>
|
|
|
<View className="formValue"
|
|
|
onClick={() => {
|
|
|
Taro.navigateTo({
|
|
@@ -834,21 +847,23 @@ class Drafts extends Component {
|
|
|
}}
|
|
|
>
|
|
|
{!data.debitId
|
|
|
- ? <Button size='mini' type='primary' style={{ marginRight: 0 }}>选择借支订单</Button>
|
|
|
+ ? <Button size='mini' type='primary' style={{ marginRight: 0 }}>{'抵扣借支'}</Button>
|
|
|
: <View>已选择<Text style={{ color: "red" }}>{data.debitTotalAmount}</Text>元借支订单
|
|
|
<AtIcon value="chevron-right" size="20" color="#000000" />
|
|
|
</View>}
|
|
|
</View>
|
|
|
- </View>
|
|
|
- }
|
|
|
- <View className="formItem" style={{ paddingTop: "10px" }}>
|
|
|
- <View className="formName">总金额:</View>
|
|
|
- <View className="formValue"><Text style={{ color: "red" }}>{total}</Text>(元)</View>
|
|
|
- </View>
|
|
|
- <View className="formItem" style={{ paddingTop: "10px" }}>
|
|
|
- <View className="formName">实报金额:</View>
|
|
|
- <View className="formValue"><Text style={{ color: "red" }}>{this.state.reality}</Text>(元)</View>
|
|
|
- </View>
|
|
|
+ </View>}
|
|
|
+ {data.type != 4 && data.type != 5 && < View className="tips">注:如需抵扣借支,请选择对应的借支订单</View>}
|
|
|
+ {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 className="formItem" style={{ paddingTop: "10px" }}>
|
|
|
+ <View className="formName">实报金额:</View>
|
|
|
+ <View className="formValue"><Text style={{ color: "red" }}>{this.state.reality}</Text>(元)</View>
|
|
|
+ </View>}
|
|
|
<View className="formItem" style={{ display: "block", paddingBottom: 0 }}>
|
|
|
<View className="formName">附件:</View>
|
|
|
<View
|
|
@@ -869,11 +884,14 @@ 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 &&
|
|
|
+ </View>
|
|
|
+ }
|
|
|
+ {
|
|
|
+ data.type != 3 && data.type != 5 &&
|
|
|
<View className="unobstructedList">
|
|
|
{(!bankData.id)
|
|
|
? <View className="noAccout" onClick={() => { this.setState({ accountvisible: true }) }}>
|
|
@@ -901,7 +919,8 @@ class Drafts extends Component {
|
|
|
<View className="formName">收款账户:{bankData.accounts}</View>
|
|
|
</View>
|
|
|
</View>}
|
|
|
- </View>}
|
|
|
+ </View>
|
|
|
+ }
|
|
|
<View className="bottom">
|
|
|
<AtButton
|
|
|
disabled={this.state.loading}
|
|
@@ -939,13 +958,15 @@ class Drafts extends Component {
|
|
|
}}
|
|
|
/>
|
|
|
{/* 收款账户添加 */}
|
|
|
- {this.state.accountvisible != "" &&
|
|
|
+ {
|
|
|
+ this.state.accountvisible != "" &&
|
|
|
<AccountModal
|
|
|
isSub={true}
|
|
|
visible={this.state.accountvisible}
|
|
|
onClose={this.onAccountClose.bind(this)}
|
|
|
onOk={this.onAccountOk.bind(this)}
|
|
|
- />}
|
|
|
+ />
|
|
|
+ }
|
|
|
{/* 收款账户列表 */}
|
|
|
<AtModal isOpened={this.state.upaccount}>
|
|
|
<AtModalHeader>请选择收款账户</AtModalHeader>
|
|
@@ -962,15 +983,17 @@ 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}
|
|
|
- />}
|
|
|
- </View>
|
|
|
+ />
|
|
|
+ }
|
|
|
+ </View >
|
|
|
);
|
|
|
}
|
|
|
}
|