|
@@ -120,7 +120,7 @@
|
|
<el-table-column prop="contractTotal" label="变更前" />
|
|
<el-table-column prop="contractTotal" label="变更前" />
|
|
<el-table-column prop="currentChangeTotal" label="变更增减">
|
|
<el-table-column prop="currentChangeTotal" label="变更增减">
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
- <hc-table-input v-model="row.currentChangeTotal" @blur="currentChangeTotalBlur($event, row)" />
|
|
|
|
|
|
+ <hc-table-input v-model="row.currentChangeTotal" @blur="currentChangeTotalBlur(row)" />
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="changeTotal" label="变更后" />
|
|
<el-table-column prop="changeTotal" label="变更后" />
|
|
@@ -357,33 +357,46 @@ const changeNodeFinish = (data) => {
|
|
}
|
|
}
|
|
|
|
|
|
//变更清单增减
|
|
//变更清单增减
|
|
-const currentChangeTotalBlur = (event, row) => {
|
|
|
|
- //计算数量
|
|
|
|
|
|
+const currentChangeTotalBlur = (row) => {
|
|
const changeNum = (BigNumber(row.contractTotal).plus(row.currentChangeTotal)).toNumber()
|
|
const changeNum = (BigNumber(row.contractTotal).plus(row.currentChangeTotal)).toNumber()
|
|
if (changeNum < 0) {
|
|
if (changeNum < 0) {
|
|
window.$message.warning('变更增减数量不能小于变更前数量')
|
|
window.$message.warning('变更增减数量不能小于变更前数量')
|
|
- row.currentChangeTotal = '-' + row.contractTotal
|
|
|
|
|
|
+ const contract = '-' + row.contractTotal
|
|
|
|
+ nextTick(() => {
|
|
|
|
+ //计算金额
|
|
|
|
+ row.currentChangeMoney = (BigNumber(contract).multipliedBy(row.currentPrice)).toNumber()
|
|
|
|
+ row.changeMoney = 0
|
|
|
|
+
|
|
|
|
+ //设置数量
|
|
|
|
+ row.currentChangeTotal = contract
|
|
|
|
+ row.changeTotal = 0
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ nextTick(() => {
|
|
|
|
+ //设置数量
|
|
|
|
+ row.changeTotal = changeNum
|
|
|
|
+ //计算金额
|
|
|
|
+ row.currentChangeMoney = (BigNumber(row.currentChangeTotal).multipliedBy(row.currentPrice)).toNumber()
|
|
|
|
+ row.changeMoney = (BigNumber(changeNum).multipliedBy(row.currentPrice)).toNumber()
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- row.changeTotal = changeNum
|
|
|
|
-
|
|
|
|
- //计算金额
|
|
|
|
- row.currentChangeMoney = (BigNumber(row.currentChangeTotal).multipliedBy(row.currentPrice)).toNumber()
|
|
|
|
- row.changeMoney = (BigNumber(changeNum).multipliedBy(row.currentPrice)).toNumber()
|
|
|
|
getFormList()
|
|
getFormList()
|
|
}
|
|
}
|
|
|
|
|
|
//获取变更清单总额
|
|
//获取变更清单总额
|
|
const getFormList = () => {
|
|
const getFormList = () => {
|
|
- let total = 0, table = deepClone(tableData.value)
|
|
|
|
|
|
+ let total = 0, table = tableData.value
|
|
for (let i = 0; i < table.length; i++) {
|
|
for (let i = 0; i < table.length; i++) {
|
|
const item = table[i]
|
|
const item = table[i]
|
|
|
|
+ if (!isArray(item.formList)) {
|
|
|
|
+ item.formList = []
|
|
|
|
+ }
|
|
for (let j = 0; j < item.formList.length; j++) {
|
|
for (let j = 0; j < item.formList.length; j++) {
|
|
const form = item.formList[j]
|
|
const form = item.formList[j]
|
|
total = (BigNumber(total).plus(form.currentChangeMoney)).toNumber()
|
|
total = (BigNumber(total).plus(form.currentChangeMoney)).toNumber()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- tableData.value = []
|
|
|
|
- tableData.value = table
|
|
|
|
|
|
+ baseForm.value.changeMoney = total
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|