|
@@ -89,7 +89,7 @@
|
|
|
<span>添加清单</span>
|
|
|
</el-button>
|
|
|
</template>
|
|
|
- <hc-table is-new :index-style="{ width: 60 }" :is-stripe="false" :column="addTableColumn" :datas="addTableData" :row-style="addTableRowStyle">
|
|
|
+ <hc-table :key="tableKey" is-new :index-style="{ width: 60 }" :is-stripe="false" :column="addTableColumn" :datas="addTableData" :row-style="addTableRowStyle">
|
|
|
<template #currentPrice="{ row }">
|
|
|
<hc-table-input v-model="row.currentPrice" disabled />
|
|
|
</template>
|
|
@@ -153,7 +153,7 @@ import { nextTick, ref, watch } from 'vue'
|
|
|
import { isNumberReg } from '~uti/tools'
|
|
|
import HcBillBaseModal from './addBillBaseModal.vue'
|
|
|
import qualityRleation from './qualityRleation.vue'
|
|
|
-import { arrDelKey, arrToId, arrToKey, deepClone, getArrValue, getObjValue, getRandom, isArrIndex, isNullES } from 'js-fast-way'
|
|
|
+import { arrDelKey, arrToId, arrToKey, deepClone, getArrValue, getObjValue, getRandom, getUUID, isArrIndex, isNullES } from 'js-fast-way'
|
|
|
import BigNumber from 'bignumber.js'
|
|
|
import { getHeader } from 'hc-vue3-ui'
|
|
|
|
|
@@ -273,9 +273,11 @@ const baseFormRules = {
|
|
|
},
|
|
|
}
|
|
|
const isRelationData = ref(false)//是否管理质检资料
|
|
|
+const tableKey = ref(getUUID())
|
|
|
//监听
|
|
|
watch(() => baseForm.value.fileList, (list) => {
|
|
|
console.log(list, 'list')
|
|
|
+ tableKey.value = getUUID()
|
|
|
// 验证数组中的对象是否包含名为 'selectId' 的字段
|
|
|
const fieldName = 'selectId'
|
|
|
|
|
@@ -292,6 +294,14 @@ if (containsField) {
|
|
|
ele.upPayRatio = ele.oldupPayRatio
|
|
|
})
|
|
|
}
|
|
|
+// 判断数组中是否存在某个对象的 upPayRatio 字段值为 100
|
|
|
+const hasValue100 = addTableData.value.some(obj => obj.upPayRatio === 100)
|
|
|
+nextTick(()=>{
|
|
|
+ if (hasValue100 && (isComparedRaVal.value === 1 || isComparedRaVal.value === null)) {
|
|
|
+ window.$message.warning('累计计量金额超出支付比列,如需计量100%,请完成关联对应的质保资料')
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
}, { deep: true })
|
|
|
//获取数据详情
|
|
|
const selectId = ref('')
|
|
@@ -448,7 +458,7 @@ const addTableColumn = ref([
|
|
|
{ key: 'payRatio', name: '支付比例(%)', width: '140' },
|
|
|
{ key: 'containChangeTotal', name: '含变更数量', width: '100' },
|
|
|
{ key: 'currentMeterMoney', name: '本期计量金额', width: '120' },
|
|
|
- { key: 'allMeterTotal', name: '累计计量量', width: '100' },
|
|
|
+ { key: 'allMeterTotal', name: '累计计数量', width: '100' },
|
|
|
{ key: 'otherMeterTotal', name: '基数', width: '80' },
|
|
|
{ key: 'action', name: '操作', fixed: 'right', width: 80, align: 'center' },
|
|
|
])
|
|
@@ -542,6 +552,8 @@ const unPayRatioBlur = (row)=>{
|
|
|
row.currentMeterTotal = (payRatio.dividedBy(100).multipliedBy(changeTotal)).toString()
|
|
|
const isComparedRa = result.comparedTo(upPayRatio)
|
|
|
isComparedRaVal.value = isComparedRa
|
|
|
+ console.log(upPayRatio, 'upPayRatio')
|
|
|
+ console.log(payRatio, 'payRatio')
|
|
|
console.log(isComparedRa, 'isComparedRa')
|
|
|
// //a 大于 b = 1,a 等于 b = 0,a 小于 b = -1, a 或 b 的值异常时 = null
|
|
|
if (isComparedRa === 1 || isComparedRa === null) {
|
|
@@ -564,9 +576,33 @@ const unPayRatioBlur = (row)=>{
|
|
|
const isCanSave = ref(false)
|
|
|
|
|
|
const addTableRowStyle = ({ row }) => {
|
|
|
+ console.log(row, 'rowcxxuanr')
|
|
|
+
|
|
|
//本期支付比例+其他期支付比例
|
|
|
// 是否大于最大支付比例
|
|
|
- if ( isComparedRaVal.value === 1 || isComparedRaVal.value === null) {
|
|
|
+ // if ( isComparedRaVal.value === 1 || isComparedRaVal.value === null) {
|
|
|
+ // isCanSave.value = true
|
|
|
+
|
|
|
+ // return '--el-table-tr-bg-color: #fe0000; --el-table-row-hover-bg-color: #fe0000; color: white;'
|
|
|
+
|
|
|
+
|
|
|
+ // } else {
|
|
|
+ // isCanSave.value = false
|
|
|
+
|
|
|
+ // }
|
|
|
+
|
|
|
+ let payRatio = new BigNumber(row.payRatio )//本期支付比例
|
|
|
+ let upPayRatio = new BigNumber(row.upPayRatio )//最大支付比例
|
|
|
+ let otherPayRatio = new BigNumber(row.otherPayRatio )//其他期支付比例
|
|
|
+ let result = BigNumber(payRatio).plus(otherPayRatio)//本期支付比例+其他期支付比例
|
|
|
+
|
|
|
+ const isComparedRa = result.comparedTo(upPayRatio)
|
|
|
+ isComparedRaVal.value = isComparedRa
|
|
|
+ console.log(upPayRatio, 'upPayRatio')
|
|
|
+ console.log(payRatio, 'payRatio')
|
|
|
+ console.log(isComparedRa, 'isComparedRa333334444')
|
|
|
+ // //a 大于 b = 1,a 等于 b = 0,a 小于 b = -1, a 或 b 的值异常时 = null
|
|
|
+ if (isComparedRa === 1 || isComparedRa === null) {
|
|
|
isCanSave.value = true
|
|
|
|
|
|
return '--el-table-tr-bg-color: #fe0000; --el-table-row-hover-bg-color: #fe0000; color: white;'
|