|
|
@@ -1,24 +1,24 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<el-tabs type="border-card">
|
|
|
- <el-tab-pane label="用户管理">
|
|
|
- <el-form ref="form" :model="tableForm">
|
|
|
+ <el-tab-pane :label="item.orderNo" v-for="(item, index) in formTable" :key="index">
|
|
|
+ <el-form ref="form" :model="item">
|
|
|
<ele-pro-table
|
|
|
ref="table"
|
|
|
:needPage="false"
|
|
|
:columns="columns"
|
|
|
- :datasource="tableForm.detailList"
|
|
|
+ :datasource="item.detailList"
|
|
|
row-key="id"
|
|
|
class="time-form"
|
|
|
>
|
|
|
<template v-slot:toolbar>
|
|
|
- <span>本次开票合计:{{ invoiceAmount }}</span>
|
|
|
+ <span>本次开票合计:{{ item.amountTotalPrice }}</span>
|
|
|
</template>
|
|
|
|
|
|
- <template v-slot:totalCount="scope">
|
|
|
+ <template v-slot:invoiceAmount="scope">
|
|
|
<el-form-item
|
|
|
style="width: 100%;"
|
|
|
- :prop="'detailList.' + scope.$index + '.totalCount'"
|
|
|
+ :prop="'detailList.' + scope.$index + '.invoiceAmount'"
|
|
|
:rules="[
|
|
|
{
|
|
|
required: true,
|
|
|
@@ -39,8 +39,37 @@
|
|
|
}
|
|
|
]"
|
|
|
>
|
|
|
- <span v-if="dialogType === 'view'">{{ scope.row.totalCount }}</span>
|
|
|
- <el-input v-else v-model="scope.row.totalCount" type="number" @input="updateTotalPrice(scope.row)"></el-input>
|
|
|
+ <span v-if="dialogType === 'view'">{{ scope.row.invoiceAmount }}</span>
|
|
|
+ <el-input v-else v-model="scope.row.invoiceAmount" type="number" @input="updateTotalPrice(scope.row)"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:taxRate="scope">
|
|
|
+ <el-form-item
|
|
|
+ style="width: 100%;"
|
|
|
+ :prop="'detailList.' + scope.$index + '.taxRate'"
|
|
|
+ :rules="[
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请输入数量',
|
|
|
+ trigger: 'blur'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ if (value === undefined || value === null || value === '') {
|
|
|
+ callback('请输入数量');
|
|
|
+ } else if (parseFloat(value) <= 0) {
|
|
|
+ callback('数量必须大于0');
|
|
|
+ } else {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ]"
|
|
|
+ >
|
|
|
+ <span v-if="dialogType === 'view'">{{ scope.row.taxRate }}</span>
|
|
|
+ <el-input v-else v-model="scope.row.taxRate" type="number" @input="updateTotalPrice(scope.row)"></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
|
|
|
@@ -146,9 +175,9 @@
|
|
|
},
|
|
|
{
|
|
|
width: 100,
|
|
|
- prop: 'productBrand',
|
|
|
+ prop: 'unInvoiceAmount',
|
|
|
label: '未开票金额',
|
|
|
- slot: 'productBrand',
|
|
|
+ slot: 'unInvoiceAmount',
|
|
|
align: "center"
|
|
|
},
|
|
|
|
|
|
@@ -160,28 +189,29 @@
|
|
|
// },
|
|
|
|
|
|
{
|
|
|
- minWidth: 80,
|
|
|
- prop: 'totalPrice',
|
|
|
+ minWidth: 150,
|
|
|
+ prop: 'invoiceAmount',
|
|
|
label: '开票金额',
|
|
|
- slot: 'totalPrice',
|
|
|
+ slot: 'invoiceAmount',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
- minWidth: 80,
|
|
|
+ minWidth: 150,
|
|
|
prop: 'taxRate',
|
|
|
label: '税率',
|
|
|
align: 'center',
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
- return _row.taxRate
|
|
|
- ? _row.taxRate+'%'
|
|
|
- : '';
|
|
|
- },
|
|
|
+ slot: 'taxRate',
|
|
|
+ // formatter: (_row, _column, cellValue) => {
|
|
|
+ // return _row.taxRate
|
|
|
+ // ? _row.taxRate+'%'
|
|
|
+ // : '';
|
|
|
+ // },
|
|
|
},
|
|
|
{
|
|
|
- minWidth: 80,
|
|
|
- prop: 'discountSinglePrice',
|
|
|
+ minWidth: 100,
|
|
|
+ prop: 'discountTaxPrice',
|
|
|
label: '不含税单价',
|
|
|
- slot: 'discountSinglePrice',
|
|
|
+ slot: 'discountTaxPrice',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
@@ -247,8 +277,159 @@
|
|
|
// }
|
|
|
// },
|
|
|
],
|
|
|
+ formTable: [
|
|
|
+ {
|
|
|
+ orderNo: 'DZD202401001', // 对账单编号
|
|
|
+ amountCompletePrice: 30000.00, // 已对账金额
|
|
|
+ amountUnCompletePrice: 20000.00, // 未对账金额
|
|
|
+ amountTotalPrice: 50000.00, // 本次对账总金额
|
|
|
+ detailList: [
|
|
|
+ {
|
|
|
+ id: 1,
|
|
|
+ type: '10', // 销售发货
|
|
|
+ typeName: '销售发货',
|
|
|
+ sourceCode: 'DZD202401001', // 对账单编号
|
|
|
+ sourceId: '123456',
|
|
|
+ sourceType: 2, // 销售对账单
|
|
|
+ productName: '工业传感器', // 产品名称
|
|
|
+ modelType: 'GS-2000', // 型号
|
|
|
+ specification: '高精度型', // 规格
|
|
|
+ productBrand: '西门子', // 品牌(未开票金额显示)
|
|
|
+ unInvoiceAmount: 15000.00, // 未开票金额
|
|
|
+ singlePrice: 1500.00, // 单价
|
|
|
+ totalCount: 10, // 订单数量
|
|
|
+ totalPrice: 15000.00, // 开票金额/合计
|
|
|
+ taxRate: 13, // 税率
|
|
|
+ discountTaxPrice: 1327.43, // 不含税单价
|
|
|
+ discountSinglePrice: 1327.43, // 折让单价
|
|
|
+ discountRate: 0, // 折让比例
|
|
|
+ discountTotalPrice: 13274.32, // 折让合计
|
|
|
+ pricingWay: 1 // 按数量计价
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 2,
|
|
|
+ type: '10',
|
|
|
+ typeName: '销售发货',
|
|
|
+ sourceCode: 'DZD202401001',
|
|
|
+ sourceId: '123456',
|
|
|
+ sourceType: 2,
|
|
|
+ productName: '控制阀门',
|
|
|
+ modelType: 'FV-500',
|
|
|
+ specification: 'DN50',
|
|
|
+ productBrand: 'ABB',
|
|
|
+ unInvoiceAmount: 15000.00, // 未开票金额
|
|
|
+ singlePrice: 2800.00,
|
|
|
+ totalCount: 5,
|
|
|
+ totalPrice: 14000.00,
|
|
|
+ taxRate: 13,
|
|
|
+ discountTaxPrice: 2477.88,
|
|
|
+ discountSinglePrice: 2477.88,
|
|
|
+ discountRate: 0,
|
|
|
+ discountTotalPrice: 12389.38,
|
|
|
+ pricingWay: 1
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ orderNo: 'DZD202401002', // 对账单编号
|
|
|
+ amountCompletePrice: 30000.00, // 已对账金额
|
|
|
+ amountUnCompletePrice: 20000.00, // 未对账金额
|
|
|
+ amountTotalPrice: 50000.00, // 本次对账总金额
|
|
|
+ detailList: [
|
|
|
+ {
|
|
|
+ id: 3,
|
|
|
+ type: '10',
|
|
|
+ typeName: '销售发货',
|
|
|
+ sourceCode: 'DZD202401001',
|
|
|
+ sourceId: '123456',
|
|
|
+ sourceType: 2,
|
|
|
+ productName: '变频器',
|
|
|
+ modelType: 'VFD-30K',
|
|
|
+ specification: '30KW',
|
|
|
+ productBrand: '施耐德',
|
|
|
+ unInvoiceAmount: 15000.00, // 未开票金额
|
|
|
+ singlePrice: 5500.00,
|
|
|
+ totalCount: 2,
|
|
|
+ totalPrice: 11000.00,
|
|
|
+ taxRate: 13,
|
|
|
+ discountTaxPrice: 4867.26,
|
|
|
+ discountSinglePrice: 4867.26,
|
|
|
+ discountRate: 0,
|
|
|
+ discountTotalPrice: 9734.51,
|
|
|
+ pricingWay: 1
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ],
|
|
|
tableForm: {
|
|
|
- detailList: [],
|
|
|
+ detailList: [
|
|
|
+ {
|
|
|
+ id: 1,
|
|
|
+ type: '10', // 销售发货
|
|
|
+ typeName: '销售发货',
|
|
|
+ sourceCode: 'DZD202401001', // 对账单编号
|
|
|
+ sourceId: '123456',
|
|
|
+ sourceType: 2, // 销售对账单
|
|
|
+ productName: '工业传感器', // 产品名称
|
|
|
+ modelType: 'GS-2000', // 型号
|
|
|
+ specification: '高精度型', // 规格
|
|
|
+ productBrand: '西门子', // 品牌(未开票金额显示)
|
|
|
+ unInvoiceAmount: 15000.00, // 未开票金额
|
|
|
+ singlePrice: 1500.00, // 单价
|
|
|
+ totalCount: 10, // 订单数量
|
|
|
+ totalPrice: 15000.00, // 开票金额/合计
|
|
|
+ taxRate: 13, // 税率
|
|
|
+ discountTaxPrice: 1327.43, // 不含税单价
|
|
|
+ discountSinglePrice: 1327.43, // 折让单价
|
|
|
+ discountRate: 0, // 折让比例
|
|
|
+ discountTotalPrice: 13274.32, // 折让合计
|
|
|
+ pricingWay: 1 // 按数量计价
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 2,
|
|
|
+ type: '10',
|
|
|
+ typeName: '销售发货',
|
|
|
+ sourceCode: 'DZD202401001',
|
|
|
+ sourceId: '123456',
|
|
|
+ sourceType: 2,
|
|
|
+ productName: '控制阀门',
|
|
|
+ modelType: 'FV-500',
|
|
|
+ specification: 'DN50',
|
|
|
+ productBrand: 'ABB',
|
|
|
+ unInvoiceAmount: 15000.00, // 未开票金额
|
|
|
+ singlePrice: 2800.00,
|
|
|
+ totalCount: 5,
|
|
|
+ totalPrice: 14000.00,
|
|
|
+ taxRate: 13,
|
|
|
+ discountTaxPrice: 2477.88,
|
|
|
+ discountSinglePrice: 2477.88,
|
|
|
+ discountRate: 0,
|
|
|
+ discountTotalPrice: 12389.38,
|
|
|
+ pricingWay: 1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 3,
|
|
|
+ type: '10',
|
|
|
+ typeName: '销售发货',
|
|
|
+ sourceCode: 'DZD202401001',
|
|
|
+ sourceId: '123456',
|
|
|
+ sourceType: 2,
|
|
|
+ productName: '变频器',
|
|
|
+ modelType: 'VFD-30K',
|
|
|
+ specification: '30KW',
|
|
|
+ productBrand: '施耐德',
|
|
|
+ unInvoiceAmount: 15000.00, // 未开票金额
|
|
|
+ singlePrice: 5500.00,
|
|
|
+ totalCount: 2,
|
|
|
+ totalPrice: 11000.00,
|
|
|
+ taxRate: 13,
|
|
|
+ discountTaxPrice: 4867.26,
|
|
|
+ discountSinglePrice: 4867.26,
|
|
|
+ discountRate: 0,
|
|
|
+ discountTotalPrice: 9734.51,
|
|
|
+ pricingWay: 1
|
|
|
+ }
|
|
|
+ ],
|
|
|
link: []
|
|
|
},
|
|
|
typeList: [
|
|
|
@@ -272,14 +453,30 @@
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.tableForm = this.form;
|
|
|
+ // this.tableForm = this.form;
|
|
|
},
|
|
|
watch: {
|
|
|
form(val) {
|
|
|
- this.tableForm = this.form;
|
|
|
+ // this.tableForm = this.form;
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ //计算不含税单价
|
|
|
+ getNotaxSinglePrice() {
|
|
|
+ this.tableForm.detailList.forEach((item, index) => {
|
|
|
+ if (item.singlePrice && item.taxRate) {
|
|
|
+ this.$set(
|
|
|
+ this.form.detailList[index],
|
|
|
+ 'notaxSinglePrice',
|
|
|
+ parseFloat(
|
|
|
+ (item.singlePrice / (1 + item.taxRate / 100)).toFixed(2)
|
|
|
+ )
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ this.$set(this.form.detailList[index], 'notaxSinglePrice', '');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
//获取选择的对账单数据
|
|
|
async getAccountData(params) {
|
|
|
if (params.children.orderType == 6) {
|
|
|
@@ -326,7 +523,7 @@
|
|
|
this.setSelectData(row);
|
|
|
},
|
|
|
setValue(data) {
|
|
|
- this.tableForm.detailList = data;
|
|
|
+ // this.tableForm.detailList = data;
|
|
|
},
|
|
|
clearTable() {
|
|
|
this.tableForm = {
|