|
|
@@ -115,12 +115,15 @@
|
|
|
:columns="columns"
|
|
|
:showBatchDelete="false"
|
|
|
:showOperation="true"
|
|
|
- editButtonName="编辑"
|
|
|
+ editButtonName="进账"
|
|
|
button3Name="撤销"
|
|
|
+ button2Name="编辑"
|
|
|
button3Icon="fa fa-trash"
|
|
|
button3Background="#f56c6c"
|
|
|
+ button2Background="#E6A23C"
|
|
|
@handleButton3="handleTableDelete"
|
|
|
- @handleEdit="handleDetail"
|
|
|
+ @handleButton2="handleDetail($event, 1)"
|
|
|
+ @handleEdit="handleDetail($event, 2)"
|
|
|
@findPage="findPage"
|
|
|
:isshowpagination="true"
|
|
|
></kt-common-table>
|
|
|
@@ -142,7 +145,7 @@
|
|
|
size="small"
|
|
|
:class="formDataId ? 'data_form' : 'frame data_form'"
|
|
|
>
|
|
|
- <div v-if="!formDataId">
|
|
|
+ <div v-if="!formDataId || (typeStatus == 1 && formDataId)">
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="开票方" prop="invoiceBy">
|
|
|
@@ -293,7 +296,7 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
- <div v-else>
|
|
|
+ <div v-if="typeStatus == 2 && formDataId">
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="进账金额" prop="payoutMoney">
|
|
|
@@ -392,10 +395,12 @@
|
|
|
</el-row> -->
|
|
|
<el-row>
|
|
|
<el-col :span="12" style="text-align: center"
|
|
|
- ><h3>收入方资金归属</h3></el-col
|
|
|
+ ><h3>收入方资金归属(%)</h3>
|
|
|
+ <span>(请输入资金归属百分比)</span></el-col
|
|
|
>
|
|
|
<el-col :span="12" style="text-align: center"
|
|
|
- ><h3>支出方资金归属</h3></el-col
|
|
|
+ ><h3>支出方资金归属(%)</h3>
|
|
|
+ <span>(请输入资金归属百分比)</span></el-col
|
|
|
>
|
|
|
</el-row>
|
|
|
<el-row class="profit_box">
|
|
|
@@ -481,7 +486,7 @@ export default {
|
|
|
title: "开票新增",
|
|
|
loading: true,
|
|
|
detailDialog: false,
|
|
|
- operationWidth: 200, //操作列宽度
|
|
|
+ operationWidth: 220, //操作列宽度
|
|
|
queryFrom: {
|
|
|
//查询条件
|
|
|
},
|
|
|
@@ -642,6 +647,7 @@ export default {
|
|
|
allCollectionData: [], //所有账户信息列表
|
|
|
formDataId: "", //编辑数据id
|
|
|
profitObj: {},
|
|
|
+ typeStatus: "", //1是编辑 2是进账
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -663,11 +669,11 @@ export default {
|
|
|
rate: 0, //税率
|
|
|
payMethod: [], //支付方式
|
|
|
};
|
|
|
- this.affiliationData.forEach(item=>{
|
|
|
- item.profit = 0
|
|
|
+ this.affiliationData.forEach((item) => {
|
|
|
+ item.profit = 0;
|
|
|
});
|
|
|
- this.affiliationData2.forEach(item=>{
|
|
|
- item.profit = 0
|
|
|
+ this.affiliationData2.forEach((item) => {
|
|
|
+ item.profit = 0;
|
|
|
});
|
|
|
this.formDataId = "";
|
|
|
this.$nextTick(() => {
|
|
|
@@ -690,9 +696,9 @@ export default {
|
|
|
getAffiliationData() {
|
|
|
this.$api.expense.getList().then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
- res.data.forEach(item=>{
|
|
|
- item.profit = 0
|
|
|
- })
|
|
|
+ res.data.forEach((item) => {
|
|
|
+ item.profit = 0;
|
|
|
+ });
|
|
|
this.affiliationData = JSON.parse(JSON.stringify(res.data));
|
|
|
this.affiliationData2 = JSON.parse(JSON.stringify(res.data));
|
|
|
} else {
|
|
|
@@ -725,21 +731,21 @@ export default {
|
|
|
//获取资金用途树数据
|
|
|
getTreeList() {
|
|
|
this.$api.expense.getAccountExpensesTreeList().then((res) => {
|
|
|
- if(res.code == 200){
|
|
|
+ if (res.code == 200) {
|
|
|
this.fundFlowData = res.data;
|
|
|
- this.fundFlowSet()
|
|
|
- }else{
|
|
|
+ this.fundFlowSet();
|
|
|
+ } else {
|
|
|
this.$message.error(res.msg);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
//资金用途数据转换 如果最后一项child数组长度为0把值变为null
|
|
|
- fundFlowSet(data){
|
|
|
- data = data || this.fundFlowData
|
|
|
- for(var i = 0; i <data.length;i++) {
|
|
|
- if(data[i].child.length){
|
|
|
- this.fundFlowSet(data[i].child)
|
|
|
- }else{
|
|
|
+ fundFlowSet(data) {
|
|
|
+ data = data || this.fundFlowData;
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
+ if (data[i].child.length) {
|
|
|
+ this.fundFlowSet(data[i].child);
|
|
|
+ } else {
|
|
|
data[i].child = null;
|
|
|
}
|
|
|
}
|
|
|
@@ -827,11 +833,12 @@ export default {
|
|
|
let params = JSON.parse(JSON.stringify(this.formData));
|
|
|
this.$refs.formData.validate((valid) => {
|
|
|
if (valid) {
|
|
|
- if (this.formDataId) {
|
|
|
+ //进账
|
|
|
+ if (this.formDataId && this.typeStatus == 2) {
|
|
|
//转化资金归属
|
|
|
params.entProfit = {};
|
|
|
params.outProfit = {};
|
|
|
- this.affiliationData.forEach((item) => {
|
|
|
+ this.affiliationData.forEach((item) => {
|
|
|
params.entProfit[item.profitEng] = item.profit;
|
|
|
});
|
|
|
this.affiliationData2.forEach((item) => {
|
|
|
@@ -846,8 +853,8 @@ export default {
|
|
|
fundUse: this.formData.fundUse[this.formData.fundUse.length - 2], //资金用途
|
|
|
fundFen: this.formData.fundUse[this.formData.fundUse.length - 1], //资金用途分项
|
|
|
payoutTime: params.payoutTime, //进账日期
|
|
|
- entProfit:params.entProfit, //收入方资金归属
|
|
|
- outProfit:params.outProfit, //支出方资金归属
|
|
|
+ entProfit: params.entProfit, //收入方资金归属
|
|
|
+ outProfit: params.outProfit, //支出方资金归属
|
|
|
};
|
|
|
this.$api.expense.putInvAccountIncoice(obj).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
@@ -857,6 +864,26 @@ export default {
|
|
|
this.$message.error(res.msg);
|
|
|
}
|
|
|
});
|
|
|
+ //编辑
|
|
|
+ } else if (this.formDataId && this.typeStatus == 1) {
|
|
|
+ params.invoiceBy = this.formData.invoiceBy.nameValue; //开票方
|
|
|
+ params.bigApplyAmount = toChies(params.invoiceMoney); //大写金额
|
|
|
+ params.invoiceSubjects =
|
|
|
+ params.invoiceSubjects1 + "*" + params.invoiceSubjects2; //开票科目
|
|
|
+ params.otherUnit = params.otherUnit.nameValue; //对方单位名称
|
|
|
+ params.company = params.otherUnit; //单位
|
|
|
+ delete params.payMethod;
|
|
|
+ delete params.payoutTime;
|
|
|
+ console.log(params);
|
|
|
+ this.$api.expense.updateIncoice(params).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.detailDialog = false;
|
|
|
+ this.findPage();
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //新增
|
|
|
} else {
|
|
|
params.invoiceBy = this.formData.invoiceBy.nameValue; //开票方
|
|
|
params.bigApplyAmount = toChies(params.invoiceMoney); //大写金额
|
|
|
@@ -907,10 +934,11 @@ export default {
|
|
|
this.detailParams.pageSize = 10;
|
|
|
},
|
|
|
//编辑按钮
|
|
|
- handleDetail(index) {
|
|
|
+ handleDetail(index, type) {
|
|
|
+ this.typeStatus = type;
|
|
|
let row = index.row;
|
|
|
this.formDataId = row.invoiceId;
|
|
|
- this.title = "开票编辑";
|
|
|
+ this.title = type == 1 ? "开票编辑" : "开票进账";
|
|
|
this.getDetailData(row.invoiceId);
|
|
|
this.detailDialog = true;
|
|
|
},
|
|
|
@@ -919,12 +947,22 @@ export default {
|
|
|
this.$api.expense.detailInvAccountIncoice(id).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
let obj = this.collectionData.find(
|
|
|
- (item) => item.bankCardNum == res.data.bankCardNum
|
|
|
+ (item) => item.bankCardNum == res.data.revBankCardNum
|
|
|
+ );
|
|
|
+ let obj2 = this.collectionData.find(
|
|
|
+ (item) => item.bankCardNum == res.data.outBankCardNum
|
|
|
);
|
|
|
if (obj) {
|
|
|
res.data.invoiceBy = obj;
|
|
|
}
|
|
|
- this.formData = res.data;
|
|
|
+ if (obj2) {
|
|
|
+ res.data.otherUnit = obj;
|
|
|
+ }
|
|
|
+ if (this.typeStatus == 1) {
|
|
|
+ res.data.invoiceSubjects1 = res.data.invoiceSubjects.split('*')[0]
|
|
|
+ res.data.invoiceSubjects2 = res.data.invoiceSubjects.split('*')[1]
|
|
|
+ }
|
|
|
+ this.formData = JSON.parse(JSON.stringify(res.data));
|
|
|
} else {
|
|
|
this.$message.error(res.msg);
|
|
|
}
|