Ver Fonte

合同计量单元修改

ZaiZai há 1 ano atrás
pai
commit
6ffadc222d

+ 1 - 1
src/config/index.json

@@ -1,6 +1,6 @@
 {
     "version": "20230607160059",
-    "target": "http://192.168.0.109:8090",
+    "target": "http://192.168.0.152:8090",
     "smsPhone": "",
     "vite": {
         "port": 5180,

+ 22 - 16
src/views/project/debit/contract/components/unit/row-data.vue

@@ -52,16 +52,16 @@
                     </el-col>
                     <el-col :span="6">
                         <el-form-item label="施工图金额:">
-                            <el-input-number v-model="formModel.buildPictureMoney" disabled :controls="false" :min="0" class="w-100" :precision="2">
+                            <el-input v-model="formModel.buildPictureMoney" disabled class="w-100">
                                 <template #suffix>元</template>
-                            </el-input-number>
+                            </el-input>
                         </el-form-item>
                     </el-col>
                     <el-col :span="6">
                         <el-form-item label="变更后金额:">
-                            <el-input-number v-model="formModel.changeMoney" disabled :controls="false" :min="0" class="w-100" :precision="2">
+                            <el-input v-model="formModel.changeMoney" disabled class="w-100">
                                 <template #suffix>元</template>
-                            </el-input-number>
+                            </el-input>
                         </el-form-item>
                     </el-col>
                     <el-col :span="6">
@@ -111,10 +111,10 @@
 import { ref, watch } from 'vue'
 import AddCheckList from './addCheckList.vue'
 import unitApi from '~api/project/debit/contract/unit.js'
-import { useAppStore } from '~src/store'
 import { getDictionary } from '~api/other'
 import { getArrValue } from 'js-fast-way'
 import { delMessageV2 } from '~com/message/index.js'
+import BigNumber from 'bignumber.js'
 
 const props = defineProps({
     ids: {
@@ -143,13 +143,19 @@ const curTreeData = ref(props.curTreeData)
 const isTable = ref(props.isTable)
 const formModel = ref({})
 const tableData = ref([])
+
 //设置某一行的样式
-const tableRowStyle = ({ row, rowIndex }) => {
-    if (row.poseNum > row.contractTotal) {
+const tableRowStyle = ({ row }) => {
+    let poseNum = new BigNumber(row.poseNum) //a
+    let contractTotal = new BigNumber(row.contractTotal) //b
+    //a 大于 b = 1,a 等于 b = 0,a 小于 b = -1, a 或 b 的值异常时 = null
+    const isCompared = poseNum.comparedTo(contractTotal)
+    if (!isCompared || isCompared === 1) {
         isCanSave.value = true
-        return '--el-table-tr-bg-color: #fe0000;color:white '
+        return '--el-table-tr-bg-color: #fe0000; --el-table-row-hover-bg-color: #fe0000; color: white;'
     }
 }
+
 const isCanSave = ref(false)
 const changePoseNum = (row)=>{
     row.residueNum = row.changeTotal - row.poseNum
@@ -166,7 +172,7 @@ const changePoseNum = (row)=>{
     return accumulator
     }, 0)
     formModel.value.buildPictureMoney = sum
- 
+
 
 }
 //获节点类型
@@ -202,7 +208,7 @@ watch(() => [
     formModel.value = cur
     isTable.value = tabs
     tableData.value = curTreeData.value.decompositionList
-    
+
     if (curTreeData.value?.id) {
         getNodeType(curTreeData.value?.id)
     }
@@ -219,7 +225,7 @@ watch(tableData, (val) => {
     return accumulator
     }, 0)
      formModel.value.changeMoney = sum1
-   
+
     }
 }, { deep: true })
 
@@ -262,13 +268,13 @@ const modalSave = async () => {
     addNodeLoading.value = true
     const { error, code, msg } = await unitApi.updateForm({
             ...formModel.value,
-      
+
         })
         //判断状态
         addNodeLoading.value = false
         if (!error && code === 200) {
             window?.$message?.success(msg)
-     
+
         }
     emit('finish')
 }
@@ -297,14 +303,14 @@ const delRow = async (row, index)=>{
 }
 const removeCon = async (id, index) => {
     const { error, code } = await unitApi.removeInfo({
-        formIds: id, 
+        formIds: id,
         meterId:ids.value,
     })
     if (!error && code === 200) {
         window?.$message?.success('删除成功')
         tableData.value.splice(index, 1)
-     
-            
+
+
         }
 }
 </script>