OA/pages/addfinance/index.vue

474 lines
9.3 KiB
Vue
Raw Normal View History

2023-11-05 00:10:05 +08:00
<template>
<view class="content">
<view class="content-middle">
<form report-submit='true'>
<view class='merchantsSettled'>
<view class='list' style="padding-bottom: 30rpx;">
<view class="item">
<view class="acea-row row-middle">
<text class="item-name">发票id:</text>
2023-11-09 09:44:44 +08:00
<input placeholder="请输入发票id" type="text" readonly disabled v-model="typename" @click="show4=true">
2023-11-05 00:10:05 +08:00
</view>
</view>
<view class="item">
<view class="acea-row row-middle">
<text class="item-name">到账类型 :</text>
<input placeholder="请输入到账类型" type="text" disabled readonly v-model="name"
@click="show3=true">
</view>
</view>
<view class="item">
<view class="acea-row row-middle">
<text class="item-name">备注:</text>
2023-11-09 09:44:44 +08:00
<input placeholder="请输入备注" type="text" readonly v-model="remarks">
2023-11-05 00:10:05 +08:00
</view>
</view>
<view class="item">
<view class="acea-row row-middle">
<text class="item-name">到账日期:</text>
<input placeholder="请输入到账日期" type="text" disabled v-model="merchantData.enter_time"
@click="endmonth=true">
</view>
</view>
<view class="item">
<view class="acea-row row-middle">
<text class="item-name">到账金额:</text>
2023-11-09 09:44:44 +08:00
<input placeholder="请输入到账金额" type="text" v-model="amount">
2023-11-05 00:10:05 +08:00
</view>
</view>
</view>
</view>
</form>
2023-11-09 09:44:44 +08:00
<u-action-sheet :show="show3" :actions="actions3" title="请选择发票类型" @close="show3 = false" @select="Select3">
</u-action-sheet>
<u-action-sheet :show="show4" :actions="actions4" title="请选择发票列表" @close="show4 = false" @select="Select4">
2023-11-05 00:10:05 +08:00
</u-action-sheet>
<u-datetime-picker :show="endmonth" mode="date" closeOnClickOverlay @confirm="end_monthConfirm"
@cancel="end_monthClose" @close="end_monthClose"></u-datetime-picker>
<view class="content-bottom">
<view class="content-bottom-two" @click="submit">
立即提交
</view>
</view>
</view>
</view>
</template>
<script>
import {
2023-11-09 09:44:44 +08:00
addincome,
invoicecheckedlist
2023-11-05 00:10:05 +08:00
} from '@/api/oa.js'
import {
Toast
} from '@/libs/uniApi.js'
export default {
data() {
return {
endmonth: false,
validate: false,
columns3: [],
flag1: false,
name: "",
merchantData: {
},
show3: false,
2023-11-09 09:44:44 +08:00
show4: false,
2023-11-05 00:10:05 +08:00
amount: '',
2023-11-09 09:44:44 +08:00
remarks:'',
2023-11-05 00:10:05 +08:00
actions3: [{
name: '部分到账',
id: 1
}, {
name: '全部到账',
id: 2
}, {
name: '全部反到账',
id: 3
}],
uidtype: 1,
2023-11-09 09:44:44 +08:00
actions4: [],
typename:''
2023-11-05 00:10:05 +08:00
};
},
onLoad(option) {
this.type = option.type
2023-11-09 09:44:44 +08:00
2023-11-05 00:10:05 +08:00
2023-11-09 09:44:44 +08:00
this.datalist()
2023-11-05 00:10:05 +08:00
},
methods: {
2023-11-09 09:44:44 +08:00
async datalist() {
let res = await invoicecheckedlist({
page: 1,
limit: 1000
});
2023-11-20 18:25:05 +08:00
//console.log(res)
2023-11-09 09:44:44 +08:00
const detailTypeOptions = res.data.data.map((step, index) => {
return {
name: step.name +','+ step.amount,
id: step.id,
};
});
2023-11-20 18:25:05 +08:00
// //console.log(detailTypeOptions)
2023-11-09 09:44:44 +08:00
this.actions4=detailTypeOptions
},
2023-11-05 00:10:05 +08:00
//结束月份
end_monthClose() {
this.endmonth = false
},
end_monthConfirm(e) {
this.endmonth = false
if (this.uidtype == 1) {
this.merchantData.enter_time = []
this.merchantData.enter_time.push(uni.$u.timeFormat(e.value, 'yyyy-mm-dd'))
} else {
this.merchantData.enter_time = uni.$u.timeFormat(e.value, 'yyyy-mm-dd')
}
},
Select3(e) {
2023-11-20 18:25:05 +08:00
// //console.log(e)
2023-11-05 00:10:05 +08:00
this.merchantData.enter_type = e.id
this.uidtype = e.id
this.name = e.name
},
2023-11-09 09:44:44 +08:00
Select4(e) {
2023-11-20 18:25:05 +08:00
// //console.log(e)
2023-11-09 09:44:44 +08:00
this.merchantData.inid = e.id
this.typename = e.name
},
2023-11-05 00:10:05 +08:00
validateForm: function() {
this.merchantData.amount = []
2023-11-09 09:44:44 +08:00
this.merchantData.remarks=[]
2023-11-05 00:10:05 +08:00
this.merchantData.amount.push(this.amount)
2023-11-09 09:44:44 +08:00
this.merchantData.remarks.push(this.remarks)
2023-11-05 00:10:05 +08:00
let that = this,
value = that.merchantData;
2023-11-20 18:25:05 +08:00
// //console.log(this.merchantData)
2023-11-05 00:10:05 +08:00
if (!value.enter_type) return Toast(
'请选择到账类型'
);
2023-11-09 09:44:44 +08:00
if (!value.inid) return Toast('请输入发票 id');
2023-11-05 00:10:05 +08:00
if (!value.enter_time) return Toast('请输入到账时间');
2023-11-09 09:44:44 +08:00
if (!value.amount.length > 0) return Toast('请输入金额');
2023-11-05 00:10:05 +08:00
that.validate = true;
return true;
},
async submit() {
let that = this
2023-11-20 18:25:05 +08:00
//console.log(that.validate)
2023-11-05 00:10:05 +08:00
if (this.validateForm() && this.validate) {
2023-11-09 09:44:44 +08:00
const res = await addincome(this.merchantData)
2023-11-05 00:10:05 +08:00
Toast(res.msg);
if (res.code == 0) {
uni.navigateBack({
delta: 1
})
}
}
}
}
};
</script>
<style lang="scss">
page {
padding-bottom: 88rpx;
}
.content-top {
width: 100%;
background: #3274F9;
position: fixed;
z-index: 100;
}
.content-middle {
padding: 28rpx 28rpx;
.content-middle-title {
font-size: 35rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #333333;
margin-bottom: 35rpx;
}
.merchantsSettled .list {
background-color: #fff;
border-radius: 12px;
}
.application-record {
position: absolute;
display: flex;
align-items: center;
top: 240rpx;
right: 0;
color: #fff;
font-size: 22rpx;
background-color: rgba(0, 0, 0, 0.3);
padding: 8rpx 18rpx;
border-radius: 20px 0px 0px 20px;
}
.merchantsSettled .list .item {
padding: 50rpx 0 20rpx;
position: relative;
margin: 0 20px;
&.no-border {
border-bottom: none;
padding-left: 0;
padding-right: 0;
}
.item-title {
color: #666666;
font-size: 28rpx;
display: block;
}
.item-desc {
color: #B2B2B2;
font-size: 22rpx;
display: block;
margin-top: 9rpx;
line-height: 36rpx;
}
}
.item-name {
width: 160rpx;
margin-right: 10rpx;
}
.acea-row,
.upload {
display: -webkit-box;
display: -moz-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-lines: multiple;
-moz-box-lines: multiple;
-o-box-lines: multiple;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
}
.upload {
margin-top: 20rpx;
}
.acea-row.row-middle {
-webkit-box-align: center;
-moz-box-align: center;
-o-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
padding-left: 2px;
}
.acea-row.row-column {
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
-o-box-orient: vertical;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
}
.acea-row.row-center-wrapper {
-webkit-box-align: center;
-moz-box-align: center;
-o-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
-webkit-box-pack: center;
-moz-box-pack: center;
-o-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
}
.uni-list-cell-db {
position: relative;
}
.merchantsSettled .list .item input {
width: 400rpx;
font-size: 30rpx;
}
.merchantsSettled .list .item .placeholder {
color: #b2b2b2;
}
.merchantsSettled .default {
padding: 0 30rpx;
height: 90rpx;
background-color: #fff;
margin-top: 23rpx;
}
.merchantsSettled .default checkbox {
margin-right: 15rpx;
}
.merchantsSettled .acea-row uni-image {
width: 20px;
height: 20px;
display: block;
}
.merchantsSettled .list .item .codeIput {
width: 125px;
}
.uni-input-input {
display: block;
height: 100%;
background: none;
color: inherit;
opacity: 1;
-webkit-text-fill-color: currentcolor;
font: inherit;
line-height: inherit;
letter-spacing: inherit;
text-align: inherit;
text-indent: inherit;
text-transform: inherit;
text-shadow: inherit;
}
.merchantsSettled .list .item .code {
position: absolute;
width: 93px;
line-height: 27px;
border: 1px solid var(--view-theme);
border-radius: 15px;
color: var(--view-theme);
text-align: center;
bottom: 8px;
right: 0;
font-size: 12px;
}
.merchantsSettled .list .item .code.on {
background-color: #bbb;
color: #fff;
border-color: #bbb;
}
.merchantsSettled .submitBtn {
width: 588rpx;
margin: 0 auto;
height: 86rpx;
border-radius: 25px;
text-align: center;
line-height: 86rpx;
font-size: 15px;
color: #fff;
background: #E3E3E3;
margin-top: 25px;
pointer-events: none;
}
.merchantsSettled .submitBtn.on {
background: var(--view-theme);
pointer-events: all;
}
uni-checkbox-group,
.settleAgree {
display: inline-block;
font-size: 24rpx;
}
uni-checkbox-group {
color: #b2b2b2;
}
.settleAgree {
color: var(--view-theme);
position: relative;
top: 2px;
left: 8px;
}
.merchantsSettled uni-checkbox .uni-checkbox-wrapper {
width: 30rpx;
height: 30rpx;
border: 2rpx solid #C3C3C3;
border-radius: 15px;
}
}
.content-bottom {
width: 485rpx;
height: 88rpx;
position: absolute;
bottom: 30rpx;
left: 50%;
margin-left: -242.5rpx;
position: fixed;
.content-bottom-two {
width: 485rpx;
height: 88rpx;
line-height: 88rpx;
text-align: center;
font-size: 32rpx;
border-radius: 60rpx 60rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
background: #3274F9;
}
}
</style>