|
|
@@ -681,7 +681,11 @@
|
|
|
<!-- 生产加工类型特有列的模板 -->
|
|
|
<template v-slot:thickNess="{ row, $index }">
|
|
|
<el-form-item :prop="'datasource.' + $index + '.thickNess'">
|
|
|
- <el-input v-model="row.thickNess" placeholder="请输入">
|
|
|
+ <el-input
|
|
|
+ v-model="row.thickNess"
|
|
|
+ placeholder="请输入"
|
|
|
+ @input="calculateIncludingTaxPrice(row, $index)"
|
|
|
+ >
|
|
|
<template slot="append">mm</template></el-input
|
|
|
>
|
|
|
</el-form-item>
|
|
|
@@ -689,7 +693,11 @@
|
|
|
|
|
|
<template v-slot:squareNumber="{ row, $index }">
|
|
|
<el-form-item :prop="'datasource.' + $index + '.squareNumber'">
|
|
|
- <el-input v-model="row.squareNumber" placeholder="请输入">
|
|
|
+ <el-input
|
|
|
+ v-model="row.squareNumber"
|
|
|
+ placeholder="请输入"
|
|
|
+ @input="calculateIncludingTaxPrice(row, $index)"
|
|
|
+ >
|
|
|
<template slot="append">m²</template></el-input
|
|
|
>
|
|
|
</el-form-item>
|
|
|
@@ -738,17 +746,19 @@
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
|
|
|
- <!-- 新增未税小记列模板 -->
|
|
|
+ <!-- 未税小计列模板 -->
|
|
|
<template v-slot:untaxedSubtotal="{ row, $index }">
|
|
|
- <el-form-item :prop="'datasource.' + $index + '.untaxedSubtotal'">
|
|
|
- {{ (Number(row.untaxedSubtotal) || 0).toFixed(2) }}元
|
|
|
+ <el-form-item
|
|
|
+ :prop="'datasource.' + $index + '.quotationSubtotalBeforeTax'"
|
|
|
+ >
|
|
|
+ {{ (Number(row.quotationSubtotalBeforeTax) || 0).toFixed(2) }}元
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
|
|
|
- <template v-slot:additionalTaxRate="{ row, $index }">
|
|
|
- <el-form-item :prop="'datasource.' + $index + '.additionalTaxRate'">
|
|
|
+ <template v-slot:extraTax="{ row, $index }">
|
|
|
+ <el-form-item :prop="'datasource.' + $index + '.extraTax'">
|
|
|
<el-input
|
|
|
- v-model="row.additionalTaxRate"
|
|
|
+ v-model="row.extraTax"
|
|
|
type="number"
|
|
|
placeholder="请输入"
|
|
|
@input="calculateIncludingTaxPrice(row, $index)"
|
|
|
@@ -758,13 +768,14 @@
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
|
|
|
- <!-- 含税单价改为含税小计 -->
|
|
|
- <template v-slot:includingTaxPrice="{ row, $index }">
|
|
|
- <el-form-item :prop="'datasource.' + $index + '.includingTaxPrice'">
|
|
|
+ <!-- 含税小计模板 -->
|
|
|
+ <template v-slot:quotationSubtotalTax="{ row, $index }">
|
|
|
+ <el-form-item :prop="'datasource.' + $index + '.quotationSubtotalTax'">
|
|
|
<el-input
|
|
|
- v-model="row.includingTaxPrice"
|
|
|
+ v-model="row.quotationSubtotalTax"
|
|
|
type="number"
|
|
|
placeholder="请输入"
|
|
|
+ @input="onQuotationSubtotalTaxChange(row, $index)"
|
|
|
>
|
|
|
<template slot="append">元</template>
|
|
|
</el-input>
|
|
|
@@ -1011,10 +1022,10 @@ export default {
|
|
|
processingFeeBeforeTax: '',
|
|
|
packagingFeeNotTaxed: '',
|
|
|
transportationFeeWithoutTax: '',
|
|
|
- additionalTaxRate: '',
|
|
|
- includingTaxPrice: '',
|
|
|
- // 新增未税小记字段
|
|
|
- untaxedSubtotal: ''
|
|
|
+ extraTax: '', // 税率(%)
|
|
|
+ quotationSubtotalTax: '', // 含税小计
|
|
|
+ // 未税小记字段
|
|
|
+ quotationSubtotalBeforeTax: '' // 未税小计
|
|
|
};
|
|
|
return {
|
|
|
levelList,
|
|
|
@@ -1070,7 +1081,6 @@ export default {
|
|
|
fixed: 'left'
|
|
|
},
|
|
|
{
|
|
|
- label: '选择',
|
|
|
width: 45,
|
|
|
type: 'selection',
|
|
|
columnKey: 'selection',
|
|
|
@@ -1154,21 +1164,6 @@ export default {
|
|
|
slot: 'squareNumber',
|
|
|
align: 'center'
|
|
|
},
|
|
|
- {
|
|
|
- width: 120,
|
|
|
- prop: 'singleWeight',
|
|
|
- label: '单重',
|
|
|
- slot: 'singleWeight',
|
|
|
- headerSlot: 'headerSingleWeight',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- width: 120,
|
|
|
- prop: 'weightUnit',
|
|
|
- label: '重量单位',
|
|
|
- slot: 'weightUnit',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
{
|
|
|
width: 150,
|
|
|
prop: 'processingFeeBeforeTax',
|
|
|
@@ -1192,23 +1187,23 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
width: 150,
|
|
|
- prop: 'untaxedSubtotal',
|
|
|
+ prop: 'quotationSubtotalBeforeTax',
|
|
|
label: '未税小计',
|
|
|
- slot: 'additionalTaxRate_untaxed',
|
|
|
+ slot: 'untaxedSubtotal',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
width: 150,
|
|
|
- prop: 'additionalTaxRate',
|
|
|
+ prop: 'extraTax',
|
|
|
label: '税率(%)',
|
|
|
- slot: 'additionalTaxRate',
|
|
|
+ slot: 'extraTax',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
width: 150,
|
|
|
- prop: 'includingTaxPrice',
|
|
|
+ prop: 'quotationSubtotalTax',
|
|
|
label: '含税小计',
|
|
|
- slot: 'includingTaxPrice',
|
|
|
+ slot: 'quotationSubtotalTax',
|
|
|
align: 'center'
|
|
|
}
|
|
|
);
|
|
|
@@ -1225,6 +1220,22 @@ export default {
|
|
|
this.isDate == 1 ? 'headerCustomerExpectDeliveryDeadline' : '',
|
|
|
align: 'center'
|
|
|
},
|
|
|
+
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'singleWeight',
|
|
|
+ label: '单重',
|
|
|
+ slot: 'singleWeight',
|
|
|
+ headerSlot: 'headerSingleWeight',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ prop: 'weightUnit',
|
|
|
+ label: '重量单位',
|
|
|
+ slot: 'weightUnit',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
{
|
|
|
minWidth: 120,
|
|
|
prop: 'goodsLevel',
|
|
|
@@ -1568,20 +1579,20 @@ export default {
|
|
|
'form.datasource',
|
|
|
(newVal) => {
|
|
|
newVal.forEach((row, index) => {
|
|
|
- // 为每个行项目添加监听器
|
|
|
this.$watch(
|
|
|
() => [
|
|
|
row.processingFeeBeforeTax,
|
|
|
row.packagingFeeNotTaxed,
|
|
|
row.transportationFeeWithoutTax,
|
|
|
- row.additionalTaxRate,
|
|
|
- row[this.countObj.countKey]
|
|
|
+ row.extraTax,
|
|
|
+ row[this.countObj.countKey], // 显式监听数量字段
|
|
|
+ row.quotationSubtotalTax // 监听手动修改的含税小计
|
|
|
],
|
|
|
() => {
|
|
|
this.calculateIncludingTaxPrice(row, index);
|
|
|
- this.changeAll(); // 更新总价
|
|
|
+ this.changeAll();
|
|
|
},
|
|
|
- { deep: true }
|
|
|
+ { deep: true, immediate: true } // 立即执行一次
|
|
|
);
|
|
|
});
|
|
|
},
|
|
|
@@ -1716,6 +1727,16 @@ export default {
|
|
|
v.customerReqFiles = v.customerReqFiles || [];
|
|
|
v.industryArtFiles = v.industryArtFiles || [];
|
|
|
v.otherFiles = v.otherFiles || [];
|
|
|
+
|
|
|
+ // 确保接口所需字段存在
|
|
|
+ v.quotationSubtotalBeforeTax = v.quotationSubtotalBeforeTax || '0.00';
|
|
|
+ v.quotationSubtotalTax = v.quotationSubtotalTax || '0.00';
|
|
|
+ v.extraTax = v.extraTax || 0;
|
|
|
+
|
|
|
+ // 删除旧字段
|
|
|
+ delete v.untaxedSubtotal;
|
|
|
+ delete v.includingTaxPrice;
|
|
|
+ delete v.additionalTaxRate;
|
|
|
});
|
|
|
return comitDatasource;
|
|
|
},
|
|
|
@@ -1750,31 +1771,47 @@ export default {
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
|
|
|
- // 计算含税小计(原含税单价逻辑)
|
|
|
+ // 含税小计手动修改时触发
|
|
|
+ onQuotationSubtotalTaxChange(row, index) {
|
|
|
+ // 计算总价
|
|
|
+ if (row[this.countObj.countKey]) {
|
|
|
+ const totalPrice =
|
|
|
+ Number(row.quotationSubtotalTax) *
|
|
|
+ Number(row[this.countObj.countKey]);
|
|
|
+ this.$set(row, 'totalPrice', totalPrice.toFixed(2));
|
|
|
+ }
|
|
|
+ this.changeAll(); // 更新总价
|
|
|
+ },
|
|
|
+
|
|
|
+ // 计算含税小计
|
|
|
calculateIncludingTaxPrice(row, index) {
|
|
|
if (!row) return;
|
|
|
|
|
|
// 计算各项费用总和(加工费 + 包装费 + 运输费)作为未税小记
|
|
|
- const untaxedSubtotal =
|
|
|
+ const quotationSubtotalBeforeTax =
|
|
|
(Number(row.processingFeeBeforeTax) || 0) +
|
|
|
(Number(row.packagingFeeNotTaxed) || 0) +
|
|
|
(Number(row.transportationFeeWithoutTax) || 0);
|
|
|
|
|
|
// 设置未税小记的值
|
|
|
- this.$set(row, 'untaxedSubtotal', untaxedSubtotal.toFixed(2));
|
|
|
+ this.$set(
|
|
|
+ row,
|
|
|
+ 'quotationSubtotalBeforeTax',
|
|
|
+ quotationSubtotalBeforeTax.toFixed(2)
|
|
|
+ );
|
|
|
|
|
|
// 计算额外税率(将百分比转换为小数)
|
|
|
- const taxRate = (Number(row.additionalTaxRate) || 0) / 100;
|
|
|
+ const taxRate = (Number(row.extraTax) || 0) / 100;
|
|
|
|
|
|
// 计算含税小计 = 未税小记 * (1 + 额外税率)
|
|
|
- const includingTaxPrice = untaxedSubtotal * (1 + taxRate);
|
|
|
+ const quotationSubtotalTax = quotationSubtotalBeforeTax * (1 + taxRate);
|
|
|
|
|
|
- this.$set(row, 'includingTaxPrice', includingTaxPrice.toFixed(2));
|
|
|
+ this.$set(row, 'quotationSubtotalTax', quotationSubtotalTax.toFixed(2));
|
|
|
|
|
|
// 更新总价
|
|
|
if (row[this.countObj.countKey]) {
|
|
|
const totalPrice =
|
|
|
- includingTaxPrice * Number(row[this.countObj.countKey]);
|
|
|
+ quotationSubtotalTax * Number(row[this.countObj.countKey]);
|
|
|
this.$set(row, 'totalPrice', totalPrice.toFixed(2));
|
|
|
}
|
|
|
},
|
|
|
@@ -1907,7 +1944,7 @@ export default {
|
|
|
item[this.countObj.countKey] = 1;
|
|
|
}
|
|
|
|
|
|
- // 初始化生产加工特有字段及未税小记
|
|
|
+ // 初始化生产加工特有字段及未税小记、含税小计和税率
|
|
|
if (this.quoteType === 2) {
|
|
|
item.thickNess = item.thickNess || '';
|
|
|
item.squareNumber = item.squareNumber || '';
|
|
|
@@ -1915,14 +1952,23 @@ export default {
|
|
|
item.packagingFeeNotTaxed = item.packagingFeeNotTaxed || '';
|
|
|
item.transportationFeeWithoutTax =
|
|
|
item.transportationFeeWithoutTax || '';
|
|
|
- item.additionalTaxRate = item.additionalTaxRate || '';
|
|
|
+ // 映射旧税率字段到新字段
|
|
|
+ item.extraTax = item.additionalTaxRate || 13;
|
|
|
+ this.calculateIncludingTaxPrice(item, index);
|
|
|
// 计算未税小记
|
|
|
- const untaxedSubtotal =
|
|
|
+ const quotationSubtotalBeforeTax =
|
|
|
(Number(item.processingFeeBeforeTax) || 0) +
|
|
|
(Number(item.packagingFeeNotTaxed) || 0) +
|
|
|
(Number(item.transportationFeeWithoutTax) || 0);
|
|
|
- item.untaxedSubtotal = untaxedSubtotal.toFixed(2);
|
|
|
- item.includingTaxPrice = item.includingTaxPrice || '';
|
|
|
+ item.quotationSubtotalBeforeTax =
|
|
|
+ quotationSubtotalBeforeTax.toFixed(2);
|
|
|
+ // 映射旧含税单价字段到新含税小计字段
|
|
|
+ item.quotationSubtotalTax = item.includingTaxPrice || '';
|
|
|
+
|
|
|
+ // 删除旧字段
|
|
|
+ delete item.untaxedSubtotal;
|
|
|
+ delete item.includingTaxPrice;
|
|
|
+ delete item.additionalTaxRate;
|
|
|
}
|
|
|
});
|
|
|
this.form.datasource = productList;
|
|
|
@@ -2081,6 +2127,18 @@ export default {
|
|
|
this.$set(parasm, this.countObj.countKey, 1);
|
|
|
}
|
|
|
|
|
|
+ // 初始化生产加工特有字段及未税小记、含税小计和税率
|
|
|
+ if (this.quoteType === 2) {
|
|
|
+ parasm.thickNess = '';
|
|
|
+ parasm.squareNumber = '';
|
|
|
+ parasm.processingFeeBeforeTax = '';
|
|
|
+ parasm.packagingFeeNotTaxed = '';
|
|
|
+ parasm.transportationFeeWithoutTax = '';
|
|
|
+ parasm.extraTax = 13;
|
|
|
+ parasm.quotationSubtotalBeforeTax = '0.00';
|
|
|
+ parasm.quotationSubtotalTax = '';
|
|
|
+ }
|
|
|
+
|
|
|
if (this.isSupplier) {
|
|
|
this.$set(
|
|
|
parasm,
|
|
|
@@ -2105,18 +2163,6 @@ export default {
|
|
|
}
|
|
|
this.$set(parasm, 'provenance', item.purchaseOrigins || []);
|
|
|
|
|
|
- // 初始化生产加工特有字段及未税小记
|
|
|
- if (this.quoteType === 2) {
|
|
|
- parasm.thickNess = '';
|
|
|
- parasm.squareNumber = '';
|
|
|
- parasm.processingFeeBeforeTax = '';
|
|
|
- parasm.packagingFeeNotTaxed = '';
|
|
|
- parasm.transportationFeeWithoutTax = '';
|
|
|
- parasm.additionalTaxRate = 13;
|
|
|
- parasm.untaxedSubtotal = '0.00';
|
|
|
- parasm.includingTaxPrice = '';
|
|
|
- }
|
|
|
-
|
|
|
if (idx == -1) {
|
|
|
this.form.datasource.push(row);
|
|
|
}
|
|
|
@@ -2218,16 +2264,16 @@ export default {
|
|
|
this.$set(parasm, this.countObj.countKey, 1);
|
|
|
}
|
|
|
|
|
|
- // 初始化生产加工特有字段及未税小记
|
|
|
+ // 初始化生产加工特有字段及未税小记、含税小计和税率
|
|
|
if (this.quoteType === 2) {
|
|
|
parasm.thickNess = '';
|
|
|
parasm.squareNumber = '';
|
|
|
parasm.processingFeeBeforeTax = '';
|
|
|
parasm.packagingFeeNotTaxed = '';
|
|
|
parasm.transportationFeeWithoutTax = '';
|
|
|
- parasm.additionalTaxRate = '';
|
|
|
- parasm.untaxedSubtotal = '0.00';
|
|
|
- parasm.includingTaxPrice = '';
|
|
|
+ parasm.extraTax = '';
|
|
|
+ parasm.quotationSubtotalBeforeTax = '0.00';
|
|
|
+ parasm.quotationSubtotalTax = '';
|
|
|
}
|
|
|
|
|
|
if (idx == -1) {
|
|
|
@@ -2258,16 +2304,16 @@ export default {
|
|
|
item[this.countObj.countKey] = 1;
|
|
|
}
|
|
|
|
|
|
- // 初始化生产加工特有字段及未税小记
|
|
|
+ // 初始化生产加工特有字段及未税小记、含税小计和税率
|
|
|
if (this.quoteType === 2) {
|
|
|
item.thickNess = '';
|
|
|
item.squareNumber = '';
|
|
|
item.processingFeeBeforeTax = '';
|
|
|
item.packagingFeeNotTaxed = '';
|
|
|
item.transportationFeeWithoutTax = '';
|
|
|
- item.additionalTaxRate = '';
|
|
|
- item.untaxedSubtotal = '0.00';
|
|
|
- item.includingTaxPrice = '';
|
|
|
+ item.extraTax = '';
|
|
|
+ item.quotationSubtotalBeforeTax = '0.00';
|
|
|
+ item.quotationSubtotalTax = '';
|
|
|
}
|
|
|
|
|
|
this.form.datasource.push(item);
|