|
@@ -158,6 +158,16 @@ const changePoseNum = (row)=>{
|
|
|
} else {
|
|
|
isCanSave.value = false
|
|
|
}
|
|
|
+ //计算施工金额
|
|
|
+ let sum = tableData.value.reduce((accumulator, current) => {
|
|
|
+ if (current.poseNum && current.currentPrice) {
|
|
|
+ return accumulator + (current.poseNum * current.currentPrice)
|
|
|
+ }
|
|
|
+ return accumulator
|
|
|
+ }, 0)
|
|
|
+ formModel.value.buildPictureMoney = sum
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
//获节点类型
|
|
|
const nodeOptions = ref([])
|
|
@@ -192,12 +202,27 @@ watch(() => [
|
|
|
formModel.value = cur
|
|
|
isTable.value = tabs
|
|
|
tableData.value = curTreeData.value.decompositionList
|
|
|
+
|
|
|
if (curTreeData.value?.id) {
|
|
|
getNodeType(curTreeData.value?.id)
|
|
|
}
|
|
|
}, { immediate: true })
|
|
|
|
|
|
-//监听
|
|
|
+
|
|
|
+watch(tableData, (val) => {
|
|
|
+ if (val) {
|
|
|
+ //计算变更后金额
|
|
|
+ let sum1 = tableData.value.reduce((accumulator, current) => {
|
|
|
+ if (current.changeTotal && current.currentPrice) {
|
|
|
+ return accumulator + (current.changeTotal * current.currentPrice)
|
|
|
+ }
|
|
|
+ return accumulator
|
|
|
+ }, 0)
|
|
|
+ formModel.value.changeMoney = sum1
|
|
|
+
|
|
|
+ }
|
|
|
+}, { deep: true })
|
|
|
+
|
|
|
watch(isShow, (val) => {
|
|
|
if (val) {
|
|
|
console.log('isShow', val)
|
|
@@ -205,7 +230,6 @@ watch(isShow, (val) => {
|
|
|
getStakeype()
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
//弹窗表单
|
|
|
const formRef = ref(null)
|
|
|
// const formModel = ref({})
|
|
@@ -278,7 +302,8 @@ const removeCon = async (id, index) => {
|
|
|
if (!error && code === 200) {
|
|
|
window?.$message?.success('删除成功')
|
|
|
tableData.value.splice(index, 1)
|
|
|
-
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|