|
|
@@ -1,842 +0,0 @@
|
|
|
-<template>
|
|
|
- <!--布局容器-->
|
|
|
- <div class="container" style="width: 99%; margin-top: 0px">
|
|
|
- <templateTable :formList="formList" :searchData.sync="queryFrom" :tableConfig="tableConfig" :btnGroup="btnGroup"
|
|
|
- :data="pageResult" @getList="findPage" @handleSearchList="handleSearchList" :pagination="pageData">
|
|
|
- </templateTable>
|
|
|
- <!-- 新增弹出框 -->
|
|
|
- <el-dialog :title="dialogTitle" class="dialog" :close-on-click-modal="false" :before-close="handleClose"
|
|
|
- :visible.sync="dialogFormVisible" width="900px">
|
|
|
- <el-form class="frame" :model="dataform" label-width="120px" size="small" :rules="rules" :disabled="isDisabled"
|
|
|
- ref="dataform">
|
|
|
- <el-row>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="开票日期" prop="invoiceDate"><el-date-picker v-model="dataform.invoiceDate" type="date"
|
|
|
- placeholder="选择日期" value-format="yyyy-MM-dd">
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="开票员" prop="invoiceClerk">
|
|
|
- <el-input v-model="dataform.invoiceClerk" autocomplete="off"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row type="flex" justify="center">
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="开票方" prop="invCompanyId">
|
|
|
- <el-select v-model="dataform.invCompanyId" placeholder="请选择开票方" @change="invCompanyChange">
|
|
|
- <el-option v-for="item in invCompanyNameList" :key="item.id" :label="item.enterpriseName"
|
|
|
- :value="item.id"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="开票科目" prop="subjectsId">
|
|
|
- <el-select v-model="dataform.subjectsId" placeholder="请选择开票科目" @change="changeDept">
|
|
|
- <el-option v-for="item in subjectstList" :key="item.value" :label="item.label"
|
|
|
- :value="item.value"></el-option>
|
|
|
- </el-select> </el-form-item></el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="对方单位名称" prop="peerCompanyName">
|
|
|
- <el-input v-model="dataform.peerCompanyName" autocomplete="off"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="发票类型" prop="invoiceType">
|
|
|
- <el-select v-model="dataform.invoiceType" placeholder="请选择发票类型" @change="invoiceChange">
|
|
|
- <el-option v-for="item in incoiceList" :key="item.value" :label="item.label"
|
|
|
- :value="item.value"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="开票金额" prop="invoiceAmount">
|
|
|
- <el-input v-model.trim="dataform.invoiceAmount" autocomplete="off"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="发票号码" prop="invoiceNum">
|
|
|
- <el-input v-model="dataform.invoiceNum" autocomplete="off"></el-input> </el-form-item></el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="不含税收入" prop="taxExclusivePrice">
|
|
|
- <el-input disabled v-model="dataform.taxExclusivePrice"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="发票数" prop="invoiceQuantity">
|
|
|
- <el-input v-model.trim="dataform.invoiceQuantity"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="税额" prop="taxAmounts">
|
|
|
- <el-input v-model="dataform.taxAmounts" disabled></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="税率(%)" prop="taxRate">
|
|
|
- <el-input v-model="dataform.taxRate"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <!-- <el-form-item label="备注" prop="remark">
|
|
|
- <el-input type="textarea" v-model="dataform.remark"></el-input>
|
|
|
- </el-form-item> -->
|
|
|
- </el-form>
|
|
|
- <el-divider v-if="isDisabled"></el-divider>
|
|
|
- <el-form v-if="isDisabled" class="frame" :model="dataCollection" label-width="120px" size="small"
|
|
|
- :rules="rulesCollection" :disabled="isWholeDisabled" ref="dataCollection">
|
|
|
- <el-row>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="未进账金额" prop="notIncomeMoney"> <el-input disabled v-model="notIncomeMoney"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="未出账金额" prop="notOutMoney">
|
|
|
- <el-input disabled v-model="notOutMoney"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="利润合计" prop="totalProfit"> <el-input disabled v-model="dataCollection.totalProfit"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="已提利润" prop="profitApplied">
|
|
|
- <el-input v-model="dataCollection.profitApplied"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="利润点(%)" prop="profitPoint"> <el-input
|
|
|
- v-model.trim="dataCollection.profitPoint"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="手续费" prop="procedureFee">
|
|
|
- <el-input v-model.trim="dataCollection.procedureFee"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <el-button style="margin-left:30px" type="success" size="small" @click="addIncome()">添加进账</el-button>
|
|
|
- <el-row v-for="(val, index) in dataCollection.incomeList" :key="index">
|
|
|
- <el-col :span="10">
|
|
|
- <el-form-item :label="'进账金额' + (index + 1)" :prop="'incomeList.' + index + '.incomeMoney'"
|
|
|
- :rules="rulesCollection.incomeMoney"> <el-input v-model="val.incomeMoney"
|
|
|
- @change="incomeMoneyFun(val.incomeMoney, index)" @input='provingChange($event, "incomeMoney")'></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="10">
|
|
|
- <el-form-item :label="'进账日期' + (index + 1)" :prop="'incomeList.' + index + '.incomeDate'">
|
|
|
- <el-date-picker type="date" size="small" v-model="val.incomeDate" placeholder="选择日期"
|
|
|
- @input='provingChange($event, "incomeDate")' value-format="yyyy-MM-dd"></el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="4">
|
|
|
- <el-button type="primary" size="small" @click="deleteIncome(index)">删除</el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="10" style="margin-top:10px">
|
|
|
- <el-form-item :label="'出账金额' + (index + 1)" :prop="'incomeList.' + index + '.outIncomeMoney'"> <el-input
|
|
|
- v-model="val.outIncomeMoney" disabled @input='provingChange($event, "outIncomeMoney")'></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="10" style="margin-top:10px">
|
|
|
- <el-form-item :label="'出账日期' + (index + 1)" :prop="'incomeList.' + index + '.outIncomeDate'">
|
|
|
- <el-date-picker type="date" size="small" v-model="val.outIncomeDate" placeholder="选择日期"
|
|
|
- @input='provingChange($event, "outIncomeDate")' value-format="yyyy-MM-dd"></el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="21">
|
|
|
- <el-form-item label="备注" prop="remark"> <el-input type="textarea" v-model="dataCollection.remark"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- </el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="resetForm('dataform')" size="small">取 消</el-button>
|
|
|
- <el-button v-if="dialogTitle!=='查看发票信息'" type="primary" @click="submitForm()" size="small">确 定</el-button>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
-
|
|
|
-<script>
|
|
|
-import { limitNumber } from "../../utils/validate.js";
|
|
|
-import templateTable from '@/components/TemplateTable/index.vue'
|
|
|
-
|
|
|
-export default {
|
|
|
- name: "InvoiceInformation",
|
|
|
- components: { templateTable },
|
|
|
- created() {
|
|
|
- //获取所有下拉框数据
|
|
|
- this.subjectsFn(); //开票科目
|
|
|
- this.incoiceType(); //发票类型
|
|
|
- this.EnterpriseName(); //开票方
|
|
|
- this.findPage()
|
|
|
-
|
|
|
- },
|
|
|
- computed: {
|
|
|
- notIncomeMoney: {
|
|
|
- get: function () {
|
|
|
- let a
|
|
|
- if (this.dataCollection.incomeList[0].incomeMoney) {
|
|
|
- a = 0
|
|
|
- this.dataCollection.incomeList.forEach(val => {
|
|
|
- a += Number(val.incomeMoney)
|
|
|
- })
|
|
|
- a = Number(this.dataform.invoiceAmount) - a
|
|
|
- }
|
|
|
- else {
|
|
|
- a = this.dataform.invoiceAmount
|
|
|
- }
|
|
|
- return a
|
|
|
- },
|
|
|
- set: function (value) {
|
|
|
- this.dataform.invoiceAmount = value
|
|
|
- },
|
|
|
- },
|
|
|
- notOutMoney: {
|
|
|
- get: function () {
|
|
|
- let a
|
|
|
- if (this.dataCollection.incomeList[0].outIncomeMoney) {
|
|
|
- a = 0
|
|
|
- this.dataCollection.incomeList.forEach(val => {
|
|
|
- a += Number(val.outIncomeMoney)
|
|
|
- })
|
|
|
- a = Number(this.dataform.invoiceAmount) - a
|
|
|
- }
|
|
|
- else {
|
|
|
- a = this.dataform.invoiceAmount
|
|
|
- }
|
|
|
- return a
|
|
|
- },
|
|
|
- set: function (value) {
|
|
|
- this.dataform.invoiceAmount = value
|
|
|
- },
|
|
|
- },
|
|
|
- },
|
|
|
- watch: {
|
|
|
- // 开票金额
|
|
|
- 'dataform.invoiceAmount'(newVal, oldVal) {
|
|
|
- if (newVal && limitNumber(newVal)) {
|
|
|
- if (this.dataform.taxRate) {
|
|
|
- this.dataform.taxExclusivePrice = (Number(newVal) / (1 + Number(this.dataform.taxRate))).toFixed(2)
|
|
|
- this.dataform.taxAmounts = (Number(newVal) / (1 + Number(this.dataform.taxRate)) * Number(this.dataform.taxRate)).toFixed(2)
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- // 税率
|
|
|
- 'dataform.taxRate'(newVal, oldVal) {
|
|
|
- if (newVal && limitNumber(newVal)) {
|
|
|
- if (this.dataform.invoiceAmount) {
|
|
|
- this.dataform.taxExclusivePrice = (Number(this.dataform.invoiceAmount) / (1 + Number(newVal))).toFixed(2)
|
|
|
- this.dataform.taxAmounts = (Number(this.dataform.invoiceAmount) / (1 + Number(newVal)) * Number(newVal)).toFixed(2)
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- // 利润点
|
|
|
- 'dataCollection.profitPoint'(newVal) {
|
|
|
- if (newVal && limitNumber(newVal)) {
|
|
|
- let valData = Number(newVal)
|
|
|
- this.dataCollection.incomeList.forEach((val, index) => {
|
|
|
- if (val.incomeMoney) {
|
|
|
- this.dataCollection.incomeList[index].outIncomeMoney = ((1 - valData) * Number(val.incomeMoney)).toFixed(2)
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- if (this.dataCollection.procedureFee) {
|
|
|
- this.dataCollection.totalProfit = (Number(this.dataform.invoiceAmount) * valData - Number(this.dataCollection.procedureFee)).toFixed(2)
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
- // 手续费
|
|
|
- 'dataCollection.procedureFee'(newVal) {
|
|
|
- if (newVal && limitNumber(newVal)) {
|
|
|
- if (this.dataCollection.profitPoint) {
|
|
|
- this.dataCollection.totalProfit = (Number(this.dataform.invoiceAmount) * Number(this.dataCollection.profitPoint) - Number(newVal)).toFixed(2)
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- },
|
|
|
- data() {
|
|
|
- const validateSz = (rule, value, callback) => {
|
|
|
- if (!value && rule.field == "invoiceAmount") {
|
|
|
- callback(new Error("请填写开票金额"));
|
|
|
- }
|
|
|
- if (!value && rule.field == "invoiceQuantity") {
|
|
|
- callback(new Error("请填写发票数"));
|
|
|
- }
|
|
|
- if (value && !limitNumber(value)) {
|
|
|
- callback(new Error("请输入整数或者保留两位小数!"));
|
|
|
- }
|
|
|
- callback()
|
|
|
- };
|
|
|
- const valiaDigit = (rule, value, callback) => {
|
|
|
- if (value && !limitNumber(value)) {
|
|
|
- callback(new Error("请输入整数或者保留两位小数!"));
|
|
|
- }
|
|
|
- }
|
|
|
- return {
|
|
|
- formList: [
|
|
|
- {
|
|
|
- label: "开票员",
|
|
|
- prop: "invoiceClerk",
|
|
|
- type: 'input'
|
|
|
- },
|
|
|
- {
|
|
|
- label: "开票方",
|
|
|
- prop: "invCompanyName",
|
|
|
- type: 'input'
|
|
|
- },
|
|
|
- {
|
|
|
- label: "对方单位名称",
|
|
|
- prop: "peerCompanyName",
|
|
|
- type: 'input'
|
|
|
- },
|
|
|
- {
|
|
|
- label: "开票日期",
|
|
|
- prop: "invoiceDate",
|
|
|
- type: 'date'
|
|
|
- },
|
|
|
- {
|
|
|
- label: "开票科目",
|
|
|
- prop: "subjects",
|
|
|
- type: "select",
|
|
|
- options: this.subjectstList
|
|
|
- },
|
|
|
- {
|
|
|
- label: "发票类型",
|
|
|
- prop: "status",
|
|
|
- type: "select",
|
|
|
- options: JSON.parse(localStorage.getItem('user_statusoptions'))
|
|
|
- },
|
|
|
- ],
|
|
|
- btnGroup: [{
|
|
|
- name: '新增(外部合同开票)',
|
|
|
- click: () => { return this.add() },
|
|
|
- }, {
|
|
|
- name: '新增(手续费开票)',
|
|
|
- click: () => { return this.addTwo() },
|
|
|
- },],
|
|
|
- tableConfig: {
|
|
|
- columns: [
|
|
|
- // 数据列
|
|
|
- { prop: "invoiceClerk", label: "开票员", type: 'text' },
|
|
|
- {
|
|
|
- prop: "subjects",
|
|
|
- label: "开票科目", type: 'text',
|
|
|
- },
|
|
|
- { prop: "invCompanyName", label: "开票方", type: 'text', },
|
|
|
-
|
|
|
- { prop: "peerCompanyName", label: "对方单位名称", type: 'text', },
|
|
|
- { prop: "invoiceNum", label: "发票号码", type: 'text', },
|
|
|
- {
|
|
|
- prop: "invoiceDate",
|
|
|
- label: "开票日期",
|
|
|
- type: 'text',
|
|
|
- },
|
|
|
- {
|
|
|
- prop: "taxExclusivePrice",
|
|
|
- label: "不含税金额",
|
|
|
- type: 'text',
|
|
|
- },
|
|
|
- ],
|
|
|
- loading: true,
|
|
|
- isPaginationShow: true,
|
|
|
- isShowIndex: true,
|
|
|
- operationWidth: '120',
|
|
|
- optBtns: [
|
|
|
- {
|
|
|
- type: 'primary',
|
|
|
- label: '添加回款',
|
|
|
- type: 'text',
|
|
|
- click: (row, index) => { return this.addCollection(row) },
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'primary',
|
|
|
- label: '修改',
|
|
|
- type: 'text',
|
|
|
- click: (row, index) => { return this.handleTableEdit(row) },
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'primary',
|
|
|
- label: '查看',
|
|
|
- type: 'text',
|
|
|
- click: (row, index) => { return this.handleTableDetail(row) },
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'primary',
|
|
|
- label: '删除',
|
|
|
- type: 'text',
|
|
|
- click: (row, index) => { return this.handleTableDelete(row) },
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- pageData: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
- totalSize: 0
|
|
|
- },
|
|
|
- nvoicingCategory: '1',
|
|
|
- isDisabled: false,
|
|
|
- isWholeDisabled: false,
|
|
|
- dialogTitle: '新增发票信息',
|
|
|
- incomeList: [{
|
|
|
- incomeDate: '',
|
|
|
- incomeMoney: '',
|
|
|
- outIncomeDate: '',
|
|
|
- outIncomeMoney: ''
|
|
|
- }],
|
|
|
- pageResult: [], //表格数据
|
|
|
- //顶部查询信息
|
|
|
- queryFrom: {}, //查询信息
|
|
|
- dialogFormVisible: false, //新增弹出框
|
|
|
- dialogForm: false, //修改弹出框
|
|
|
- form: {},
|
|
|
- dataCollection: {
|
|
|
- incomeList: [{
|
|
|
- incomeDate: '',
|
|
|
- incomeMoney: '',
|
|
|
- outIncomeDate: '',
|
|
|
- outIncomeMoney: ''
|
|
|
- }],
|
|
|
- },
|
|
|
- //新增弹出框信息
|
|
|
- dataform: {},
|
|
|
- formLabelWidth: "120px",
|
|
|
- subjectstList: [], //选择的开票科目
|
|
|
- incoiceList: [], //选择的发票类型
|
|
|
- approvalList: [], //字典状态数组
|
|
|
- invCompanyNameList: [], //选择的开票方数组
|
|
|
- rulesCollection: {
|
|
|
- procedureFee: { required: false, trigger: "blur", validator: valiaDigit },
|
|
|
- profitPoint: { required: false, trigger: "blur", validator: valiaDigit },
|
|
|
- incomeMoney: { required: false, trigger: "change", validator: valiaDigit },
|
|
|
- },
|
|
|
- //表单验证
|
|
|
- rules: {
|
|
|
- invoiceClerk: [
|
|
|
- { required: true, message: "请输入开票员", trigger: "blur" },
|
|
|
- ],
|
|
|
- // taxExclusivePrice: [
|
|
|
- // { required: true, message: "请输入不含金额税", trigger: "blur" },
|
|
|
- // ],
|
|
|
- invoiceNum: [
|
|
|
- { required: true, message: "请输入开票号码", trigger: "blur" },
|
|
|
- ],
|
|
|
- subjectsId: [
|
|
|
- { required: true, message: "请选择开票科目", trigger: "change" },
|
|
|
- ],
|
|
|
- invoiceType: [
|
|
|
- { required: true, message: "请选择开票类型", trigger: "change" },
|
|
|
- ],
|
|
|
- invCompanyId: [
|
|
|
- { required: true, message: "请选择开票方", trigger: "change" },
|
|
|
- ],
|
|
|
- peerCompanyName: [
|
|
|
- { required: true, message: "请输入对方单位名称", trigger: "blur" },
|
|
|
- ],
|
|
|
- invoiceAmount: [{ required: true, trigger: "blur", validator: validateSz }],
|
|
|
- invoiceDate: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请选择开票日期",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
- invoiceQuantity: [{ required: true, trigger: "blur", validator: validateSz }],
|
|
|
- taxRate: [
|
|
|
- { required: true, message: "请输入", trigger: "blur" },
|
|
|
- ],
|
|
|
- },
|
|
|
- subjectsId: "", //科目ID
|
|
|
- invCompanyId: "", //开票方ID
|
|
|
- checkList: [], //选中的选项集合
|
|
|
- id: "", //每一项选中的id信息
|
|
|
- };
|
|
|
- },
|
|
|
- methods: {
|
|
|
- handleSearchList(data) {
|
|
|
- this.findPage(data)
|
|
|
- },
|
|
|
- // 输入进账金额触发方法
|
|
|
- incomeMoneyFun(val, index) {
|
|
|
- if (val && limitNumber(val) && this.dataCollection.profitPoint) {
|
|
|
- this.dataCollection.incomeList[index].outIncomeMoney = ((1 - Number(this.dataCollection.profitPoint)) * Number(this.dataCollection.incomeList[index].incomeMoney)).toFixed(2)
|
|
|
- }
|
|
|
- },
|
|
|
- //字典---
|
|
|
- subjectsFn() {
|
|
|
- let typeName = "subjects";
|
|
|
- this.$api.dict.findByLableName(typeName).then((res) => {
|
|
|
- this.subjectstList = res.data;
|
|
|
- });
|
|
|
- },
|
|
|
- incoiceType() {
|
|
|
- let typeName = "invoice_type";
|
|
|
- this.$api.dict.findByLableName(typeName).then((res) => {
|
|
|
- this.incoiceList = res.data;
|
|
|
- });
|
|
|
- },
|
|
|
- //--数据字典 end --
|
|
|
- // handleSearchList(data) {
|
|
|
- // this.findPage(data)
|
|
|
- // },
|
|
|
- findPage(data) {
|
|
|
- this.tableConfig.loading = true;
|
|
|
- this.$api.dict
|
|
|
- .queryPage({ ...this.pageData, ...data })
|
|
|
- .then((res) => {
|
|
|
- this.tableConfig.loading = false;
|
|
|
- this.pageResult = res.data.content;
|
|
|
- this.pageData.pageNum = res.data.pageNum;
|
|
|
- this.pageData.pageSize = res.data.pageSize;
|
|
|
- this.pageData.totalSize = res.data.totalSize;
|
|
|
-
|
|
|
- })
|
|
|
- },
|
|
|
- statusChange(e) {
|
|
|
- //状态选择事件
|
|
|
- // this.pageRequest.approvalStatus = e;
|
|
|
- // this.findPage();
|
|
|
- },
|
|
|
- //开票公司下拉框
|
|
|
- EnterpriseName() {
|
|
|
- this.$api.dict.companyFindList().then((res) => {
|
|
|
- this.invCompanyNameList = res.data;
|
|
|
- if (this.invCompanyNameList.length > 0) {
|
|
|
- this.invCompanyNameList = this.invCompanyNameList.filter(
|
|
|
- (item) =>
|
|
|
- item.enterpriseName != "" &&
|
|
|
- item.enterpriseName != null &&
|
|
|
- item.enterpriseName != undefined
|
|
|
- );
|
|
|
- this.dataform.invCompanyName = this.invCompanyNameList[0].id;
|
|
|
- } else {
|
|
|
- this.dataform.invCompanyName = "";
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- // 添加进账
|
|
|
- addIncome() {
|
|
|
- this.dataCollection.incomeList.push({
|
|
|
- incomeDate: '',
|
|
|
- incomeMoney: '',
|
|
|
- outIncomeDate: '',
|
|
|
- outIncomeMoney: ''
|
|
|
- })
|
|
|
-
|
|
|
- },
|
|
|
- deleteIncome(index) {
|
|
|
- this.$confirm('是否删除该数据?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- if (this.dataCollection.incomeList.length > 1) {
|
|
|
- this.dataCollection.incomeList.splice(index, 1)
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '删除成功!'
|
|
|
- });
|
|
|
- }
|
|
|
- else {
|
|
|
- this.$message.warning('至少添加一条数据!')
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- },
|
|
|
- //新增外部合同开票
|
|
|
- add() {
|
|
|
- if(this.$refs.dataform){
|
|
|
- this.$refs.dataform.resetFields();
|
|
|
- }
|
|
|
- this.nvoicingCategory = '1'
|
|
|
- this.dialogTitle = '新增发票信息'
|
|
|
- this.dataform = {}
|
|
|
- this.dialogFormVisible = true;
|
|
|
- this.isDisabled = false
|
|
|
- },
|
|
|
- //新增手续费开票
|
|
|
- addTwo() {
|
|
|
- if(this.$refs.dataform){
|
|
|
- this.$refs.dataform.resetFields();
|
|
|
- }
|
|
|
- this.nvoicingCategory = '2'
|
|
|
- this.dialogTitle = '新增发票信息'
|
|
|
- this.dataform = {
|
|
|
- invoiceDate:'',
|
|
|
- invCompanyId:'',
|
|
|
- subjectsId:'',
|
|
|
- invoiceType:''
|
|
|
- }
|
|
|
- this.dialogFormVisible = true;
|
|
|
- this.isDisabled = false
|
|
|
-
|
|
|
- },
|
|
|
- handleClose() {
|
|
|
- this.dialogFormVisible = false;
|
|
|
- },
|
|
|
-
|
|
|
- //取消
|
|
|
- resetForm() {
|
|
|
- this.dialogFormVisible = false;
|
|
|
- },
|
|
|
- provingChange(e, name) {
|
|
|
- // this.$forceUpdate();
|
|
|
- this.$delete(this.dataCollection, name)
|
|
|
- this.$set(this.dataCollection, name, e);
|
|
|
- },
|
|
|
- getInterface(jiekou) {
|
|
|
- if (this.dialogTitle == '新增发票信息' ||this.dialogTitle == '修改发票信息') {
|
|
|
- this.$refs["dataform"].validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- Number(this.dataform.taxExclusivePrice)
|
|
|
- Number(this.dataform.taxAmounts)
|
|
|
- jiekou({ invoiceInfo: this.dataform }).then((res) => {
|
|
|
- if (res.code == "200") {
|
|
|
- this.$message({ message: "添加成功!", type: "success" });
|
|
|
- this.dialogFormVisible = false;
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- message: `添加失败,请重新添加, ${res.msg}`,
|
|
|
- type: "error",
|
|
|
- });
|
|
|
- }
|
|
|
- this.findPage();
|
|
|
- });
|
|
|
- } else {
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- if (this.dialogTitle == "回款信息") {
|
|
|
- let invoiceInfo = { ...this.dataform, ...this.dataCollection }
|
|
|
- this.$api.dict.invoiceInfoSave({ invoiceInfo, invoiceInfoInOutList: this.dataCollection.incomeList }).then((res) => {
|
|
|
- if (res.code == "200") {
|
|
|
- this.$message({ message: "添加成功!", type: "success" });
|
|
|
- this.dialogFormVisible = false;
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- message: `添加失败,请重新添加, ${res.msg}`,
|
|
|
- type: "error",
|
|
|
- });
|
|
|
- }
|
|
|
- this.findPage();
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- //新增提交
|
|
|
- submitForm() {
|
|
|
- this.dataCollection.notOutMoney = this.notOutMoney
|
|
|
- this.dataCollection.notIncomeMoney = this.notIncomeMoney
|
|
|
- this.dataCollection.incomeList.forEach(val => val.id = this.dataform.id)
|
|
|
- if (this.nvoicingCategory == '1') {
|
|
|
- this.getInterface(this.$api.dict.saveTypeOne)
|
|
|
- }
|
|
|
- else {
|
|
|
- this.getInterface(this.$api.dict.saveTypeTwo)
|
|
|
- }
|
|
|
- },
|
|
|
- //选择开票科目传参文字
|
|
|
- changeDept(value) {
|
|
|
- this.subjectstList.forEach((item) => {
|
|
|
- if (item.value == value) {
|
|
|
- this.subjectsId = item.value;
|
|
|
- this.dataform.subjects = item.label;
|
|
|
- this.form.subjects = item.label;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- //发票类型
|
|
|
- invoiceChange(value) {
|
|
|
- this.incoiceList.forEach((item) => {
|
|
|
- if (item.value == value) {
|
|
|
- this.dataform.invoiceType = item.label;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- invoiceChange1(value) {
|
|
|
- this.incoiceList.forEach((item) => {
|
|
|
- if (item.value == value) {
|
|
|
- this.form.invoiceType = item.label;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- //弹出框-开票方
|
|
|
- invCompanyChange(value) {
|
|
|
- this.invCompanyNameList.forEach((item) => {
|
|
|
- if (item.id == value) {
|
|
|
- this.invCompanyId = item.id;
|
|
|
- this.dataform.invCompanyName = item.enterpriseName;
|
|
|
- this.form.invCompanyName = item.enterpriseName;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- //修改
|
|
|
- handleTableEdit(row) {
|
|
|
- if(this.$refs.dataform){
|
|
|
- this.$refs.dataform.resetFields();
|
|
|
- }
|
|
|
- this.dialogTitle = '修改发票信息'
|
|
|
- this.isDisabled = false
|
|
|
- this.isWholeDisabled = false
|
|
|
- this.dataform = { ...row };
|
|
|
- this.dialogFormVisible = true;
|
|
|
- },
|
|
|
- // 查看
|
|
|
- handleTableDetail(row) {
|
|
|
- this.dialogTitle = '查看发票信息'
|
|
|
- this.$api.dict.invDetails(row.id).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- if (res.data.invoiceInfoInOutList.length == 0) {
|
|
|
- res.data.invoiceInfoInOutList = [{
|
|
|
- incomeDate: '',
|
|
|
- incomeMoney: '',
|
|
|
- outIncomeDate: '',
|
|
|
- outIncomeMoney: ''
|
|
|
- }]
|
|
|
- }
|
|
|
- this.dataform = res.data.invoiceInfo
|
|
|
- this.dataCollection = res.data.invoiceInfo
|
|
|
- this.dataCollection.incomeList = res.data.invoiceInfoInOutList
|
|
|
- this.isDisabled = true
|
|
|
- this.isWholeDisabled = true
|
|
|
- this.dialogFormVisible = true;
|
|
|
- }
|
|
|
- else {
|
|
|
- this.$message.error(res.msg);
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- //删除
|
|
|
- handleTableDelete(row) {
|
|
|
-
|
|
|
- },
|
|
|
- // 添加回款
|
|
|
- addCollection(row) {
|
|
|
- this.$api.dict.invDetails(row.id).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- if (Object.keys(res.data.invoiceInfoInOutList).length === 0) {
|
|
|
- this.dataCollection = {
|
|
|
- ...res.data.invoiceInfo, incomeList: [{
|
|
|
- incomeDate: '',
|
|
|
- incomeMoney: '',
|
|
|
- outIncomeDate: '',
|
|
|
- outIncomeMoney: ''
|
|
|
- }]
|
|
|
- }
|
|
|
- }
|
|
|
- else {
|
|
|
- res.data.invoiceInfoInOutList.forEach(val => val.incomeMoney = val.incomeMoney + '')
|
|
|
- this.dataCollection = { ...res.data.invoiceInfo, incomeList: res.data.invoiceInfoInOutList }
|
|
|
- }
|
|
|
- this.dataform = res.data.invoiceInfo
|
|
|
- this.isDisabled = true
|
|
|
- this.isWholeDisabled = false
|
|
|
- this.dialogFormVisible = true;
|
|
|
- this.dialogTitle = '回款信息'
|
|
|
- }
|
|
|
- else {
|
|
|
- this.$message.error(res.msg);
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
-};
|
|
|
-</script>
|
|
|
-
|
|
|
-<style scoped>
|
|
|
-.el-input--suffix .el-input__inner {
|
|
|
- padding-right: 60px !important;
|
|
|
-}
|
|
|
-
|
|
|
-.operation {
|
|
|
- margin-left: 14px !important;
|
|
|
- margin-top: 15px !important;
|
|
|
-}
|
|
|
-
|
|
|
-.dialog-footer {
|
|
|
- margin-top: -20px !important;
|
|
|
-}
|
|
|
-
|
|
|
-.dialog .el-dialog__body {
|
|
|
- padding: 30px 20px 5px !important;
|
|
|
-}
|
|
|
-
|
|
|
-.form {
|
|
|
- display: flex;
|
|
|
- margin-left: -12px !important;
|
|
|
-}
|
|
|
-
|
|
|
-.el-pagination {
|
|
|
- font-weight: normal !important;
|
|
|
-}
|
|
|
-
|
|
|
-.footer {
|
|
|
- z-index: 500;
|
|
|
- position: fixed;
|
|
|
- margin: 10px 0;
|
|
|
- position: fixed;
|
|
|
- bottom: -9px;
|
|
|
- left: 210px;
|
|
|
- right: 25px;
|
|
|
- line-height: var(--footer-height);
|
|
|
- color: #fff;
|
|
|
-}
|
|
|
-
|
|
|
-.el-card__body {
|
|
|
- padding: 12px !important;
|
|
|
-}
|
|
|
-
|
|
|
-.footer .footerdiv {
|
|
|
- display: flex !important;
|
|
|
- align-items: center !important;
|
|
|
-}
|
|
|
-
|
|
|
-.frame .el-form-item {
|
|
|
- margin-bottom: 7px !important;
|
|
|
-}
|
|
|
-
|
|
|
-.form .el-form-item__label {
|
|
|
- font-size: 15px !important;
|
|
|
- font-weight: 600 !important;
|
|
|
-}
|
|
|
-
|
|
|
-.el-row {
|
|
|
- margin-top: 10px !important;
|
|
|
-}
|
|
|
-
|
|
|
-.el-textarea {
|
|
|
- margin-top: 10px !important;
|
|
|
-}
|
|
|
-
|
|
|
-.frame .el-form-item .el-input {
|
|
|
- width: 220px !important;
|
|
|
-}
|
|
|
-
|
|
|
-.frame .el-form-item .el-select {
|
|
|
- width: 220px !important;
|
|
|
-}
|
|
|
-</style>
|