|
@@ -148,7 +148,7 @@
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="unit" label="单位" width="100" :formatter="(row) => dictValueLabel(row.unit, productUnit)" />
|
|
<el-table-column prop="unit" label="单位" width="100" :formatter="(row) => dictValueLabel(row.unit, productUnit)" />
|
|
- <el-table-column label="数量" width="150">
|
|
|
|
|
|
+ <el-table-column label="数量" width="160">
|
|
<template #default="{ row, $index }">
|
|
<template #default="{ row, $index }">
|
|
<div style="width: 100%">
|
|
<div style="width: 100%">
|
|
<el-form-item :prop="'contractProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true">
|
|
<el-form-item :prop="'contractProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true">
|
|
@@ -159,7 +159,11 @@
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
:controls="false"
|
|
:controls="false"
|
|
:min="0"
|
|
:min="0"
|
|
- @change="calculationAmount" />
|
|
|
|
|
|
+ @change="
|
|
|
|
+ () => {
|
|
|
|
+ return calculationAmount('contractProductList', $index, 'quantity');
|
|
|
|
+ }
|
|
|
|
+ " />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -175,7 +179,11 @@
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
:controls="false"
|
|
:controls="false"
|
|
:min="0"
|
|
:min="0"
|
|
- @change="calculationAmount" />
|
|
|
|
|
|
+ @change="
|
|
|
|
+ () => {
|
|
|
|
+ return calculationAmount('contractProductList', $index, 'price');
|
|
|
|
+ }
|
|
|
|
+ " />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -212,10 +220,13 @@
|
|
v-model="row.amount"
|
|
v-model="row.amount"
|
|
placeholder="请输入金额"
|
|
placeholder="请输入金额"
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
- :precision="2"
|
|
|
|
:controls="false"
|
|
:controls="false"
|
|
:min="0"
|
|
:min="0"
|
|
- @change="totalAmount()" />
|
|
|
|
|
|
+ @change="
|
|
|
|
+ () => {
|
|
|
|
+ return totalAmount('contractProjectList', $index, 'amount');
|
|
|
|
+ }
|
|
|
|
+ " />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -252,18 +263,6 @@
|
|
<el-input v-model="formData.data.amount" placeholder="合同总金额" disabled />
|
|
<el-input v-model="formData.data.amount" placeholder="合同总金额" disabled />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
- <!-- <el-col :span="4">
|
|
|
|
- <el-form-item label="报价有效期 (天)" prop="effective">
|
|
|
|
- <el-input-number onmousewheel="return false;"
|
|
|
|
- v-model="formData.data.effective"
|
|
|
|
- placeholder="请输入有效期"
|
|
|
|
- style="width: 100%"
|
|
|
|
- :precision="0"
|
|
|
|
- :controls="false"
|
|
|
|
- :min="0"
|
|
|
|
- />
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col> -->
|
|
|
|
</el-row>
|
|
</el-row>
|
|
<el-row style="margin-top: 20px; width: 100%">
|
|
<el-row style="margin-top: 20px; width: 100%">
|
|
<el-col :span="7">
|
|
<el-col :span="7">
|
|
@@ -373,7 +372,6 @@
|
|
<el-row style="margin-top: 20px; width: 100%">
|
|
<el-row style="margin-top: 20px; width: 100%">
|
|
<el-col :span="7">
|
|
<el-col :span="7">
|
|
<el-form-item label="交货期限 (天)" prop="deliveryTime">
|
|
<el-form-item label="交货期限 (天)" prop="deliveryTime">
|
|
- <!-- <el-date-picker v-model="formData.data.deliveryTime" type="date" placeholder="请选择交货期限" value-format="YYYY-MM-DD" /> -->
|
|
|
|
<el-input-number
|
|
<el-input-number
|
|
onmousewheel="return false;"
|
|
onmousewheel="return false;"
|
|
v-model="formData.data.deliveryTime"
|
|
v-model="formData.data.deliveryTime"
|
|
@@ -424,7 +422,11 @@
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
:controls="false"
|
|
:controls="false"
|
|
:min="0"
|
|
:min="0"
|
|
- @change="calculationAmount" />
|
|
|
|
|
|
+ @change="
|
|
|
|
+ () => {
|
|
|
|
+ return calculationAmount('contractShipmentList', $index, 'quantity');
|
|
|
|
+ }
|
|
|
|
+ " />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -1112,14 +1114,18 @@ const handleRemove = async (index, row) => {
|
|
totalAmount();
|
|
totalAmount();
|
|
getDecisionAids();
|
|
getDecisionAids();
|
|
};
|
|
};
|
|
-const calculationAmount = (val) => {
|
|
|
|
- console.log(val, "aaa");
|
|
|
|
|
|
+const calculationAmount = (listLabel, index, label) => {
|
|
|
|
+ if (formData.data[listLabel][index][label]) {
|
|
|
|
+ formData.data[listLabel][index][label] = Number(Math.round(Number(formData.data[listLabel][index][label]) * 10000) / 10000);
|
|
|
|
+ }
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
if (formData.data.contractProductList && formData.data.contractProductList.length > 0) {
|
|
if (formData.data.contractProductList && formData.data.contractProductList.length > 0) {
|
|
for (let i = 0; i < formData.data.contractProductList.length; i++) {
|
|
for (let i = 0; i < formData.data.contractProductList.length; i++) {
|
|
let money = 0;
|
|
let money = 0;
|
|
if (formData.data.contractProductList[i].quantity && formData.data.contractProductList[i].price) {
|
|
if (formData.data.contractProductList[i].quantity && formData.data.contractProductList[i].price) {
|
|
- money = parseFloat(Number(formData.data.contractProductList[i].quantity) * Number(formData.data.contractProductList[i].price)).toFixed(4);
|
|
|
|
|
|
+ money = Number(
|
|
|
|
+ Math.round(Number(formData.data.contractProductList[i].quantity) * Number(formData.data.contractProductList[i].price) * 10000) / 10000
|
|
|
|
+ );
|
|
}
|
|
}
|
|
formData.data.contractProductList[i].amount = money;
|
|
formData.data.contractProductList[i].amount = money;
|
|
}
|
|
}
|
|
@@ -1129,19 +1135,22 @@ const calculationAmount = (val) => {
|
|
});
|
|
});
|
|
});
|
|
});
|
|
};
|
|
};
|
|
-const totalAmount = () => {
|
|
|
|
|
|
+const totalAmount = (listLabel, index, label) => {
|
|
|
|
+ if (listLabel && formData.data[listLabel][index][label]) {
|
|
|
|
+ formData.data[listLabel][index][label] = Number(Math.round(Number(formData.data[listLabel][index][label]) * 10000) / 10000);
|
|
|
|
+ }
|
|
let money = 0;
|
|
let money = 0;
|
|
if (formData.data.contractProductList && formData.data.contractProductList.length > 0) {
|
|
if (formData.data.contractProductList && formData.data.contractProductList.length > 0) {
|
|
for (let i = 0; i < formData.data.contractProductList.length; i++) {
|
|
for (let i = 0; i < formData.data.contractProductList.length; i++) {
|
|
if (formData.data.contractProductList[i].amount) {
|
|
if (formData.data.contractProductList[i].amount) {
|
|
- money = parseFloat(Number(money) + Number(formData.data.contractProductList[i].amount)).toFixed(4);
|
|
|
|
|
|
+ money = Number(Math.round((Number(money) + Number(formData.data.contractProductList[i].amount)) * 10000) / 10000);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (formData.data.contractProjectList && formData.data.contractProjectList.length > 0) {
|
|
if (formData.data.contractProjectList && formData.data.contractProjectList.length > 0) {
|
|
for (let i = 0; i < formData.data.contractProjectList.length; i++) {
|
|
for (let i = 0; i < formData.data.contractProjectList.length; i++) {
|
|
if (formData.data.contractProjectList[i].amount) {
|
|
if (formData.data.contractProjectList[i].amount) {
|
|
- money = parseFloat(Number(money) + Number(formData.data.contractProjectList[i].amount)).toFixed(4);
|
|
|
|
|
|
+ money = Number(Math.round((Number(money) + Number(formData.data.contractProjectList[i].amount)) * 10000) / 10000);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|