OA/pages/financeincome/index.vue

646 lines
14 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="content">
<view class="content-middle" :style="{'opacity':!screenShow?'0.4':''}">
<view class="content-middle-three" v-if="list.length>0">
<view class="middle-three">
<view class="middle-threeb" v-for="(items,j) in list" :key='j'>
<liu-swipe-action :index="j" @clickItem="clickItem" :btnList='btnList1'
v-if="items.check_status==2">
<view class="middle-threeb-title">
<view class="title">
{{items.name}}
</view>
<view class="title-status">
{{items.create_time}}
</view>
</view>
<view class="middle-threeba">
<view class="middle-threeb-a">
<!-- check_status 状态0待审核,1审核中,2审核通过,3审核不通过,4已撤销,5已开具,10已作废 -->
<view class="threeb-a-b">
<view class="name">开票人:<text>{{items.open_name}}</text></view>
<view class="name">所属部门:<text>{{items.department_name}}</text></view>
<view class="name">开票金额(元)<text>{{items.amount}}</text></view>
<view class="name">
开票类型:<text>{{items.invoice_type==1?'增值税专用发票':items.invoice_type==2?'普通发票':'专用发票'}}</text>
</view>
<!-- <view class="achor">{{items.name2}}</view> -->
<!-- <view class="middle-edit" @click="editpart(items)">
编辑
</view>
<view class="middle-delete" @click="clickItem(items)">
删除
</view> -->
</view>
</view>
</view>
</liu-swipe-action>
<liu-swipe-action :index="j" @clickItem="clickItem" :btnList='btnList'
v-if="items.check_status==5">
<view class="middle-threeb-title">
<view class="title">
{{items.name}}
</view>
<view class="title-status">
{{items.create_time}}
</view>
</view>
<view class="middle-threeba">
<view class="middle-threeb-a">
<!-- check_status 状态0待审核,1审核中,2审核通过,3审核不通过,4已撤销,5已开具,10已作废 -->
<view class="threeb-a-b">
<view class="name">开票人:<text>{{items.open_name}}</text></view>
<view class="name">所属部门:<text>{{items.department_name}}</text></view>
<view class="name">开票金额(元)<text>{{items.amount}}</text></view>
<view class="name">
开票类型:<text>{{items.invoice_type==1?'增值税专用发票':items.invoice_type==2?'普通发票':'专用发票'}}</text>
</view>
<!-- <view class="achor">{{items.name2}}</view> -->
<!-- <view class="middle-edit" @click="editpart(items)">
编辑
</view>
<view class="middle-delete" @click="clickItem(items)">
删除
</view> -->
</view>
</view>
</view>
</liu-swipe-action>
<liu-swipe-action :index="j" @clickItem="clickItem" :btnList='btnList2'
v-if="items.check_status==10">
<view class="middle-threeb-title">
<view class="title">
{{items.name}}
</view>
<view class="title-status">
{{items.create_time}}
</view>
</view>
<view class="middle-threeba">
<view class="middle-threeb-a">
<!-- check_status 状态0待审核,1审核中,2审核通过,3审核不通过,4已撤销,5已开具,10已作废 -->
<view class="threeb-a-b">
<view class="name">开票人:<text>{{items.open_name}}</text></view>
<view class="name">所属部门:<text>{{items.department_name}}</text></view>
<view class="name">开票金额(元)<text>{{items.amount}}</text></view>
<view class="name">
开票类型:<text>{{items.invoice_type==1?'增值税专用发票':items.invoice_type==2?'普通发票':'专用发票'}}</text>
</view>
<!-- <view class="achor">{{items.name2}}</view> -->
<!-- <view class="middle-edit" @click="editpart(items)">
编辑
</view>
<view class="middle-delete" @click="clickItem(items)">
删除
</view> -->
</view>
</view>
</view>
</liu-swipe-action>
</view>
</view>
</view>
</view>
<view class="content-middle" :style="{'position':'absolute','top':0+'px','zIndex':999}" v-if="!screenShow">
<view class="content-middle-one">
<view class="middle-one">
<view class="content-middle-search">
<text class='iconfont icon-sousuo2'></text>
<input type='text' :value='keyword' placeholder='搜索任务状态、优先级、部门等' placeholder-class='placeholder'
@input="setValue"></input>
</view>
<view class="content-middle-sai" @click="screen" style="background-color: #3274F9;">
<view class="content-middle-saia">
<image src="../../static/images/saixuan.png" mode="aspectFit"></image>
</view>
<view class="content-middle-saib" style="color: #fff;">
筛选
</view>
</view>
</view>
<view class="content-middle-search-detail">
<view class="search-detail" v-for="(item,k) in klist" :key='k'>
<view class="search-detail-one">
<view class="name">
{{item.name}}
</view>
</view>
<view class="search-detail-two">
{{item.name1}}
</view>
</view>
</view>
</view>
</view>
<u-empty v-if="loadConfig.status=='nomore'&& list.length==0" text="没有信息"
icon="/static/empty/data.png"></u-empty>
<u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
</view>
</template>
<script>
import {
invoicecheckedlist,
tovoid,
novoid
} from '@/api/oa.js'
import {
HTTP_REQUEST_URL
} from '@/config/app.js'
import {
Toast
} from '@/libs/uniApi.js'
export default {
data() {
return {
show: false,
btnList: [{
id: '1',
name: '编辑',
width: '100rpx',
height: '100rpx',
bgColor: '#5f92f7',
color: '#FFFFFF',
fontSize: '28rpx'
}, {
id: '2',
name: '作废',
height: '100rpx',
width: '100rpx',
bgColor: '#ed656d',
color: '#FFFFFF',
fontSize: '28rpx'
}],
btnList2: [{
id: '1',
name: '编辑',
width: '100rpx',
height: '100rpx',
bgColor: '#5f92f7',
color: '#FFFFFF',
fontSize: '28rpx'
}, {
id: '4',
name: '反作废',
height: '100rpx',
width: '100rpx',
bgColor: '#ed656d',
color: '#FFFFFF',
fontSize: '28rpx'
}],
btnList1: [{
id: '3',
name: '开票',
width: '100rpx',
height: '100rpx',
bgColor: '#5f92f7',
color: '#FFFFFF',
fontSize: '28rpx'
}],
loadConfig: {
page: 1,
limit: 5,
loadingText: '努力加载中',
loadmoreText: '轻轻上拉',
nomoreText: '我也是有底线的~~',
status: 'loadmore'
},
keyword: '',
list: [],
klist: [],
screenShow: true
};
},
computed: {
httpRequestUrl() {
return HTTP_REQUEST_URL;
}
},
onLoad() {
},
onShow() {
this.initList()
},
onReachBottom() {
this.getDocumentList()
},
onPullDownRefresh() {
uni.stopPullDownRefresh()
},
methods: {
async initList() {
this.loadConfig.page = 1;
this.loadConfig.status = "loadmore";
this.list = [];
await this.getDocumentList();
},
//获取任务
async getDocumentList() {
if (this.loadConfig.status == "nomore") return;
this.loadConfig.status = "loading"
let res = await invoicecheckedlist({
page: this.loadConfig.page,
limit: this.loadConfig.limit,
keyword: this.keyword
})
this.loadConfig.status = "loadmore"
if (res.data.data.length < this.loadConfig.limit) {
this.loadConfig.status = "nomore"
} else {
this.loadConfig.page++;
}
this.list = [...this.list, ...res.data?.data]
},
//添加项目
adddepart() {
uni.navigateTo({
url: '/pages/addquest/index?type=' + 0
})
},
//删除弹窗
clickItem(data) {
//console.log(data)
if (data.id == 2) {
uni.showModal({
content: '确定要作废发票吗',
success: (e) => {
if (e.confirm) {
this.deleteDepartment(this.list[data.index].id)
}
}
})
} else if (data.id == 4) {
uni.showModal({
content: '确定要反作废发票吗',
success: (e) => {
if (e.confirm) {
this.deleteDepartment1(this.list[data.index].id)
}
}
})
} else if (data.id == 3) {
this.editpart(this.list[data.index], '3')
} else {
this.editpart(this.list[data.index], '1')
}
},
//作废
async deleteDepartment(id) {
const res = await tovoid({
id: id
})
if (res.code == 0) {
this.initList()
}
Toast(res.msg);
},
//反作废
async deleteDepartment1(id) {
const res = await novoid({
id: id
})
if (res.code == 0) {
this.initList()
}
Toast(res.msg);
},
taskDetail(item) {
},
//编辑任务
editpart(item, type) {
uni.navigateTo({
url: '/pages/addfinanceincome/index??type=' + type + "&data=" + encodeURIComponent(JSON
.stringify(
item))
})
},
//查询
search() {
this.initList()
},
//输入监听
setValue(e) {
this.keyword = e.detail.value
if (this.keyword.length == 0) {
this.initList()
}
}
}
};
</script>
<style lang="scss">
page {
padding-bottom: 88rpx;
}
.content-middle {
.content-middle-one {
.middle-one {
display: flex;
background-color: #FFFFFF;
padding: 28rpx 18rpx;
.search {
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
width: 149rpx;
line-height: 63rpx;
height: 63rpx;
background: #FFFFFF;
text-align: center;
border-radius: 35rpx 35rpx;
border: 2rpx solid #E6E5E5;
margin-left: 18rpx;
}
.content-middle-search {
display: flex;
width: 527rpx;
height: 63rpx;
line-height: 63rpx;
padding-left: 30rpx;
background: #F7F7F7;
border-radius: 35rpx 35rpx;
font-size: 25rpx;
input {
width: 527rpx;
height: 63rpx;
line-height: 63rpx;
padding-left: 30rpx;
}
.placeholder {
font-size: 25rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
padding-left: 30rpx;
}
}
.content-middle-sai {
display: flex;
width: 149rpx;
height: 63rpx;
line-height: 63rpx;
background: #FFFFFF;
border-radius: 35rpx 35rpx;
border: 2rpx solid #E6E5E5;
margin-left: 18rpx;
.content-middle-saia {
width: 29rpx;
height: 28rpx;
margin-left: 25rpx;
margin-right: 10rpx;
image {
width: 100%;
height: 100%;
}
}
.content-middle-saib {
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
}
}
}
.content-middle-search-detail {
background-color: #FFFFFF;
:nth-last-child(1) {
border: none !important;
}
.search-detail {
display: flex;
justify-content: space-between;
padding-right: 195rpx;
padding: 18rpx 53rpx;
border-bottom: 2rpx solid #E6E6E6;
;
.search-detail-one {}
}
}
}
.content-middle-three {
margin-top: 26rpx;
background-color: #FFFFFF;
padding: 28rpx 28rpx;
.middle-three {
.middle-threea {
font-size: 35rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #3274F9;
margin-bottom: 30rpx;
}
.middle-threeb {
.middle-threeb-title {
height: 98rpx;
line-height: 98rpx;
border-bottom: 1px solid #CCCCCC;
display: flex;
justify-content: space-between;
margin-bottom: 20rpx;
.title {
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #333333;
}
.title-status {
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
}
}
.middle-threeba {
display: flex;
justify-content: space-between;
.middle-threeb-a {
.threeb-a-b {
view {
margin-bottom: 20rpx;
}
.middle-edit {
width: 645rpx;
height: 63rpx;
line-height: 63rpx;
background: #e6e5d9;
text-align: center;
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #000;
margin-bottom: 20rpx;
}
.middle-delete {
width: 645rpx;
height: 63rpx;
line-height: 63rpx;
background: #F02828;
text-align: center;
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
}
.name {
font-size: 35rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #333333;
text {
font-size: 25rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #CCCCCC;
}
}
.achor {
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
}
}
}
.middle-threeb-b {
height: 80rpx;
image {
width: 100%;
height: 100%;
}
}
}
}
}
}
}
.content-middle-two {
width: 386rpx;
height: 70rpx;
line-height: 70rpx;
background: #3274F9;
border-radius: 60rpx 60rpx;
z-index: 99999;
font-size: 32rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
display: flex;
margin: 0 auto;
margin-top: 25rpx;
.middle-two-img {
width: 23rpx;
height: 23rpx;
margin-left: 112rpx;
margin-right: 10rpx;
image {
width: 100%;
height: 100%;
}
}
}
</style>