|
@@ -0,0 +1,562 @@
|
|
|
+<template>
|
|
|
+ <div class="page">
|
|
|
+ <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
|
|
|
+ <!-- 搜索框-->
|
|
|
+ <el-row :gutter="0">
|
|
|
+ <el-form-item prop="number" label="发票号">
|
|
|
+ <el-input size="small" v-model="searchForm.number" placeholder="请输入发票号" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
|
|
|
+ <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="0">
|
|
|
+ <el-form-item prop="accountBegin" label="开票总金额">
|
|
|
+ <el-input-number
|
|
|
+ size="small"
|
|
|
+ v-model="searchForm.accountBegin"
|
|
|
+ controls-position="right"
|
|
|
+ :controls="false"
|
|
|
+ style="width:100%;"
|
|
|
+ :precision="2"
|
|
|
+ placeholder="请填写开票总金额"
|
|
|
+ :step="0.01"
|
|
|
+ :min="0"
|
|
|
+ clearable>
|
|
|
+ </el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="accountEnd" label="-">
|
|
|
+ <el-input-number
|
|
|
+ size="small"
|
|
|
+ v-model="searchForm.accountEnd"
|
|
|
+ controls-position="right"
|
|
|
+ :controls="false"
|
|
|
+ style="width:100%;"
|
|
|
+ :precision="2"
|
|
|
+ placeholder="请填写开票总金额"
|
|
|
+ :step="0.01"
|
|
|
+ :min="0"
|
|
|
+ clearable>
|
|
|
+ </el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="0">
|
|
|
+ <el-form-item prop="billingDateList" label="开票日期">
|
|
|
+ <el-date-picker
|
|
|
+ size="small"
|
|
|
+ v-model="searchForm.billingDateList"
|
|
|
+ type="daterange"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ range-separator="至"
|
|
|
+ style="width: 100% "
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ placement="bottom-start"
|
|
|
+ clearabl>
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="remittanceDateList" label="收款日期">
|
|
|
+ <el-date-picker
|
|
|
+ size="small"
|
|
|
+ v-model="searchForm.remittanceDateList"
|
|
|
+ type="daterange"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ range-separator="至"
|
|
|
+ style="width: 100% "
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ placement="bottom-start"
|
|
|
+ clearable>
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <div class="bg-white top" style="">
|
|
|
+ <vxe-toolbar :refresh="{query: refreshList}" custom>
|
|
|
+ <template #buttons>
|
|
|
+ <el-button v-if="hasPermission('finance:invoice:add')" type="primary" size="small" icon="el-icon-plus" @click="start()">新建</el-button>
|
|
|
+<!-- <el-button v-if="hasPermission('finance:invoice:del')" type="danger" size="small" icon="el-icon-delete" @click="del()" :disabled="$refs.invoiceTable && $refs.invoiceTable.getCheckboxRecords().length === 0" plain>删除</el-button>-->
|
|
|
+ </template>
|
|
|
+ </vxe-toolbar>
|
|
|
+ <div style="height: calc(100% - 80px)">
|
|
|
+ <vxe-table
|
|
|
+ border="inner"
|
|
|
+ auto-resize
|
|
|
+ resizable
|
|
|
+ height="auto"
|
|
|
+ :loading="loading"
|
|
|
+ size="small"
|
|
|
+ ref="invoiceTable"
|
|
|
+ show-header-overflow
|
|
|
+ show-overflow
|
|
|
+ highlight-hover-row
|
|
|
+ :menu-config="{}"
|
|
|
+ @sort-change="sortChangeHandle"
|
|
|
+ :sort-config="{remote:true}"
|
|
|
+ :data="dataList"
|
|
|
+ :checkbox-config="{}">
|
|
|
+ <vxe-column type="seq" width="40"></vxe-column>
|
|
|
+ <vxe-column type="checkbox" width="40" ></vxe-column>
|
|
|
+ <vxe-column width="150" title="项目名称"align="center" field="programName"></vxe-column>
|
|
|
+ <vxe-column width="150" title="发票申请编号"align="center" field="no">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-link type="primary" :underline="false" @click="view(false, scope.row.id)">{{scope.row.no}}</el-link>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column width="150" title="发票号"align="center" field="number"></vxe-column>
|
|
|
+ <vxe-column width="150" title="实际开票单位"align="center" field="billingWorkplaceReal"></vxe-column>
|
|
|
+ <vxe-column width="150" title="开票总金额(元)"align="center" field="account"></vxe-column>
|
|
|
+ <vxe-column width="150" title="开票金额(元)"align="center" field="accountDetail"></vxe-column>
|
|
|
+ <vxe-column width="120" title="开票内容"align="center" field="billingContent">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{$dictUtils.getDictLabel('invoice_billing_content', scope.row.billingContent, '-')}}
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column width="100" title="收款类型"align="center" field="receivablesType">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{$dictUtils.getDictLabel('invoice_receivables_type', scope.row.receivablesType, '-')}}
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column width="100" title="发票类型"align="center" field="type">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{$dictUtils.getDictLabel('invoice_type', scope.row.type, '-')}}
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column width="120" title="开票日期"align="center" field="billingDate"></vxe-column>
|
|
|
+ <vxe-column width="120" title="收款日期"align="center" field="receivablesDate"></vxe-column>
|
|
|
+ <vxe-column width="110" fixed="right"align="center" title="是否收款" field="receivablesStatus">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.receivablesStatus === '1'?'已收款':'未收款'}}
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column width="110" fixed="right"align="center" title="是否作废" field="invalidStatus">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.invalidStatus === '1'?'已作废':'未作废'}}
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column width="110px" fixed="right"align="center" title="状态" field="status" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" @click="invoiceDetail(scope.row)" :type="$dictUtils.getDictLabel('invoice_status_info', scope.row.status, '-')" effect="dark" size="mini">{{$dictUtils.getDictLabel("invoice_status", scope.row.status, '-')}} </el-button>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column width="220" title="操作" fixed="right" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button v-if="hasPermission('finance:invoice:edit')&&scope.row.status === '1'||scope.row.status === '3'||scope.row.status === '4'" type="text" icon="el-icon-edit" size="small" @click="invoicePush(scope.row)">修改</el-button>
|
|
|
+ <el-button v-if="hasPermission('finance:invoice:edit')&&scope.row.status === '2'" type="text" icon="el-icon-delete" size="small" @click="invoiceReback(scope.row)">撤回</el-button>
|
|
|
+ <el-button v-if="hasPermission('finance:invoice:edit')&&scope.row.status === '5'&&scope.row.receivablesStatus !== '1'" type="text" icon="el-icon-finished" size="small" @click="view(true, scope.row.id)">收款</el-button>
|
|
|
+ <el-button v-if="hasPermission('finance:invoice:edit')&&scope.row.status === '5'&&scope.row.receivablesStatus !== '1'" type="text" icon="el-icon-document-checked" size="small" @click="isReceivables(scope.row)">确认收款</el-button>
|
|
|
+ <el-button v-if="hasPermission('finance:invoice:edit')&&scope.row.status === '5'||scope.row.status === '7'||scope.row.status === '8'" type="text" icon="el-icon-document-delete" size="small" @click="invoiceInvalidPush(scope.row)">作废</el-button>
|
|
|
+ <el-button v-if="hasPermission('finance:invoice:edit')&&scope.row.status === '6'" type="text" icon="el-icon-document-delete" size="small" @click="invoiceInvalidReBack(scope.row)">作废撤回</el-button>
|
|
|
+ <el-button v-if="hasPermission('finance:invoice:edit')&&scope.row.status === '1'||scope.row.status === '3'||scope.row.status === '4'" type="text" icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ </vxe-table>
|
|
|
+ <vxe-pager
|
|
|
+ background
|
|
|
+ size="small"
|
|
|
+ :current-page="tablePage.currentPage"
|
|
|
+ :page-size="tablePage.pageSize"
|
|
|
+ :total="tablePage.total"
|
|
|
+ :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
|
|
|
+ :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
|
|
|
+ @page-change="currentChangeHandle">
|
|
|
+ </vxe-pager>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <InvoiceForm ref="invoiceForm" @refreshDataList="refreshList"></InvoiceForm>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import FinanceInvoiceService from '@/api/finance/invoice/FinanceInvoiceService'
|
|
|
+ import InvoiceForm from './InvoiceForm'
|
|
|
+ import pick from 'lodash.pick'
|
|
|
+ import TaskService from '@/api/flowable/TaskService'
|
|
|
+ import ProcessService from '@/api/flowable/ProcessService'
|
|
|
+ import UserService from '@/api/sys/UserService'
|
|
|
+ export default {
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ searchForm: {
|
|
|
+ number: '',
|
|
|
+ accountBegin: undefined,
|
|
|
+ accountEnd: undefined,
|
|
|
+ billingDateList: [],
|
|
|
+ billingDateBegin: '',
|
|
|
+ billingDateEnd: '',
|
|
|
+ remittanceDateList: [],
|
|
|
+ remittanceDateBegin: '',
|
|
|
+ remittanceDateEnd: '',
|
|
|
+ programName: '',
|
|
|
+ programId: ''
|
|
|
+ },
|
|
|
+ dataList: [],
|
|
|
+ tablePage: {
|
|
|
+ total: 0,
|
|
|
+ currentPage: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ orders: []
|
|
|
+ },
|
|
|
+ loading: false,
|
|
|
+ processDefinitionId: '',
|
|
|
+ procDefKey: '',
|
|
|
+ processDefinitionInvalidId: '',
|
|
|
+ procDefInvalidKey: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ financeInvoiceService: null,
|
|
|
+ taskService: null,
|
|
|
+ processService: null,
|
|
|
+ userService: null,
|
|
|
+ computed: {
|
|
|
+ userName () {
|
|
|
+ return JSON.parse(localStorage.getItem('user')).name
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.financeInvoiceService = new FinanceInvoiceService()
|
|
|
+ this.taskService = new TaskService()
|
|
|
+ this.processService = new ProcessService()
|
|
|
+ this.userService = new UserService()
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ InvoiceForm
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ this.refreshList()
|
|
|
+ },
|
|
|
+ activated () {
|
|
|
+ this.refreshList()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 新增
|
|
|
+ add () {
|
|
|
+ this.$refs.invoiceForm.init('add', '')
|
|
|
+ },
|
|
|
+ // 修改
|
|
|
+ edit (id) {
|
|
|
+ id = id || this.$refs.invoiceTable.getCheckboxRecords().map(item => {
|
|
|
+ return item.id
|
|
|
+ })[0]
|
|
|
+ this.$refs.invoiceForm.init('edit', id)
|
|
|
+ },
|
|
|
+ // 查看 flag为true时,弹窗为收款,其他值为查看发票详情
|
|
|
+ view (flag, id) {
|
|
|
+ this.$refs.invoiceForm.init(flag, id)
|
|
|
+ },
|
|
|
+ // 获取数据列表
|
|
|
+ refreshList () {
|
|
|
+ this.loading = true
|
|
|
+ if (!this.commonJS.isEmpty(this.searchForm.billingDateList)) {
|
|
|
+ if (!this.commonJS.isEmpty(this.searchForm.billingDateList[0]) && !this.commonJS.isEmpty(this.searchForm.billingDateList[1])) {
|
|
|
+ this.searchForm.billingDateBegin = this.searchForm.billingDateList[0]
|
|
|
+ this.searchForm.billingDateEnd = this.searchForm.billingDateList[1]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!this.commonJS.isEmpty(this.searchForm.remittanceDateList)) {
|
|
|
+ if (!this.commonJS.isEmpty(this.searchForm.remittanceDateList[0]) && !this.commonJS.isEmpty(this.searchForm.remittanceDateList[1])) {
|
|
|
+ this.searchForm.remittanceDateBegin = this.moment(this.searchForm.remittanceDateList[0]).format('YYYY-MM-DD')
|
|
|
+ this.searchForm.remittanceDateEnd = this.moment(this.searchForm.remittanceDateList[1]).format('YYYY-MM-DD')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.financeInvoiceService.list({
|
|
|
+ 'current': this.tablePage.currentPage,
|
|
|
+ 'size': this.tablePage.pageSize,
|
|
|
+ 'orders': this.tablePage.orders,
|
|
|
+ ...this.searchForm
|
|
|
+ }).then(({data}) => {
|
|
|
+ this.dataList = data.records
|
|
|
+ this.dataList.forEach(item => {
|
|
|
+ item.account = parseFloat(item.account).toFixed(2)
|
|
|
+ if (!this.commonJS.isEmpty(item.financeInvoiceBaseDTOList)) {
|
|
|
+ let pName = ''
|
|
|
+ item.financeInvoiceBaseDTOList.forEach((program, index) => {
|
|
|
+ if ((index + 1) !== item.financeInvoiceBaseDTOList.length) {
|
|
|
+ pName = pName + program.programName + ','
|
|
|
+ } else {
|
|
|
+ pName = pName + program.programName
|
|
|
+ }
|
|
|
+ })
|
|
|
+ item.programName = pName
|
|
|
+ } else {
|
|
|
+ item.programName = ''
|
|
|
+ }
|
|
|
+ if (!this.commonJS.isEmpty(item.financeInvoiceDetailDTOList)) {
|
|
|
+ item.accountDetail = 0
|
|
|
+ let num = ''
|
|
|
+ item.financeInvoiceDetailDTOList.forEach((detail, index) => {
|
|
|
+ if (!this.commonJS.isEmpty(detail.account)) {
|
|
|
+ item.accountDetail = parseFloat(parseFloat(item.accountDetail) + parseFloat(detail.account)).toFixed(2)
|
|
|
+ }
|
|
|
+ if ((index + 1) !== item.financeInvoiceDetailDTOList.length) {
|
|
|
+ num = num + detail.number + ','
|
|
|
+ } else {
|
|
|
+ num = num + detail.number
|
|
|
+ }
|
|
|
+ })
|
|
|
+ item.number = num
|
|
|
+ } else {
|
|
|
+ item.number = ''
|
|
|
+ item.accountDetail = ''
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.tablePage.total = data.total
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ this.processService.getByName('发票申请').then(({data}) => {
|
|
|
+ if (!this.commonJS.isEmpty(data.id)) {
|
|
|
+ this.processDefinitionId = data.id
|
|
|
+ this.procDefKey = data.key
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.processService.getByName('发票作废').then(({data}) => {
|
|
|
+ if (!this.commonJS.isEmpty(data.id)) {
|
|
|
+ this.processDefinitionInvalidId = data.id
|
|
|
+ this.procDefInvalidKey = data.key
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 当前页
|
|
|
+ currentChangeHandle ({ currentPage, pageSize }) {
|
|
|
+ this.tablePage.currentPage = currentPage
|
|
|
+ this.tablePage.pageSize = pageSize
|
|
|
+ this.refreshList()
|
|
|
+ },
|
|
|
+ // 排序
|
|
|
+ sortChangeHandle (column) {
|
|
|
+ this.tablePage.orders = []
|
|
|
+ if (column.order != null) {
|
|
|
+ this.tablePage.orders.push({column: this.$utils.toLine(column.property), asc: column.order === 'asc'})
|
|
|
+ }
|
|
|
+ this.refreshList()
|
|
|
+ },
|
|
|
+ // 删除
|
|
|
+ del (id) {
|
|
|
+ let ids = id || this.$refs.invoiceTable.getCheckboxRecords().map(item => {
|
|
|
+ return item.id
|
|
|
+ }).join(',')
|
|
|
+ this.$confirm(`确定删除所选项吗?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.loading = true
|
|
|
+ this.financeInvoiceService.delete(ids).then(({data}) => {
|
|
|
+ this.$message.success(data)
|
|
|
+ this.refreshList()
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ resetSearch () {
|
|
|
+ this.searchForm.billingDateList = []
|
|
|
+ this.searchForm.remittanceDateList = []
|
|
|
+ this.searchForm.billingDateBegin = ''
|
|
|
+ this.searchForm.billingDateEnd = ''
|
|
|
+ this.searchForm.remittanceDateBegin = ''
|
|
|
+ this.searchForm.remittanceDateEnd = ''
|
|
|
+ this.$refs.searchForm.resetFields()
|
|
|
+ this.refreshList()
|
|
|
+ },
|
|
|
+ start () {
|
|
|
+ // 读取流程表单
|
|
|
+ let tabTitle = `发起流程【发票申请】`
|
|
|
+ let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [发票申请]`
|
|
|
+ this.taskService.getTaskDef({ procDefId: this.processDefinitionId,
|
|
|
+ status: 'startAndHold'}).then((data) => {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/flowable/task/TaskForm',
|
|
|
+ query: {
|
|
|
+ procDefId: this.processDefinitionId,
|
|
|
+ procDefKey: this.procDefKey,
|
|
|
+ status: 'startAndHold',
|
|
|
+ title: tabTitle,
|
|
|
+ formType: data.data.formType,
|
|
|
+ formUrl: data.data.formUrl,
|
|
|
+ formTitle: processTitle,
|
|
|
+ businessId: 'false',
|
|
|
+ isShow: false,
|
|
|
+ routePath: '/finance/invoice/InvoiceList'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 发起发票申请审批
|
|
|
+ invoicePush (row) {
|
|
|
+ // 读取流程表单
|
|
|
+ let title = `发起流程【发票申请】`
|
|
|
+ let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了[发票申请]`
|
|
|
+ let status = 'startAndHold'
|
|
|
+ if (row.status === '3' || row.status === '4') {
|
|
|
+ status = 'startAndClose'
|
|
|
+ }
|
|
|
+ this.taskService.getTaskDef({ procDefId: this.processDefinitionId,
|
|
|
+ businessId: row.id,
|
|
|
+ businessTable: 'finance_invoice'}).then((data) => {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/flowable/task/TaskForm',
|
|
|
+ query: {
|
|
|
+ procDefId: this.processDefinitionId,
|
|
|
+ procDefKey: this.procDefKey,
|
|
|
+ title: title,
|
|
|
+ formType: data.data.formType,
|
|
|
+ formUrl: data.data.formUrl,
|
|
|
+ formTitle: processTitle,
|
|
|
+ businessTable: 'finance_invoice',
|
|
|
+ businessId: row.id,
|
|
|
+ isShow: 'false',
|
|
|
+ status: status,
|
|
|
+ routePath: '/finance/invoice/InvoiceList'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 发起发票作废审批
|
|
|
+ invoiceInvalidPush (row) {
|
|
|
+ // 读取流程表单
|
|
|
+ let title = `发起流程【发票作废】`
|
|
|
+ let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了[发票作废]`
|
|
|
+ let status = 'startAndHold'
|
|
|
+ if (row.status === '8' || row.status === '7') {
|
|
|
+ status = 'startAndClose'
|
|
|
+ }
|
|
|
+ this.taskService.getTaskDef({ procDefId: this.processDefinitionInvalidId,
|
|
|
+ businessId: row.financeInvoiceInvalidDTO.id,
|
|
|
+ businessTable: 'finance_invoice_invalid'}).then((data) => {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/flowable/task/TaskForm',
|
|
|
+ query: {
|
|
|
+ procDefId: this.processDefinitionInvalidId,
|
|
|
+ procDefKey: this.procDefInvalidKey,
|
|
|
+ title: title,
|
|
|
+ formType: data.data.formType,
|
|
|
+ formUrl: data.data.formUrl,
|
|
|
+ formTitle: processTitle,
|
|
|
+ businessTable: 'finance_invoice_invalid',
|
|
|
+ businessId: row.financeInvoiceInvalidDTO.id,
|
|
|
+ isShow: 'false',
|
|
|
+ status: status,
|
|
|
+ routePath: '/finance/invoice/InvoiceList'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 查看发票申请审批流程结果
|
|
|
+ invoiceDetail (row) {
|
|
|
+ if (row.status !== '0' && row.status !== '1') {
|
|
|
+ if (row.status === '6' || row.status === '7' || row.status === '8' || row.status === '9') {
|
|
|
+ this.invoiceInvalidDetail(row)
|
|
|
+ } else {
|
|
|
+ this.taskService.getTaskDef({
|
|
|
+ procInsId: row.procInsId,
|
|
|
+ procDefId: this.processDefinitionId
|
|
|
+ }).then(({data}) => {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/flowable/task/TaskFormDetail',
|
|
|
+ query: {
|
|
|
+ isShow: 'false',
|
|
|
+ readOnly: true,
|
|
|
+ title: '发票申请' + '流程详情',
|
|
|
+ formTitle: '发票申请' + '流程详情',
|
|
|
+ businessId: row.id,
|
|
|
+ status: 'reback',
|
|
|
+ ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'title', 'businessId')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 查看发票作废审批流程结果
|
|
|
+ invoiceInvalidDetail (row) {
|
|
|
+ this.taskService.getTaskDef({
|
|
|
+ procInsId: row.financeInvoiceInvalidDTO.procInsId,
|
|
|
+ procDefId: this.processDefinitionInvalidId
|
|
|
+ }).then(({data}) => {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/flowable/task/TaskFormDetail',
|
|
|
+ query: {
|
|
|
+ isShow: 'false',
|
|
|
+ readOnly: true,
|
|
|
+ title: '发票作废' + '流程详情',
|
|
|
+ formTitle: '发票作废' + '流程详情',
|
|
|
+ businessId: row.financeInvoiceInvalidDTO.id,
|
|
|
+ status: 'reback',
|
|
|
+ ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'title', 'businessId')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 撤回发票申请审批
|
|
|
+ invoiceReback (row) {
|
|
|
+ this.$confirm(`确定要撤回该申请吗?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(async () => {
|
|
|
+ await this.financeInvoiceService.queryById(row.id).then(({data}) => {
|
|
|
+ if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
|
|
|
+ this.$message.error('数据已发生改变或不存在,请刷新数据')
|
|
|
+ this.err = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (this.err === true) {
|
|
|
+ this.err = ''
|
|
|
+ this.refreshList()
|
|
|
+ } else {
|
|
|
+ this.processService.revokeProcIns(row.procInsId).then(async ({data}) => {
|
|
|
+ let form = {status: '3', id: row.id}
|
|
|
+ await this.financeInvoiceService.updateStatusById(form)
|
|
|
+ this.$message.success(data)
|
|
|
+ this.refreshList()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ invoiceInvalidReBack (row) {
|
|
|
+ this.$confirm(`确定要撤回该申请吗?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(async () => {
|
|
|
+ await this.financeInvoiceService.queryById(row.id).then(({data}) => {
|
|
|
+ if (data.status !== '6') { // status的值不等于“审核中”,就弹出提示
|
|
|
+ this.$message.error('数据已发生改变或不存在,请刷新数据')
|
|
|
+ this.err = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (this.err === true) {
|
|
|
+ this.err = ''
|
|
|
+ this.refreshList()
|
|
|
+ } else {
|
|
|
+ this.processService.revokeProcIns(row.financeInvoiceInvalidDTO.procInsId).then(async ({data}) => {
|
|
|
+ let form = {status: '5', id: row.id}
|
|
|
+ await this.financeInvoiceService.updateStatusById(form)
|
|
|
+ this.$message.success(data)
|
|
|
+ this.refreshList()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ isReceivables (row) {
|
|
|
+ this.$confirm(`确定要确认收款吗?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ let param = {id: row.id, receivablesStatus: '1', receivablesDate: this.moment(new Date()).format('YYYY-MM-DD')}
|
|
|
+ this.financeInvoiceService.isReceivables(param).then(({data}) => {
|
|
|
+ this.$message.success(data)
|
|
|
+ this.refreshList()
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+<style scoped>
|
|
|
+ /deep/ .el-input-number .el-input__inner {
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
+</style>
|