|
@@ -6,14 +6,13 @@
|
|
|
@click="backToList">返回列表
|
|
|
</el-button>
|
|
|
<div class="upper_right_button">
|
|
|
-
|
|
|
- <el-button type="warning"
|
|
|
- class="el-button--small-yh"
|
|
|
+ <el-button class="el-button--small-yh"
|
|
|
+ type="primary"
|
|
|
size="small"
|
|
|
:loading="buttonLoading"
|
|
|
:disabled="!form.id"
|
|
|
- @click.stop="confirmSettlement"
|
|
|
- >{{financeButton?"付费":"撤销付费"}}
|
|
|
+ @click.stop="makeInvoice"
|
|
|
+ >{{viewDisabled?'撤销开票':'确认开票'}}
|
|
|
</el-button>
|
|
|
<el-button class="el-button--small-yh"
|
|
|
type="primary"
|
|
@@ -32,7 +31,7 @@
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
|
|
|
- <div class="customer-main" style="margin-top: 1px" v-if="show">
|
|
|
+ <div class="customer-main" style="margin-top: 1px" v-show="show">
|
|
|
<containerTitle title="基础信息"></containerTitle>
|
|
|
<basic-container>
|
|
|
<avue-form class="trading-form" ref="form" v-model="form" :option="option">
|
|
@@ -40,7 +39,7 @@
|
|
|
<crop-select
|
|
|
v-model="form.corpId"
|
|
|
corpType="KG"
|
|
|
- :disabled="!financeDisabled && form.id"
|
|
|
+ :disabled="viewDisabled"
|
|
|
@getCorpData="returnBack"
|
|
|
style="width: 100%"
|
|
|
></crop-select>
|
|
@@ -48,8 +47,8 @@
|
|
|
<template slot="accountNo">
|
|
|
<el-select v-model="form.accountNo"
|
|
|
placeholder="请选择"
|
|
|
- :disabled="!financeDisabled && form.id"
|
|
|
@change="accountNoChange"
|
|
|
+ :disabled="viewDisabled"
|
|
|
clearable
|
|
|
filterable>
|
|
|
<el-option v-for="(item,index) in form.bankList"
|
|
@@ -60,15 +59,6 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
|
- <template slot="remark">
|
|
|
- <el-input type="textarea"
|
|
|
- v-model="form.remark"
|
|
|
- size="small"
|
|
|
- rows="2"
|
|
|
- autocomplete="off"
|
|
|
- placeholder="">
|
|
|
- </el-input>
|
|
|
- </template>
|
|
|
</avue-form>
|
|
|
</basic-container>
|
|
|
<containerTitle title="明细列表"></containerTitle>
|
|
@@ -77,7 +67,6 @@
|
|
|
:data="dataList"
|
|
|
ref="crud"
|
|
|
v-model="itemsForm"
|
|
|
- :page.sync="page"
|
|
|
@search-reset="searchReset"
|
|
|
@row-update="rowUpdate"
|
|
|
@selection-change="selectionChange"
|
|
@@ -87,8 +76,14 @@
|
|
|
size="small"
|
|
|
:loading="buttonLoading"
|
|
|
icon="el-icon-shopping-cart-2"
|
|
|
- :disabled="!financeButton"
|
|
|
- @click="selectPurchase">选择采购合同
|
|
|
+ :disabled="viewDisabled"
|
|
|
+ @click="selectPurchase">选择销售合同
|
|
|
+ </el-button>
|
|
|
+ <el-button type="warning"
|
|
|
+ size="small"
|
|
|
+ :loading="buttonLoading"
|
|
|
+ :disabled="selectionList.length === 0 || viewDisabled"
|
|
|
+ @click="generate">生成开票
|
|
|
</el-button>
|
|
|
</template>
|
|
|
<template slot-scope="scope" slot="menu">
|
|
@@ -96,7 +91,7 @@
|
|
|
type="text"
|
|
|
size="small"
|
|
|
icon="el-icon-edit"
|
|
|
- :disabled="!financeButton"
|
|
|
+ :disabled="viewDisabled"
|
|
|
@click.stop="rowCell(scope.row,scope.index)"
|
|
|
> {{ scope.row.$cellEdit ? '修改完成' : '修改' }}
|
|
|
</el-button>
|
|
@@ -104,7 +99,7 @@
|
|
|
type="text"
|
|
|
size="small"
|
|
|
icon="el-icon-delete"
|
|
|
- :disabled="!financeButton"
|
|
|
+ :disabled="viewDisabled"
|
|
|
@click.stop="rowDel(scope.row,scope.index)"
|
|
|
>删除
|
|
|
</el-button>
|
|
@@ -123,36 +118,27 @@
|
|
|
style="width: 90%"
|
|
|
placeholder="请输入"
|
|
|
size="small"
|
|
|
+ @change="amountChange"
|
|
|
oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
|
|
|
></el-input>
|
|
|
<span v-else>{{ row.thisAmount }}</span>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
|
- <el-dialog
|
|
|
- title="导入采购"
|
|
|
- append-to-body
|
|
|
- class="el-dialogDeep"
|
|
|
- :visible.sync="billDetailDialog"
|
|
|
- width="60%"
|
|
|
- :close-on-click-modal="false"
|
|
|
- :destroy-on-close="true"
|
|
|
- :close-on-press-escape="false"
|
|
|
- top="10vh"
|
|
|
- v-dialog-drag>
|
|
|
- <bill-detail
|
|
|
- :params="params"
|
|
|
- :billType="billType"
|
|
|
- @closeFun="closeBillDetail"
|
|
|
- @importProMent="importProMent"
|
|
|
- >
|
|
|
- </bill-detail>
|
|
|
- </el-dialog>
|
|
|
</div>
|
|
|
- <div class="customer-main" style="margin-top: 1px" v-if="!show">
|
|
|
+ <div class="customer-main" style="margin-top: 1px" v-show="!show">
|
|
|
<containerTitle title="开票信息"></containerTitle>
|
|
|
<basic-container>
|
|
|
- <avue-form class="trading-form" ref="forms" v-model="forms" :option="options">
|
|
|
+ <avue-form class="trading-form" ref="form" v-model="form" :option="options">
|
|
|
+ <template slot="remark">
|
|
|
+ <el-input type="textarea"
|
|
|
+ v-model="form.remark"
|
|
|
+ size="small"
|
|
|
+ rows="2"
|
|
|
+ autocomplete="off"
|
|
|
+ placeholder="">
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
</avue-form>
|
|
|
</basic-container>
|
|
|
<containerTitle title="明细列表"></containerTitle>
|
|
@@ -169,9 +155,8 @@
|
|
|
<el-button type="primary"
|
|
|
size="small"
|
|
|
:loading="buttonLoading"
|
|
|
- icon="el-icon-shopping-cart-2"
|
|
|
- :disabled="!financeButton"
|
|
|
- @click="">录入
|
|
|
+ icon="el-icon-plus"
|
|
|
+ @click="cellAdd">录入
|
|
|
</el-button>
|
|
|
</template>
|
|
|
<template slot-scope="scope" slot="menu">
|
|
@@ -179,41 +164,86 @@
|
|
|
type="text"
|
|
|
size="small"
|
|
|
icon="el-icon-edit"
|
|
|
- :disabled="!financeButton"
|
|
|
- @click.stop="rowCell(scope.row,scope.index)"
|
|
|
+ @click.stop="rowCells(scope.row,scope.index)"
|
|
|
> {{ scope.row.$cellEdit ? '修改完成' : '修改' }}
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
type="text"
|
|
|
size="small"
|
|
|
icon="el-icon-delete"
|
|
|
- :disabled="!financeButton"
|
|
|
- @click.stop="rowDel(scope.row,scope.index)"
|
|
|
+ @click.stop="rowDels(scope.row,scope.index)"
|
|
|
>删除
|
|
|
</el-button>
|
|
|
</template>
|
|
|
+ <template slot-scope="{row,index}" slot="unit">
|
|
|
+ <span v-if="row.$cellEdit" class="required_fields">*</span>
|
|
|
+ <el-select v-if="row.$cellEdit" v-model="row.unit" size="small" placeholder="请选择 单位" style="width: 90%" clearable filterable>
|
|
|
+ <el-option v-for="(item,index) in unitDic" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <span v-else>{{ row.unit }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="price" slot-scope="{row,index}">
|
|
|
+ <span v-if="row.$cellEdit" class="required_fields">*</span>
|
|
|
+ <el-input
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ v-model="row.price"
|
|
|
+ style="width: 90%"
|
|
|
+ placeholder="请输入 单价"
|
|
|
+ size="small"
|
|
|
+ oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
|
|
|
+ ></el-input>
|
|
|
+ <span v-else>{{ row.price }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="amount" slot-scope="{row,index}">
|
|
|
+ <span v-if="row.$cellEdit" class="required_fields">*</span>
|
|
|
+ <el-input
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ v-model="row.amount"
|
|
|
+ style="width: 90%"
|
|
|
+ placeholder="请输入 金额"
|
|
|
+ size="small"
|
|
|
+ oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
|
|
|
+ ></el-input>
|
|
|
+ <span v-else>{{ row.amount }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot="amountRate" slot-scope="{row,index}">
|
|
|
+ <span v-if="row.$cellEdit" class="required_fields">*</span>
|
|
|
+ <el-input
|
|
|
+ v-if="row.$cellEdit"
|
|
|
+ v-model="row.amountRate"
|
|
|
+ style="width: 90%"
|
|
|
+ size="small"
|
|
|
+ placeholder="请输入 税率"
|
|
|
+ oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d\d\d\d\d).*$/, "$1.$2")'
|
|
|
+ autocomplete="off"
|
|
|
+ >
|
|
|
+ <i slot="suffix" style="margin-top:3px;margin-right: 10px;display:inline-block">%</i>
|
|
|
+ </el-input>
|
|
|
+ <span v-else>{{ row.amountRate }}</span>
|
|
|
+ </template>
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
|
- <el-dialog
|
|
|
- title="导入采购"
|
|
|
- append-to-body
|
|
|
- class="el-dialogDeep"
|
|
|
- :visible.sync="billDetailDialog"
|
|
|
- width="60%"
|
|
|
- :close-on-click-modal="false"
|
|
|
- :destroy-on-close="true"
|
|
|
- :close-on-press-escape="false"
|
|
|
- top="10vh"
|
|
|
- v-dialog-drag>
|
|
|
- <bill-detail
|
|
|
- :params="params"
|
|
|
- :billType="billType"
|
|
|
- @closeFun="closeBillDetail"
|
|
|
- @importProMent="importProMent"
|
|
|
- >
|
|
|
- </bill-detail>
|
|
|
- </el-dialog>
|
|
|
</div>
|
|
|
+ <el-dialog
|
|
|
+ title="导入销售"
|
|
|
+ append-to-body
|
|
|
+ class="el-dialogDeep"
|
|
|
+ :visible.sync="billDetailDialog"
|
|
|
+ width="60%"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :destroy-on-close="true"
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ top="10vh"
|
|
|
+ v-dialog-drag>
|
|
|
+ <bill-detail
|
|
|
+ :params="params"
|
|
|
+ :billType="billType"
|
|
|
+ :flag="2"
|
|
|
+ @closeFun="closeBillDetail"
|
|
|
+ @importProMent="importProMent"
|
|
|
+ >
|
|
|
+ </bill-detail>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -221,7 +251,8 @@
|
|
|
import option from "./configuration/detailsPage.json";
|
|
|
import options from "./configuration/invoicepage.json";
|
|
|
import { getDetail,editFinance } from "@/api/financialManagement/financialManagement"
|
|
|
- import { getDetails,modify,cancelModify,saveOrEdit } from "@/api/financialManagement/paymentRequest";
|
|
|
+ import { saveOrEdit,getDetails } from "@/api/financialManagement/paymentRequest";
|
|
|
+ import { createInvoiceItem,putFund,cancelFund } from "@/api/financialManagement/invoice";
|
|
|
import { contrastObj,contrastList } from "@/util/contrastData";
|
|
|
import billDetail from "@/components/bill/billDetailList";
|
|
|
import { getlistBankBy } from "@/api/financialManagement/paymentRequest";
|
|
@@ -236,25 +267,9 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- form: {},
|
|
|
- itemsForm:{},
|
|
|
show:true,
|
|
|
- itemsOption: option,
|
|
|
- billDetailDialog:false,
|
|
|
- buttonLoading:false,
|
|
|
- financeDisabled:false,
|
|
|
- financeButton:true,
|
|
|
- billType:"申请",
|
|
|
- params:{},
|
|
|
- id:"",
|
|
|
- dataList: [],
|
|
|
- currencyDic:[],
|
|
|
- page: {
|
|
|
- pageSize: 10,
|
|
|
- pagerCount: 5,
|
|
|
- total: 0,
|
|
|
- },
|
|
|
- query:{},
|
|
|
+ viewDisabled:false,
|
|
|
+ form: {},
|
|
|
option: {
|
|
|
menuBtn: false,
|
|
|
labelWidth: 100,
|
|
@@ -282,7 +297,7 @@
|
|
|
span: 8,
|
|
|
rules: [
|
|
|
{
|
|
|
- required: true,
|
|
|
+ required: false,
|
|
|
message: ' ',
|
|
|
trigger: 'blur'
|
|
|
}
|
|
@@ -366,12 +381,22 @@
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
]
|
|
|
- },
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ itemsOption: option,
|
|
|
+ itemsForm:{},
|
|
|
+ dataList: [],
|
|
|
+
|
|
|
+ options:{
|
|
|
+ menuBtn: false,
|
|
|
+ labelWidth: 100,
|
|
|
+ column: [
|
|
|
{
|
|
|
- label: '制单人',
|
|
|
- prop: 'createUserName',
|
|
|
+ label: '开票抬头',
|
|
|
+ prop: 'invoiceTitle',
|
|
|
+ sort:true,
|
|
|
span: 8,
|
|
|
- disabled:true,
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -381,24 +406,12 @@
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
- label: '制单日期',
|
|
|
- prop: 'createTime',
|
|
|
- span: 8,
|
|
|
+ label: '开票日期',
|
|
|
+ prop: 'invoiceTime',
|
|
|
+ format: "yyyy-MM-dd",
|
|
|
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
type:"date",
|
|
|
- disabled:true,
|
|
|
- rules: [
|
|
|
- {
|
|
|
- required: false,
|
|
|
- message: ' ',
|
|
|
- trigger: 'blur'
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- label: '备注',
|
|
|
- prop: 'remark',
|
|
|
- span:24,
|
|
|
- minRows: 2,
|
|
|
+ span: 8,
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -407,32 +420,14 @@
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
- ],
|
|
|
- },
|
|
|
- financeStatusDic:[{
|
|
|
- label:'正常',
|
|
|
- value:0
|
|
|
- },{
|
|
|
- label:'停用',
|
|
|
- value:1
|
|
|
- }],
|
|
|
- //顶部from数据
|
|
|
- oldForm:{},
|
|
|
- oldDataList:[],
|
|
|
-
|
|
|
- activeName:'first',
|
|
|
- forms:{},
|
|
|
- options:{
|
|
|
- menuBtn: false,
|
|
|
- labelWidth: 100,
|
|
|
- column: [
|
|
|
{
|
|
|
label: '发票号',
|
|
|
- prop: 'sysNo',
|
|
|
+ prop: 'invoiceNo',
|
|
|
span: 8,
|
|
|
- },{
|
|
|
- label: '开票日期',
|
|
|
- prop: 'srcOrderno',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '纳税人识别号',
|
|
|
+ prop: 'taxpayerIdentificationNo',
|
|
|
span: 8,
|
|
|
rules: [
|
|
|
{
|
|
@@ -441,22 +436,10 @@
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
]
|
|
|
- }, {
|
|
|
- label: '开票抬头',
|
|
|
- prop: 'corpId',
|
|
|
- sort:true,
|
|
|
- span: 8,
|
|
|
- rules: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: ' ',
|
|
|
- trigger: 'blur'
|
|
|
- }
|
|
|
- ]
|
|
|
},
|
|
|
{
|
|
|
- label: '纳税人识别号',
|
|
|
- prop: 'accountNo',
|
|
|
+ label: '开户行账号',
|
|
|
+ prop: 'bankNo',
|
|
|
span: 8,
|
|
|
rules: [
|
|
|
{
|
|
@@ -468,7 +451,7 @@
|
|
|
},
|
|
|
{
|
|
|
label: '地址电话',
|
|
|
- prop: 'accountBank',
|
|
|
+ prop: 'addressPhone',
|
|
|
span: 8,
|
|
|
rules: [
|
|
|
{
|
|
@@ -477,10 +460,12 @@
|
|
|
trigger: 'blur'
|
|
|
}
|
|
|
]
|
|
|
- }, {
|
|
|
- label: '开户行账号',
|
|
|
- prop: 'accountName',
|
|
|
- span: 8,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '备注',
|
|
|
+ prop: 'remark',
|
|
|
+ span:24,
|
|
|
+ minRows: 2,
|
|
|
rules: [
|
|
|
{
|
|
|
required: false,
|
|
@@ -492,6 +477,32 @@
|
|
|
],
|
|
|
},
|
|
|
itemsOptions: options,
|
|
|
+ dataLists:[],
|
|
|
+ itemsForms:{},
|
|
|
+
|
|
|
+ configuration: {
|
|
|
+ multipleChoices: false,
|
|
|
+ multiple: false,
|
|
|
+ disabled: true,
|
|
|
+ searchShow: true,
|
|
|
+ collapseTags: false,
|
|
|
+ placeholder: '请点击右边按钮选择',
|
|
|
+ dicData: []
|
|
|
+ },
|
|
|
+ billDetailDialog:false,
|
|
|
+ buttonLoading:false,
|
|
|
+ billType:"收费",
|
|
|
+ params:{},
|
|
|
+ id:"",
|
|
|
+
|
|
|
+ unitDic:[],
|
|
|
+ currencyDic:[],
|
|
|
+ selectionList:[],
|
|
|
+ activeName:'first',
|
|
|
+ //顶部from数据
|
|
|
+ oldForm:{},
|
|
|
+ oldDataList:[],
|
|
|
+ oldDataLists:[],
|
|
|
}
|
|
|
},
|
|
|
components:{
|
|
@@ -502,6 +513,10 @@
|
|
|
this.getWorkDicts("currency").then(res =>{
|
|
|
this.currencyDic = res.data.data
|
|
|
})
|
|
|
+ //单位
|
|
|
+ this.getWorkDicts("unit").then(res => {
|
|
|
+ this.unitDic = res.data.data
|
|
|
+ });
|
|
|
|
|
|
if (this.detailData.id) {
|
|
|
this.buttonLoading = true
|
|
@@ -511,9 +526,6 @@
|
|
|
}).finally(()=>{
|
|
|
this.buttonLoading = false
|
|
|
})
|
|
|
- }else{
|
|
|
- this.form.financeStatus = "待结算"
|
|
|
- this.oldForm.financeStatus = "待结算"
|
|
|
}
|
|
|
|
|
|
if(this.detailData.params){
|
|
@@ -551,6 +563,14 @@
|
|
|
this.$set(this.form,"bankList",res.data)
|
|
|
})
|
|
|
},
|
|
|
+ amountChange(){
|
|
|
+ let thisAmountList = this.dataList.map(item => {
|
|
|
+ if(item.thisAmount){
|
|
|
+ return parseFloat(item.thisAmount);
|
|
|
+ }else return 0
|
|
|
+ });
|
|
|
+ this.$set(this.form,"amount",thisAmountList.reduce((n,m) => n + m)) //数组内和
|
|
|
+ },
|
|
|
//选择卡号
|
|
|
accountNoChange(value){
|
|
|
this.form.bankList.forEach(item =>{
|
|
@@ -560,6 +580,19 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ //生成开票
|
|
|
+ generate(){
|
|
|
+ let sum = 0
|
|
|
+ this.selectionList.forEach(item =>{
|
|
|
+ sum =_.add(sum, Number(item.thisAmount))
|
|
|
+ })
|
|
|
+ let params = {
|
|
|
+ price:sum,
|
|
|
+ amount:sum
|
|
|
+ }
|
|
|
+ this.$refs.cruds.rowCellAdd(params);
|
|
|
+ this.show = false
|
|
|
+ },
|
|
|
selectPurchase(){
|
|
|
if(!this.form.corpId){
|
|
|
this.$message.warning("请先选择客户!")
|
|
@@ -588,71 +621,116 @@
|
|
|
rowUpdate(row, index, done) {
|
|
|
done(row);
|
|
|
},
|
|
|
+ cellAdd(){
|
|
|
+ this.$refs.cruds.rowCellAdd();
|
|
|
+ },
|
|
|
rowCell(row,index){
|
|
|
this.$refs.crud.rowCell(row, index)
|
|
|
- // row.$cellEdit = !row.$cellEdit
|
|
|
},
|
|
|
rowDel(row,index){
|
|
|
- this.dataList.splice(index, 1);
|
|
|
+ this.$confirm("确定将选择数据删除?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ this.dataList.splice(index, 1);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ rowCells(row,index){
|
|
|
+ this.$refs.cruds.rowCell(row, index)
|
|
|
+ },
|
|
|
+ rowDels(row,index){
|
|
|
+ this.$confirm("确定将选择数据删除?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ this.dataLists.splice(index, 1);
|
|
|
+ });
|
|
|
},
|
|
|
searchReset() {
|
|
|
console.log('1')
|
|
|
},
|
|
|
- selectionChange() {
|
|
|
- console.log('1')
|
|
|
+ selectionChange(row) {
|
|
|
+ this.selectionList = row
|
|
|
},
|
|
|
- confirmSettlement(status){
|
|
|
- this.$refs["form"].validate((valid,done) => {
|
|
|
- done();
|
|
|
- if(valid && this.verificationData()){
|
|
|
- this.$confirm("是否确认付费?", "提示", {
|
|
|
- confirmButtonText: "确认",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- }).then(()=>{
|
|
|
- for (let i = 0; i < this.dataList.length; i++) {
|
|
|
- if (this.dataList[i].thisAmount == null || this.dataList[i].thisAmount == 0) {
|
|
|
- return this.$message.error(`第${i + 1}行的本次金额不能为空`);
|
|
|
- }
|
|
|
+ makeInvoice(){
|
|
|
+ if(this.verificationData()){
|
|
|
+ this.$confirm(this.viewDisabled?"是否撤销开票":"是否确认开票", "提示", {
|
|
|
+ confirmButtonText: "确认",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(()=>{
|
|
|
+ for (let i = 0; i < this.dataList.length; i++) {
|
|
|
+ if (this.dataList[i].thisAmount == (null || "")) {
|
|
|
+ return this.$message.error(`第输入费用明细${i + 1}行的本次金额`);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- this.buttonLoading = true
|
|
|
- this.form.billNo = this.dataList.map(item =>{return item.billNo}).join(",")
|
|
|
-
|
|
|
- const params = {
|
|
|
- ...this.form,
|
|
|
- billType:"付费",
|
|
|
- itemsList:this.dataList
|
|
|
+ for (let i = 0; i < this.dataLists.length; i++) {
|
|
|
+ if (this.dataLists[i].serverName == (null || "") ||
|
|
|
+ this.dataLists[i].typeno == (null || "") ||
|
|
|
+ this.dataLists[i].unit == (null || "") ||
|
|
|
+ this.dataLists[i].price == (null || "") ||
|
|
|
+ this.dataLists[i].amount == (null || "") ||
|
|
|
+ this.dataLists[i].amountRate == (null || "") ||
|
|
|
+ this.dataLists[i].amountTax == (null || "")) {
|
|
|
+ return this.$message.error(`第输入开票明细${i + 1}行的必填项`);
|
|
|
}
|
|
|
- if(this.financeButton){
|
|
|
- modify(params).then(res =>{
|
|
|
+ }
|
|
|
+
|
|
|
+ this.buttonLoading = true
|
|
|
+ this.form.billNo = this.dataList.map(item =>{return item.billNo}).join(",")
|
|
|
+
|
|
|
+ const params = {
|
|
|
+ ...this.form,
|
|
|
+ billType:"收费",
|
|
|
+ itemsList:this.dataList,
|
|
|
+ invoiceItemList:this.dataLists,
|
|
|
+ settlementType:2
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!this.viewDisabled){
|
|
|
+ //确认开票
|
|
|
+ putFund(params).then(res=>{
|
|
|
+ if(res.data.success){
|
|
|
this.$message.success("操作成功!")
|
|
|
this.afterEcho(res.data.data)
|
|
|
- }).finally(()=>{
|
|
|
- this.buttonLoading = false
|
|
|
- })
|
|
|
- }else{
|
|
|
- cancelModify(params).then(res =>{
|
|
|
+ }
|
|
|
+ }).finally(()=>{
|
|
|
+ this.buttonLoading = false
|
|
|
+ })
|
|
|
+ }else{ //撤销开票
|
|
|
+ cancelFund(params).then(res=>{
|
|
|
+ if(res.data.success){
|
|
|
this.$message.success("操作成功!")
|
|
|
this.afterEcho(res.data.data)
|
|
|
- }).finally(()=>{
|
|
|
- this.buttonLoading = false
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
- if(status === true){
|
|
|
- this.$emit("goBack");
|
|
|
+ }
|
|
|
+ }).finally(()=>{
|
|
|
+ this.buttonLoading = false
|
|
|
+ })
|
|
|
}
|
|
|
- }
|
|
|
- })
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
saveSettlement(){
|
|
|
this.$refs["form"].validate((valid,done) => {
|
|
|
if(valid){
|
|
|
for (let i = 0; i < this.dataList.length; i++) {
|
|
|
if (this.dataList[i].thisAmount == (null || "")) {
|
|
|
- return this.$message.error(`第输入${i + 1}行的本次金额`);
|
|
|
+ return this.$message.error(`第输入费用明细${i + 1}行的本次金额`);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (let i = 0; i < this.dataLists.length; i++) {
|
|
|
+ if (this.dataLists[i].serverName == (null || "") ||
|
|
|
+ this.dataLists[i].typeno == (null || "") ||
|
|
|
+ this.dataLists[i].unit == (null || "") ||
|
|
|
+ this.dataLists[i].price == (null || "") ||
|
|
|
+ this.dataLists[i].amount == (null || "") ||
|
|
|
+ this.dataLists[i].amountRate == (null || "") ||
|
|
|
+ this.dataLists[i].amountTax == (null || "")) {
|
|
|
+ return this.$message.error(`第输入开票明细${i + 1}行的必填项`);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -661,56 +739,45 @@
|
|
|
|
|
|
const params = {
|
|
|
...this.form,
|
|
|
- billType:"付费",
|
|
|
- itemsList:this.dataList
|
|
|
+ billType:"收费",
|
|
|
+ itemsList:this.dataList,
|
|
|
+ invoiceItemList:this.dataLists,
|
|
|
+ settlementType:2
|
|
|
}
|
|
|
|
|
|
saveOrEdit(params).then(res=>{
|
|
|
this.$message.success("操作成功!")
|
|
|
this.afterEcho(res.data.data)
|
|
|
- done();
|
|
|
}).finally(()=>{
|
|
|
+ done();
|
|
|
this.buttonLoading = false
|
|
|
})
|
|
|
- }})
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
afterEcho(data){
|
|
|
this.form = data;
|
|
|
this.oldForm = Object.assign({},data);
|
|
|
- this.financeDisabled = this.form.financeStatus == "待结算"?true:false;
|
|
|
- //审核状态为空时 说明为新单进来
|
|
|
- if(this.financeDisabled){
|
|
|
- this.financeButton = true
|
|
|
- this.option.column.forEach(item =>{
|
|
|
- if( item.prop === "remark" || item.prop === "settlementDate"){
|
|
|
- this.$set(item,"disabled",false)
|
|
|
- }else if( item.prop === "createUserName" || item.prop === "createTime" || item.prop === "sysNo" ){
|
|
|
- this.$set(item,"disabled",true)
|
|
|
- }else{
|
|
|
- this.$set(item,"disabled",false)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- else{
|
|
|
- this.financeButton = false
|
|
|
- this.option.column.forEach(item =>{
|
|
|
- if( item.prop === "remark"){
|
|
|
- this.$set(item,"disabled",false)
|
|
|
- }else if( item.prop === "createUserName" || item.prop === "createTime" || item.prop === "sysNo"){
|
|
|
- this.$set(item,"disabled",true)
|
|
|
- }else{
|
|
|
- this.$set(item,"disabled",true)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+
|
|
|
+ this.viewDisabled = data.foundStatus === "核销完成"?true:false;
|
|
|
+
|
|
|
+ this.option.column.forEach(item=>{
|
|
|
+ this.$set(item,"disabled",this.viewDisabled)
|
|
|
+ })
|
|
|
|
|
|
if(data.itemsList){
|
|
|
this.dataList = data.itemsList
|
|
|
this.oldDataList = this.deepClone(data.itemsList)
|
|
|
}
|
|
|
+ if(data.invoiceItemList){
|
|
|
+ this.dataLists = data.invoiceItemList
|
|
|
+ this.oldDataLists = this.deepClone(data.invoiceItemList)
|
|
|
+ }
|
|
|
},
|
|
|
verificationData(){
|
|
|
- if(contrastObj(this.form,this.oldForm) || contrastList(this.dataList,this.oldDataList)
|
|
|
+ if(contrastObj(this.form,this.oldForm)
|
|
|
+ || contrastList(this.dataList,this.oldDataList)
|
|
|
+ || contrastList(this.dataLists,this.oldDataLists)
|
|
|
){
|
|
|
this.$confirm("数据发生变化,请先提交保存!", "提示", {
|
|
|
confirmButtonText: "保存",
|