Commit dae0dedb authored by 谢子梦's avatar 谢子梦

stage:代开票信息-申请开票模块

parent 30df3986
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
</el-form-item> </el-form-item>
<el-form-item label="开票状态" prop="payStatus"> <el-form-item label="开票状态" prop="payStatus">
<el-select v-model="queryParams.invoiceStatus" placeholder="请选择开票状态" @change="handleQuery" clearable> <el-select v-model="queryParams.invoiceStatus" placeholder="请选择开票状态" @change="handleQuery" clearable>
<el-option v-for="dict in dict.type.batch_pay_order_invoice_status" :key="dict.value" :label="dict.label" :value="dict.value" /> <el-option v-for="dict in dict.type.batch_pay_order_invoice_status" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
...@@ -28,12 +29,12 @@ ...@@ -28,12 +29,12 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="batchApplyInvoice" <el-button type="primary" icon="el-icon-plus" size="mini" @click="batchApplyInvoice" :disabled="multiple"
:disabled="multiple" v-hasPermi="['business:invoiceApply:apply']" >批量申请开票</el-button> v-hasPermi="['business:invoiceApply:apply']">批量申请开票</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport" <el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport" :disabled="multiple"
:disabled="multiple" v-hasPermi="['business:payOrder:export']">批量导出</el-button> v-hasPermi="['business:payOrder:export']">批量导出</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
...@@ -67,61 +68,164 @@ ...@@ -67,61 +68,164 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" /> <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<el-dialog title="申请开票" :visible.sync="openApply" width="70%"> <el-dialog title="申请开票" key="openDialog" :visible.sync="openApply" width="87%">
<el-form ref="formApply" :model="formApply" :rules="rulesApply" label-width="130px"> <el-form ref="formApply" :model="formApply" :rules="rulesApply" label-width="130px">
<el-row> <el-row>
<el-col :span="10"> <el-col :span="10">
<el-descriptions title="购买方信息" :column="1" size="medium"> <el-descriptions title="购买方信息" :column="1" size="medium">
<el-descriptions-item label="名称" :contentStyle="{'font-size': '14px'}"> <el-descriptions-item label="名称" :contentStyle="{ 'font-size': '14px' }">
{{formApply.applyCompanyInvoice.invoiceTitle}} {{ formApply.applyCompanyInvoice.invoiceTitle }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="纳税人识别号" :contentStyle="{'font-size': '14px'}"> <el-descriptions-item label="纳税人识别号" :contentStyle="{ 'font-size': '14px' }">
{{formApply.applyCompanyInvoice.taxRegistrationNumber}} {{ formApply.applyCompanyInvoice.taxRegistrationNumber }}
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<el-descriptions title="销售方信息" :column="1" size="medium"> <el-descriptions title="销售方信息" :column="1" size="medium">
<el-descriptions-item label="名称" :contentStyle="{'font-size': '14px'}"> <el-descriptions-item label="名称" :contentStyle="{ 'font-size': '14px' }">
{{formApply.taxCompanyInvoice.invoiceTitle}} {{ formApply.taxCompanyInvoice.invoiceTitle }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="纳税人识别号" :contentStyle="{'font-size': '14px'}"> <el-descriptions-item label="纳税人识别号" :contentStyle="{ 'font-size': '14px' }">
{{formApply.taxCompanyInvoice.taxRegistrationNumber}} {{ formApply.taxCompanyInvoice.taxRegistrationNumber }}
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-col> </el-col>
</el-row> </el-row>
<el-divider content-position="left">开票类目</el-divider> <el-divider content-position="left">开票类目</el-divider>
<el-row style="text-align: right; margin-bottom: 5px"> <el-row style="text-align: right; margin-bottom: 5px">
<el-button type="primary" size="mini" @click="addItemClick" >新增类目</el-button> <el-button type="primary" size="mini" @click="addItemClick">新增类目</el-button>
</el-row> </el-row>
<el-row style="margin-bottom: 10px"> <el-row style="margin-bottom: 10px">
<el-form-item prop="items" label-width="0px"> <el-table ref="multipleTable" :data="formApply.items" style="width: 100%"
<el-table :cell-style="{ 'text-align': 'center' }" :header-cell-style="{ 'text-align': 'center' }">
:data="formApply.items" <el-table-column prop="goodsName" label="项目名称">
style="width: 100%">
<el-table-column prop="goodsName" label="项目名称" width="180" />
<el-table-column prop="goodsSize" label="规格型号" />
<el-table-column prop="goodsUnit" label="单位"/>
<el-table-column prop="taxClassifyRate" label="税率" width="80" />
<el-table-column label="免税类型" prop="freeType">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.tax_free_type" :value="scope.row.freeType" /> <el-form-item label-width="0px">
<span> {{ scope.row.goodsName }}</span>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goodsCount" label="数量" /> <el-table-column prop="goodsSize" label="规格型号">
<el-table-column prop="goodsPrice" label="单价" width="180"/> <template slot="header">
<el-table-column prop="amount" label="金额(不含税)" /> <div style="display: flex;align-items: center;"><span style="color: red;font-size: 16px;">*</span>规格型号
<el-table-column prop="taxAmount" label="税额" /> </div>
<el-table-column prop="id" label="操作" width="80"> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" style="float: right; margin-bottom: 5px" @click="removeItem(scope.$index)">移除</el-button> <el-form-item label-width="0px" :key="scope.$index" :prop="'items.' + scope.$index + '.goodsSize'"
:rules="rulesApply.goodsSize">
<el-input @input="changeItemForceupdate" v-model="formApply.items[scope.$index].goodsSize"
size="small" placeholder="请输入规格型号" />
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
</el-table> <el-table-column prop="goodsUnit" label="单位">
<template slot="header">
<div style="display: flex;align-items: center;"><span style="color: red;font-size: 16px;">*</span>单位
</div>
</template>
<template slot-scope="scope">
<el-form-item label-width="0px" :prop="'items.' + scope.$index + '.goodsUnit'"
:rules="rulesApply.goodsUnit">
<el-input @input="changeItemForceupdate" v-model="formApply.items[scope.$index].goodsUnit"
size="small" placeholder="请输入单位" />
</el-form-item>
</template>
</el-table-column>
<el-table-column prop="taxClassifyRate" label="税率">
<template slot="header">
<div style="display: flex;align-items: center;"><span style="color: red;font-size: 16px;">*</span>税率
</div>
</template>
<template slot-scope="scope">
<el-form-item label-width="0px" :prop="'items.' + scope.$index + '.taxClassifyRate'"
:rules="rulesApply.taxClassifyRate">
<el-select @change="countPriceFn" placeholder="请选择税率"
v-model="formApply.items[scope.$index].taxClassifyRate">
<el-option v-for="(item, index) in scope.row.taxRateData" :key="index" :label="item"
:value="item"></el-option>
</el-select>
</el-form-item> </el-form-item>
</template>
</el-table-column>
<el-table-column label="免税类型" prop="freeType" width="180">
<template slot="header">
<div style="display: flex;align-items: center;">免税类型
</div>
</template>
<template slot-scope="scope">
<el-form-item label-width="0px" :prop="'items.' + scope.$index + '.freeType'"
:rules="rulesApply.freeType">
<el-select :disabled="Number(scope.row.taxClassifyRate) != 0" @change="changeItemForceupdate"
v-model="formApply.items[scope.$index].freeType" size="small" placeholder="请选择免税类型">
<el-option v-for="dict in dict.type.tax_free_type" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column prop="goodsCount" label="数量" width="180">
<template slot="header">
<div style="display: flex;align-items: center;"><span style="color: red;font-size: 16px;">*</span>数量
</div>
</template>
<template slot-scope="scope">
<el-form-item label-width="0px" :prop="'items.' + scope.$index + '.goodsCount'"
:rules="rulesApply.goodsCount">
<el-input placeholder="请输入数量" type="number" @input="countPriceFn" v-model="scope.row.goodsCount"
size="small"></el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column prop="goodsPrice" label="单价">
<template slot-scope="scope">
<el-form-item label-width="0px">
{{ scope.row.goodsPrice }}
</el-form-item>
</template>
</el-table-column>
<el-table-column prop="amountTax" label="价税合计" width="180">
<template slot="header">
<div style="display: flex;align-items: center;"><span style="color: red;font-size: 16px;">*</span>价税合计
</div>
</template>
<template slot-scope="scope">
<el-form-item label-width="0px" :prop="'items.' + scope.$index + '.amountTax'"
:rules="rulesApply.amountTax">
<el-input placeholder="价税合计" type="number" @input="countPriceFn" v-model="scope.row.amountTax"
size="small"></el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column prop="amount" label="金额(不含税)">
<template slot-scope="scope">
<el-form-item label-width="0px">
{{ scope.row.amount }}
</el-form-item>
</template>
</el-table-column>
<el-table-column prop="taxAmount" label="税额">
<template slot-scope="scope">
<el-form-item label-width="0px">
{{ scope.row.taxAmount }}
</el-form-item>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<!-- <el-form-item label-width="0px"> -->
<el-button type="danger" size="mini" @click="removeItem(scope.$index)" icon="el-icon-delete"
circle>移除</el-button>
<!-- <el-button size="mini" style="float: right; margin-bottom: 5px"
@click="removeItem(scope.$index)">移除</el-button> -->
<!-- </el-form-item> -->
</template>
</el-table-column>
</el-table>
<!-- </el-form-item> -->
</el-row> </el-row>
<el-card shadow="hover" class="invoice-info-card"> <el-card shadow="hover" class="invoice-info-card">
<div> <div>
...@@ -130,11 +234,13 @@ ...@@ -130,11 +234,13 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="价税合计金额/元" prop="totalAmountTax"> <el-form-item label="价税合计金额/元" prop="totalAmountTax">
<el-input v-model="formApply.totalAmountTax" placeholder="请输入价税合计金额/元" disabled/> <el-input v-model="formApply.totalAmountTax" placeholder="请输入价税合计金额/元" disabled />
</el-form-item> </el-form-item>
<el-form-item label="发票类型" prop="invoieType"> <el-form-item label="发票类型" prop="invoieType">
<el-radio-group v-model="formApply.invoieType"> <el-radio-group v-model="formApply.invoieType">
<el-radio v-for="dict in dict.type.tax_invoice_type" :key="dict.value" :label="dict.value" >{{dict.label}}</el-radio> <el-radio v-for="dict in dict.type.tax_invoice_type" :key="dict.value" :label="dict.value">{{
dict.label
}}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -143,7 +249,8 @@ ...@@ -143,7 +249,8 @@
</el-card> </el-card>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitApply">确认申请开票</el-button> <el-button type="primary" @click="submitApply"
:disabled="Number(taxIncludedTotalAmount) > Number(formApply.totalAmountTax)">确认申请开票</el-button>
<el-button @click="openApply = false">取消</el-button> <el-button @click="openApply = false">取消</el-button>
</div> </div>
</el-dialog> </el-dialog>
...@@ -153,7 +260,7 @@ ...@@ -153,7 +260,7 @@
<el-table-column prop="goodsName" label="类目名称" width="180" /> <el-table-column prop="goodsName" label="类目名称" width="180" />
<el-table-column prop="code" label="类目编码" width="180" /> <el-table-column prop="code" label="类目编码" width="180" />
<el-table-column prop="vatRate" label="税率" /> <el-table-column prop="vatRate" label="税率" />
<el-table-column prop="vatRate" label="操作" > <el-table-column prop="vatRate" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="primary" size="mini" @click="addItem(scope.row)">选择</el-button> <el-button type="primary" size="mini" @click="addItem(scope.row)">选择</el-button>
</template> </template>
...@@ -164,8 +271,8 @@ ...@@ -164,8 +271,8 @@
</div> </div>
</el-dialog> </el-dialog>
<el-dialog title="添加商品" :visible.sync="classifyRateFormPanel" width="600px" append-to-body> <!-- <el-dialog title="添加商品" :visible.sync="classifyRateFormPanel" width="600px" append-to-body>
<el-form :model="classifyRateForm" label-width="130px"> <el-form :model="classifyRateForm" label-width="110px">
<el-form-item label="类目名称"> <el-form-item label="类目名称">
<el-input v-model="classifyRateForm.goodsName" disabled></el-input> <el-input v-model="classifyRateForm.goodsName" disabled></el-input>
</el-form-item> </el-form-item>
...@@ -176,38 +283,43 @@ ...@@ -176,38 +283,43 @@
<el-input v-model="classifyRateForm.goodsUnit" placeholder="单位"></el-input> <el-input v-model="classifyRateForm.goodsUnit" placeholder="单位"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="费率"> <el-form-item label="费率">
<el-select v-model="classifyRateForm.taxClassifyRate" placeholder="请选择费率"> <el-select @change="countPriceFn" v-model="classifyRateForm.taxClassifyRate" placeholder="请选择费率">
<el-option v-for="(item, index) in classifyRates" :label="item" :value="item" /> <el-option v-for="(item, index) in classifyRates" :key="index" :label="item" :value="item" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="免税类型"> <el-form-item label="免税类型">
<el-select :disabled="!classifyRateForm.taxClassifyRate || classifyRateForm.taxClassifyRate > 0" <el-select :disabled="!classifyRateForm.taxClassifyRate || classifyRateForm.taxClassifyRate > 0"
v-model.trim="classifyRateForm.freeType" v-model.trim="classifyRateForm.freeType" size="small" placeholder="请选择免税类型">
size="small" placeholder="请选择免税类型"> <el-option v-for="dict in dict.type.tax_free_type" :key="dict.value" :label="dict.label"
<el-option v-for="dict in dict.type.tax_free_type" :key="dict.value" :label="dict.label" :value="dict.value" /> :value="dict.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="数量"> <el-form-item label="数量">
<el-input-number v-model="classifyRateForm.goodsCount" :precision="0" :step="1" :min="1" style="width: 100%"></el-input-number> <el-input-number v-model="classifyRateForm.goodsCount" :precision="0" :step="1" :min="1"
style="width: 100%"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="单价(含税)"> <el-form-item label="单价(含税)">
<el-input-number v-model="classifyRateForm.goodsPrice" :precision="2" :step="0.1" :min="0.1" style="width: 150px"></el-input-number> <el-input-number v-model="classifyRateForm.goodsMoney" :precision="2" :step="0.1" :min="0.1"
style="width: 150px"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="单价(不含税)"> <el-form-item label="单价(不含税)">
<el-input-number v-model="classifyRateForm.goodsPrice" :precision="2" :step="0.1" :min="0.1" style="width: 150px"></el-input-number> <el-input-number v-model="classifyRateForm.goodsPrice" :precision="2" :step="0.1" :min="0.1"
style="width: 150px"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="金额(不含税)"> <el-form-item label="金额(不含税)">
<el-input-number disabled v-model="classifyRateForm.amount" :precision="2" :step="1" :min="1" style="width: 100%"></el-input-number> <el-input-number disabled v-model="classifyRateForm.amount" :precision="2" :step="1" :min="1"
style="width: 100%"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="税额"> <el-form-item label="税额">
<el-input-number disabled v-model="classifyRateForm.taxAmount" :precision="2" :step="1" :min="1" style="width: 100%"></el-input-number> <el-input-number disabled v-model="classifyRateForm.taxAmount" :precision="2" :step="1" :min="1"
style="width: 100%"></el-input-number>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitItem">确认</el-button> <el-button type="primary" @click="submitItem">确认</el-button>
<el-button @click="classifyRateFormPanel = false">取消</el-button> <el-button @click="classifyRateFormPanel = false">取消</el-button>
</div> </div>
</el-dialog> </el-dialog> -->
</div> </div>
</template> </template>
...@@ -226,7 +338,7 @@ import { getUnitTaxCategories, laborSign, querySignList } from '@/api/business/u ...@@ -226,7 +338,7 @@ import { getUnitTaxCategories, laborSign, querySignList } from '@/api/business/u
export default { export default {
name: "PayOrder", name: "PayOrder",
components: { RePay }, components: { RePay },
dicts: ['pay_status', 'batch_pay_order_invoice_status', 'pay_type_title','tax_invoice_type', 'tax_free_type'], dicts: ['pay_status', 'batch_pay_order_invoice_status', 'pay_type_title', 'tax_invoice_type', 'tax_free_type'],
data() { data() {
return { return {
//人力公司list //人力公司list
...@@ -296,8 +408,12 @@ export default { ...@@ -296,8 +408,12 @@ export default {
invoiceTitle: '', invoiceTitle: '',
taxRegistrationNumber: '' taxRegistrationNumber: ''
}, },
totalAmountTax: 0,
totalAmount: 0,
totalTax: 0,
items: [] items: []
}, },
taxIncludedTotalAmount: 0, //列表中的含税金额总计
// 表单校验 // 表单校验
rulesApply: { rulesApply: {
applyCompanyId: [ applyCompanyId: [
...@@ -311,6 +427,84 @@ export default { ...@@ -311,6 +427,84 @@ export default {
], ],
invoieType: [ invoieType: [
{ required: true, message: "请选择发票类型", trigger: "change" } { required: true, message: "请选择发票类型", trigger: "change" }
],
goodsSize: [
{
validator: (rule, value, callback) => {
let arr = rule.field.split('.');
if (!this.formApply.items[arr[1]].goodsSize) {
callback(new Error('请输入规格'));
} else {
callback();
}
}, trigger: ['blur', 'change']
}
],
goodsUnit: [
{
validator: (rule, value, callback) => {
let arr = rule.field.split('.');
if (!this.formApply.items[arr[1]].goodsUnit) {
callback(new Error('请输入单位'));
} else {
callback();
}
}, trigger: ['blur', 'change']
}
],
taxClassifyRate: [
{
validator: (rule, value, callback) => {
let arr = rule.field.split('.');
if (!this.formApply.items[arr[1]].taxClassifyRate) {
callback(new Error('请选择税率'));
} else {
callback();
}
}, trigger: ['blur', 'change']
}
],
freeType: [
{
validator: (rule, value, callback) => {
let arr = rule.field.split('.');
if (!this.formApply.items[arr[1]].freeType && Number(this.formApply.items[arr[1]].taxClassifyRate) == 0) {
callback(new Error('请选择免税类型'));
} else {
callback();
}
}, trigger: ['blur', 'change']
}
],
goodsCount: [
{
validator: (rule, value, callback) => {
let arr = rule.field.split('.');
if (!this.formApply.items[arr[1]].goodsCount) {
callback(new Error('请输入数量'));
} else if (Number(this.formApply.items[arr[1]].goodsCount) <= 0) {
callback(new Error('数量不能小于等于0'));
} else {
callback();
}
}, trigger: ['blur', 'change']
}
],
amountTax: [
{
validator: (rule, value, callback) => {
let arr = rule.field.split('.');
if (!this.formApply.items[arr[1]].amountTax) {
callback(new Error('请输入价税合计'));
} else if (Number(this.formApply.items[arr[1]].amountTax) <= 0) {
callback(new Error('价税合计不能小于等于0'));
} else if (Number(this.formApply.items[arr[1]].amountTax > Number(this.formApply.totalAmountTax))) {
callback(new Error('不能大于开票金额的价税合计'));
} else {
callback();
}
}, trigger: ['blur', 'change']
}
] ]
}, },
taxCategoryPanel: { taxCategoryPanel: {
...@@ -325,6 +519,7 @@ export default { ...@@ -325,6 +519,7 @@ export default {
taxClassifyCode: '', taxClassifyCode: '',
goodsName: '', goodsName: '',
taxClassifyRate: '', taxClassifyRate: '',
goodsMoney: '',
goodsPrice: '', goodsPrice: '',
goodsSize: '', goodsSize: '',
goodsUnit: '', goodsUnit: '',
...@@ -339,7 +534,47 @@ export default { ...@@ -339,7 +534,47 @@ export default {
this.getListgetCompanyList(1); this.getListgetCompanyList(1);
// this.getListgetCompanyList(2); // this.getListgetCompanyList(2);
}, },
computed: {
// 计算属性,计算选中的数量
countPriceFnComputed() {
}
},
methods: { methods: {
countPriceFn() {
// console.log('执行计算', this.formApply.items);
if (this.formApply.items.length > 0) {
this.formApply.totalAmount = 0;
this.formApply.totalTax = 0;
this.taxIncludedTotalAmount = 0
this.formApply.items.forEach(item => {
if (item.amountTax) {
this.taxIncludedTotalAmount += Number(item.amountTax);
if (this.formApply.totalAmountTax < this.taxIncludedTotalAmount) {
this.$modal.msgError(`价税合计金额(${this.taxIncludedTotalAmount})不能大于开票金额价税金额的(${this.formApply.totalAmountTax})总和`)
}
}
if (item.taxClassifyRate && item.goodsCount && item.amountTax) {
item.taxAmount = Math.round((Number(item.amountTax) - Number(item.amountTax) / (1 + Number(item.taxClassifyRate))) * 100) / 100;
item.amount = Math.round((Number(item.amountTax) - Number(item.taxAmount)) * 100) / 100;
item.goodsPrice = Math.round((Number(item.amount) / Number(item.goodsCount)) * 10000) / 10000;
if (item.amount) {
this.formApply.totalAmount += item.amount;
}
if (item.taxAmount) {
this.formApply.totalTax += item.taxAmount;
}
}
});
}
this.$forceUpdate()
// this.countPriceFnComputed()
},
//更新视图方法
changeItemForceupdate() {
console.log('执行立刻', this.formApply.items);
this.$forceUpdate()
},
//获取企业信息数据 //获取企业信息数据
getListgetCompanyList(bindType) { getListgetCompanyList(bindType) {
this.loading = true; this.loading = true;
...@@ -351,14 +586,14 @@ export default { ...@@ -351,14 +586,14 @@ export default {
listCompanyInfo(queryParams).then(response => { listCompanyInfo(queryParams).then(response => {
if (bindType == 1) { if (bindType == 1) {
this.applyCompanyList = response.rows; this.applyCompanyList = response.rows;
}else if (bindType == 2) { } else if (bindType == 2) {
this.taxCompanyList = response.rows; this.taxCompanyList = response.rows;
} }
this.loading = false; this.loading = false;
}); });
}, },
//查询合作机构list //查询合作机构list
queryTaxCompanyList(applyCompanyId){ queryTaxCompanyList(applyCompanyId) {
const queryParams = { const queryParams = {
inviterId: applyCompanyId, inviterId: applyCompanyId,
signStatus: 2, signStatus: 2,
...@@ -367,7 +602,7 @@ export default { ...@@ -367,7 +602,7 @@ export default {
} }
laborSign(queryParams).then(response => { laborSign(queryParams).then(response => {
if (response.code == 200) { if (response.code == 200) {
if(response.total == 0){ if (response.total == 0) {
this.$modal.msgError("该企业未签约,无法申请开票"); this.$modal.msgError("该企业未签约,无法申请开票");
return; return;
} }
...@@ -399,7 +634,7 @@ export default { ...@@ -399,7 +634,7 @@ export default {
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map(item => item.id)
this.batchNos = selection.map(item => item.batchNo) this.batchNos = selection.map(item => item.batchNo)
this.single = selection.length!==1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
console.log(this.ids); console.log(this.ids);
console.log(this.batchNos); console.log(this.batchNos);
...@@ -429,7 +664,6 @@ export default { ...@@ -429,7 +664,6 @@ export default {
}, },
// 申请开票 // 申请开票
applyInvoice(row) { applyInvoice(row) {
this.openApply = true
this.formApply.totalAmountTax = row.successAmount this.formApply.totalAmountTax = row.successAmount
this.formApply.batchPayIds = [row.id] this.formApply.batchPayIds = [row.id]
this.formApply.batchPayOrderIds = row.id this.formApply.batchPayOrderIds = row.id
...@@ -445,6 +679,7 @@ export default { ...@@ -445,6 +679,7 @@ export default {
this.formApply.applyCompanyInvoice.companyName = resp.data.inviterName this.formApply.applyCompanyInvoice.companyName = resp.data.inviterName
this.formApply.applyCompanyInvoice.invoiceTitle = resp.data.inviterName this.formApply.applyCompanyInvoice.invoiceTitle = resp.data.inviterName
this.formApply.applyCompanyInvoice.taxRegistrationNumber = resp.data.inviterCode this.formApply.applyCompanyInvoice.taxRegistrationNumber = resp.data.inviterCode
this.openApply = true
// 不需要额外的开票信息 // 不需要额外的开票信息
// getInvoiceInfoByCompanyId(resp.data.inviterId).then(response => { // getInvoiceInfoByCompanyId(resp.data.inviterId).then(response => {
// this.formApply.applyCompanyInvoice = response.data; // this.formApply.applyCompanyInvoice = response.data;
...@@ -509,11 +744,11 @@ export default { ...@@ -509,11 +744,11 @@ export default {
this.$message.error(response.msg); this.$message.error(response.msg);
} }
}) })
})
}
}).finally(() => { }).finally(() => {
this.loading = false; this.loading = false;
}); });
}
})
}, },
// 批量申请开票 // 批量申请开票
batchApplyInvoice(row) { batchApplyInvoice(row) {
...@@ -547,23 +782,38 @@ export default { ...@@ -547,23 +782,38 @@ export default {
}) })
}, },
addItem(classify) { addItem(classify) {
// console.log('表格数据', this.formApply.items);
classify.taxRateData = classify.vatRate.split(',')
classify.taxClassifyRate = null
classify.goodsSize = ''
classify.goodsUnit = null
classify.goodsCount = null
classify.goodsPrice = ''
classify.amountTax = null
classify.amount = ''
classify.taxAmount = ''
classify.freeType = ''
this.formApply.items.push(classify)
console.log('表格数据', this.formApply);
this.taxCategoryPanel.open = false this.taxCategoryPanel.open = false
let rate = classify.vatRate.split(",") // this.$forceUpdate()
if (rate.length > 1) {
this.classifyRateFormPanel = true // let rate = classify.vatRate.split(",")
this.classifyRateForm = { // if (rate.length > 1) {
goodsName: classify.goodsName, // this.classifyRateFormPanel = true
taxClassifyCode: classify.code, // this.classifyRateForm = {
taxClassifyRate: '' // goodsName: classify.goodsName,
} // taxClassifyCode: classify.code,
this.classifyRates = rate // taxClassifyRate: ''
} else { // }
this.formApply.items.push({ // this.classifyRates = rate
taxClassifyCode: classify.code, // } else {
goodsName: classify.goodsName, // this.formApply.items.push({
taxClassifyRate: rate[0] // taxClassifyCode: classify.code,
}) // goodsName: classify.goodsName,
} // taxClassifyRate: rate[0]
// })
// }
}, },
removeItem(index) { removeItem(index) {
this.formApply.items.splice(index, 1) this.formApply.items.splice(index, 1)
...@@ -591,9 +841,11 @@ export default { ...@@ -591,9 +841,11 @@ export default {
padding: 0 !important; padding: 0 !important;
} }
} }
.invoice-info-card { .invoice-info-card {
margin-bottom: 10px; margin-bottom: 10px;
} }
.title-bold { .title-bold {
text-align: left; text-align: left;
font-weight: bold; font-weight: bold;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment